From 7d9384f09ed26893d3878646ee55d77579fea0fc Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 13 Nov 2016 01:25:34 +0100 Subject: [PATCH 1/4] fix sb changes being drawn above each other instead of under --- 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 63a434ed..09e11840 100644 --- a/src/yugecin/opsudance/ui/SBOverlay.java +++ b/src/yugecin/opsudance/ui/SBOverlay.java @@ -79,7 +79,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().getDisplayName(), Color.cyan); } } if (menu) { From 623c5eefdd5bd576f26cb226d7053e0c62ee03b1 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 13 Nov 2016 01:27:32 +0100 Subject: [PATCH 2/4] fix object color override not live changing after editing in sb --- 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 09e11840..c0def5d4 100644 --- a/src/yugecin/opsudance/ui/SBOverlay.java +++ b/src/yugecin/opsudance/ui/SBOverlay.java @@ -175,6 +175,7 @@ public class SBOverlay { optionsMap[index] = new HashMap<>(); } optionsMap[index].put(option, option.write()); + readOption(option); } public boolean mousePressed(int button, int x, int y) { From 81890effd3d5757fba379db75eb971aa52aab774 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 13 Nov 2016 01:29:26 +0100 Subject: [PATCH 3/4] also instantly update when obj color rgb inc changes --- src/yugecin/opsudance/ui/SBOverlay.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/yugecin/opsudance/ui/SBOverlay.java b/src/yugecin/opsudance/ui/SBOverlay.java index c0def5d4..5f19c070 100644 --- a/src/yugecin/opsudance/ui/SBOverlay.java +++ b/src/yugecin/opsudance/ui/SBOverlay.java @@ -228,7 +228,9 @@ public class SBOverlay { // needed for object color overrides... private void readOption(Options.GameOption o) { - if (o == Options.GameOption.DANCE_OBJECT_COLOR_OVERRIDE || o == Options.GameOption.DANCE_OBJECT_COLOR_OVERRIDE_MIRRORED) { + if (o == Options.GameOption.DANCE_OBJECT_COLOR_OVERRIDE + || o == Options.GameOption.DANCE_OBJECT_COLOR_OVERRIDE_MIRRORED + || o == Options.GameOption.DANCE_RGB_OBJECT_INC) { for (int i = index; i < gameObjects.length; i++) { gameObjects[i].updateColor(); } From cf14bca4a5f3054149597b0285fec41512a42fa2 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 13 Nov 2016 01:39:30 +0100 Subject: [PATCH 4/4] prevent hue shifting when hue inc or obj color override is changed by sb --- src/awlex/ospu/FakeGameObject.java | 4 ---- src/itdelatrisu/opsu/objects/Circle.java | 1 + src/itdelatrisu/opsu/objects/DummyObject.java | 4 ---- src/itdelatrisu/opsu/objects/GameObject.java | 13 ++++++++++++- src/itdelatrisu/opsu/objects/Slider.java | 1 + src/itdelatrisu/opsu/objects/Spinner.java | 3 --- src/yugecin/opsudance/ui/SBOverlay.java | 4 ++++ 7 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/awlex/ospu/FakeGameObject.java b/src/awlex/ospu/FakeGameObject.java index b746b023..7777baf9 100644 --- a/src/awlex/ospu/FakeGameObject.java +++ b/src/awlex/ospu/FakeGameObject.java @@ -102,8 +102,4 @@ public class FakeGameObject extends GameObject { this.halfTime = time; } - @Override - public void updateColor() { - } - } \ No newline at end of file diff --git a/src/itdelatrisu/opsu/objects/Circle.java b/src/itdelatrisu/opsu/objects/Circle.java index 44718a38..acc138df 100644 --- a/src/itdelatrisu/opsu/objects/Circle.java +++ b/src/itdelatrisu/opsu/objects/Circle.java @@ -269,6 +269,7 @@ public class Circle extends GameObject { @Override public void updateColor() { + super.updateColor(); color = Dancer.colorOverride.getColor(comboColorIndex); mirrorColor = Dancer.colorMirrorOverride.getColor(comboColorIndex); } diff --git a/src/itdelatrisu/opsu/objects/DummyObject.java b/src/itdelatrisu/opsu/objects/DummyObject.java index f545d501..ce5adebd 100644 --- a/src/itdelatrisu/opsu/objects/DummyObject.java +++ b/src/itdelatrisu/opsu/objects/DummyObject.java @@ -100,8 +100,4 @@ public class DummyObject extends GameObject { return null; } - @Override - public void updateColor() { - } - } diff --git a/src/itdelatrisu/opsu/objects/GameObject.java b/src/itdelatrisu/opsu/objects/GameObject.java index b819ac32..039e8a3c 100644 --- a/src/itdelatrisu/opsu/objects/GameObject.java +++ b/src/itdelatrisu/opsu/objects/GameObject.java @@ -22,6 +22,7 @@ import itdelatrisu.opsu.objects.curves.Vec2f; import org.newdawn.slick.Color; import org.newdawn.slick.Graphics; +import yugecin.opsudance.ObjectColorOverrides; /** * Interface for hit object types used during gameplay. @@ -33,6 +34,8 @@ public abstract class GameObject { private int time; + private float hue; + public void updateStartEndPositions(int startTime) { time = startTime; start = getPointAt(startTime); @@ -101,6 +104,14 @@ public abstract class GameObject { public abstract Color getColor(); public abstract Color getMirroredColor(); - public abstract void updateColor(); + + public void updateColor() { + hue = ObjectColorOverrides.hue; + } + + // the hue of objectcoloroverrides at the point of this circle..... i know, shit placement... used for sb when hue inc changes / rainbow override + public float getHue() { + return hue; + } } diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index b71cb234..c2943694 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -714,6 +714,7 @@ public class Slider extends GameObject { @Override public void updateColor() { + super.updateColor(); color = Dancer.colorOverride.getColor(comboColorIndex); mirrorColor = Dancer.colorMirrorOverride.getColor(comboColorIndex); } diff --git a/src/itdelatrisu/opsu/objects/Spinner.java b/src/itdelatrisu/opsu/objects/Spinner.java index e507e080..251f4e0d 100644 --- a/src/itdelatrisu/opsu/objects/Spinner.java +++ b/src/itdelatrisu/opsu/objects/Spinner.java @@ -438,7 +438,4 @@ public class Spinner extends GameObject { return null; } - @Override - public void updateColor() { - } } diff --git a/src/yugecin/opsudance/ui/SBOverlay.java b/src/yugecin/opsudance/ui/SBOverlay.java index 5f19c070..5a0bb3eb 100644 --- a/src/yugecin/opsudance/ui/SBOverlay.java +++ b/src/yugecin/opsudance/ui/SBOverlay.java @@ -27,6 +27,7 @@ import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; import org.newdawn.slick.Input; import org.newdawn.slick.state.StateBasedGame; +import yugecin.opsudance.ObjectColorOverrides; import java.util.HashMap; import java.util.Map; @@ -231,6 +232,9 @@ public class SBOverlay { if (o == Options.GameOption.DANCE_OBJECT_COLOR_OVERRIDE || o == Options.GameOption.DANCE_OBJECT_COLOR_OVERRIDE_MIRRORED || o == Options.GameOption.DANCE_RGB_OBJECT_INC) { + if (index < gameObjects.length) { + ObjectColorOverrides.hue = gameObjects[index].getHue(); + } for (int i = index; i < gameObjects.length; i++) { gameObjects[i].updateColor(); }