From ea7856e52d55c16935be23877abebf7873d3573e Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 13 Nov 2016 12:51:53 +0100 Subject: [PATCH 1/6] add hit lighting as sb option --- src/yugecin/opsudance/ui/OptionsOverlay.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/yugecin/opsudance/ui/OptionsOverlay.java b/src/yugecin/opsudance/ui/OptionsOverlay.java index f1db2c11..02828d3a 100644 --- a/src/yugecin/opsudance/ui/OptionsOverlay.java +++ b/src/yugecin/opsudance/ui/OptionsOverlay.java @@ -63,6 +63,7 @@ public class OptionsOverlay { Options.GameOption.PIPPI_ANGLE_INC_MUL_SLIDER, Options.GameOption.PIPPI_SLIDER_FOLLOW_EXPAND, Options.GameOption.PIPPI_PREVENT_WOBBLY_STREAMS, + Options.GameOption.SHOW_HIT_LIGHTING, }; private int textHeight; From a01a23324526bfd2594ff607f5f2d7df07b22c1b Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 13 Nov 2016 12:53:57 +0100 Subject: [PATCH 2/6] add hint for keymap save/load position --- src/yugecin/opsudance/ui/SBOverlay.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/yugecin/opsudance/ui/SBOverlay.java b/src/yugecin/opsudance/ui/SBOverlay.java index 39ee416b..ec6c647a 100644 --- a/src/yugecin/opsudance/ui/SBOverlay.java +++ b/src/yugecin/opsudance/ui/SBOverlay.java @@ -72,6 +72,7 @@ public class SBOverlay { return; } int lh = Fonts.SMALL.getLineHeight(); + Fonts.SMALL.drawString(10, height - 50 + lh, "save position: ctrl+s, load position: ctrl+l", Color.cyan); Fonts.SMALL.drawString(10, height - 50, "speed: C " + (speed / 10f) + " V", Color.cyan); Fonts.SMALL.drawString(10, height - 50 - lh, "Menu: N", Color.cyan); Fonts.SMALL.drawString(10, height - 50 - lh * 2, "HIDE: H", Color.cyan); From 454d09b5d098fd17f03fe75aa822acd05d4e170a Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 13 Nov 2016 13:09:28 +0100 Subject: [PATCH 3/6] save the current options into the first obj's options --- src/yugecin/opsudance/ui/SBOverlay.java | 32 ++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/yugecin/opsudance/ui/SBOverlay.java b/src/yugecin/opsudance/ui/SBOverlay.java index ec6c647a..5a361a29 100644 --- a/src/yugecin/opsudance/ui/SBOverlay.java +++ b/src/yugecin/opsudance/ui/SBOverlay.java @@ -29,6 +29,7 @@ import org.newdawn.slick.Input; import org.newdawn.slick.state.StateBasedGame; import yugecin.opsudance.ObjectColorOverrides; +import java.util.ArrayList; import java.util.HashMap; import java.util.Map; @@ -77,18 +78,20 @@ public class SBOverlay { Fonts.SMALL.drawString(10, height - 50 - lh, "Menu: N", Color.cyan); Fonts.SMALL.drawString(10, height - 50 - lh * 2, "HIDE: H", Color.cyan); Fonts.SMALL.drawString(10, height - 50 - lh * 3, "obj: J " + index + " K", Color.cyan); + g.setColor(Color.red); if (index < optionsMap.length && optionsMap[index] != null) { int i = 0; for (Object o : optionsMap[index].entrySet()) { Map.Entry option = (Map.Entry) o; - Fonts.SMALL.drawString(10, 50 + i++ * lh, option.getKey().getDisplayName(), Color.cyan); + Fonts.SMALL.drawString(10, 50 + i * lh, option.getKey().getDisplayName(), Color.cyan); + g.fillRect(0, 50 + i * lh + lh / 4, 10, 10); + i++; } } if (gameObjects.length > 0) { int start = gameObjects[0].getTime(); int end = gameObjects[gameObjects.length - 1].getEndTime(); float curtime = (float) (MusicController.getPosition() - start) / (end - start); - g.setColor(Color.red); g.fillRect(curtime * width, height - 10f, 10f, 10f); } if (menu) { @@ -175,6 +178,11 @@ public class SBOverlay { public void setGameObjects(GameObject[] gameObjects) { if (this.gameObjects.length != gameObjects.length) { optionsMap = new HashMap[gameObjects.length]; + // copy all current settings in first obj map + optionsMap[0] = new HashMap<>(); + for (Options.GameOption o : options.getSavedOptionList()) { + optionsMap[0].put(o, o.write()); + } } this.gameObjects = gameObjects; } @@ -211,7 +219,25 @@ public class SBOverlay { } public boolean mouseReleased(int button, int x, int y) { - return menu && options.mouseReleased(button, x, y); + if (menu) { + return options.mouseReleased(button, x, y); + } + if (x > 10 || index >= optionsMap.length || optionsMap[index] == null) { + return false; + } + int lh = Fonts.SMALL.getLineHeight(); + int ypos = 50 + lh / 4; + for (Object o : optionsMap[index].entrySet()) { + if (y >= ypos && y <= ypos + 10) { + optionsMap[index].remove(((Map.Entry) o).getKey()); + if (optionsMap[index].size() == 0) { + optionsMap[index] = null; + } + return true; + } + ypos += lh; + } + return false; } public boolean mouseWheelMoved(int newValue) { From db6c813715152e18dbc6ab7cec2c50b234f62cb0 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 13 Nov 2016 13:10:49 +0100 Subject: [PATCH 4/6] pause music when pressing c and already at 0 speed --- src/yugecin/opsudance/ui/SBOverlay.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/yugecin/opsudance/ui/SBOverlay.java b/src/yugecin/opsudance/ui/SBOverlay.java index 5a361a29..75c6d846 100644 --- a/src/yugecin/opsudance/ui/SBOverlay.java +++ b/src/yugecin/opsudance/ui/SBOverlay.java @@ -115,8 +115,10 @@ public class SBOverlay { if (options.keyPressed(key, c)) { return true; } - if (key == Input.KEY_C && speed > 0) { - speed -= 1; + if (key == Input.KEY_C) { + if (speed > 0) { + speed -= 1; + } if (speed == 0) { MusicController.pause(); } else { From 41143586f6e523a12ea78d05c4840b4d1b656430 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 13 Nov 2016 13:12:57 +0100 Subject: [PATCH 5/6] show option value in sblist --- src/yugecin/opsudance/ui/SBOverlay.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/yugecin/opsudance/ui/SBOverlay.java b/src/yugecin/opsudance/ui/SBOverlay.java index 75c6d846..2bab4997 100644 --- a/src/yugecin/opsudance/ui/SBOverlay.java +++ b/src/yugecin/opsudance/ui/SBOverlay.java @@ -84,6 +84,7 @@ public class SBOverlay { for (Object o : optionsMap[index].entrySet()) { Map.Entry option = (Map.Entry) o; Fonts.SMALL.drawString(10, 50 + i * lh, option.getKey().getDisplayName(), Color.cyan); + Fonts.SMALL.drawString(250, 50 + i * lh, option.getKey().getValueString(), Color.cyan); g.fillRect(0, 50 + i * lh + lh / 4, 10, 10); i++; } From 1786e74a51f43f12f05c8c2a80bd5e11c4e55b7a Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 13 Nov 2016 13:13:22 +0100 Subject: [PATCH 6/6] use name instead of displayname --- src/yugecin/opsudance/ui/SBOverlay.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yugecin/opsudance/ui/SBOverlay.java b/src/yugecin/opsudance/ui/SBOverlay.java index 2bab4997..330fa8c5 100644 --- a/src/yugecin/opsudance/ui/SBOverlay.java +++ b/src/yugecin/opsudance/ui/SBOverlay.java @@ -83,7 +83,7 @@ public class SBOverlay { int i = 0; for (Object o : optionsMap[index].entrySet()) { Map.Entry option = (Map.Entry) o; - Fonts.SMALL.drawString(10, 50 + i * lh, option.getKey().getDisplayName(), Color.cyan); + Fonts.SMALL.drawString(10, 50 + i * lh, option.getKey().getName(), Color.cyan); Fonts.SMALL.drawString(250, 50 + i * lh, option.getKey().getValueString(), Color.cyan); g.fillRect(0, 50 + i * lh + lh / 4, 10, 10); i++;