From e08d5f2a838b5e1e5f506755a4fecce7e3f343af Mon Sep 17 00:00:00 2001 From: yugecin Date: Sat, 1 Oct 2016 15:10:20 +0200 Subject: [PATCH] use mapid to decide starting hue for rainbow objects, also use mapid instead of title for direction etc --- src/itdelatrisu/opsu/states/Game.java | 12 ++++++------ src/yugecin/opsudance/CursorColorOverrides.java | 4 ++-- src/yugecin/opsudance/MoverDirection.java | 4 ++-- src/yugecin/opsudance/ObjectColorOverrides.java | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index d0c987f7..93082587 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -1183,7 +1183,12 @@ public class Game extends BasicGameState { Dancer.instance.reset(); Pippi.reset(); - MoverDirection.reset(beatmap.getTitle()); + MoverDirection.reset(beatmap.beatmapID); + + Slider.bpm = beatmap.bpmMin * GameMod.getSpeedMultiplier(); + + ObjectColorOverrides.reset(beatmap.beatmapID); + CursorColorOverrides.reset(beatmap.beatmapID); // free all previously cached hitobject to framebuffer mappings if some still exist FrameBufferCache.getInstance().freeMap(); @@ -1230,7 +1235,6 @@ public class Game extends BasicGameState { // initialize object maps CursorColorOverrides.comboColors = ObjectColorOverrides.comboColors = beatmap.getComboColors(); - ObjectColorOverrides.hue = 0f; for (int i = 0; i < beatmap.objects.length; i++) { HitObject hitObject = beatmap.objects[i]; @@ -1327,13 +1331,9 @@ public class Game extends BasicGameState { SoundController.mute(false); } - Slider.bpm = beatmap.bpmMin * GameMod.getSpeedMultiplier(); mirrorFrom = 0; mirrorTo = gameObjects.length; - ObjectColorOverrides.reset(beatmap.getTitle()); - CursorColorOverrides.reset(beatmap.getTitle()); - skipButton.resetHover(); if (isReplay || GameMod.AUTO.isActive()) playbackSpeed.getButton().resetHover(); diff --git a/src/yugecin/opsudance/CursorColorOverrides.java b/src/yugecin/opsudance/CursorColorOverrides.java index 641fb4cd..72ed328c 100644 --- a/src/yugecin/opsudance/CursorColorOverrides.java +++ b/src/yugecin/opsudance/CursorColorOverrides.java @@ -76,8 +76,8 @@ public enum CursorColorOverrides { this.nr = nr; } - public static void reset(String mapname) { - hue = mapname.hashCode() % 360; + public static void reset(int mapID) { + hue = mapID % 360; } @Override diff --git a/src/yugecin/opsudance/MoverDirection.java b/src/yugecin/opsudance/MoverDirection.java index 427b2b3e..ff75eab8 100644 --- a/src/yugecin/opsudance/MoverDirection.java +++ b/src/yugecin/opsudance/MoverDirection.java @@ -59,8 +59,8 @@ public enum MoverDirection { this.nr = nr; } - public static void reset(String mapName) { - rand = new Random(mapName.hashCode()); + public static void reset(int mapID) { + rand = new Random(mapID); } public abstract int getDirection(int currentDirection); diff --git a/src/yugecin/opsudance/ObjectColorOverrides.java b/src/yugecin/opsudance/ObjectColorOverrides.java index 18fb89e9..2bc7414b 100644 --- a/src/yugecin/opsudance/ObjectColorOverrides.java +++ b/src/yugecin/opsudance/ObjectColorOverrides.java @@ -78,8 +78,8 @@ public enum ObjectColorOverrides { this.nr = nr; } - public static void reset(String mapname) { - hue = mapname.hashCode() % 360; + public static void reset(int mapID) { + hue = mapID % 360; } @Override