From 49e03add754d3a191bc0746709eb83b3c76676d6 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sat, 1 Oct 2016 13:58:10 +0200 Subject: [PATCH] Make mirror collage toggleable ingame by pressing M --- src/itdelatrisu/opsu/Options.java | 2 +- src/itdelatrisu/opsu/states/Game.java | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/itdelatrisu/opsu/Options.java b/src/itdelatrisu/opsu/Options.java index bf91713f..e1d94c94 100644 --- a/src/itdelatrisu/opsu/Options.java +++ b/src/itdelatrisu/opsu/Options.java @@ -694,7 +694,7 @@ public class Options { } }, - DANCE_MIRROR ("Mirror collage", "MirrorCollage", "Hypnotizing stuff", Dancer.mirror) { + DANCE_MIRROR ("Mirror collage", "MirrorCollage", "Hypnotizing stuff. Toggle this ingame by pressing the M key.", Dancer.mirror) { @Override public void click(GameContainer container) { bool = !bool; diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index 6a5acd3a..de58bf5b 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -254,6 +254,9 @@ public class Game extends BasicGameState { /** Music position bar coordinates and dimensions (for replay seeking). */ private float musicBarX, musicBarY, musicBarWidth, musicBarHeight; + private int mirrorFrom; + private int mirrorTo; + /** Music position bar background colors. */ private static final Color MUSICBAR_NORMAL = new Color(12, 9, 10, 0.25f), @@ -1014,6 +1017,17 @@ public class Game extends BasicGameState { case Input.KEY_F12: Utils.takeScreenShot(); break; + case Input.KEY_M: + if (Dancer.mirror) { + mirrorTo = objectIndex; + Dancer.mirror = false; + mirrorCursor.resetLocations(); + } else { + mirrorFrom = objectIndex + 1; + mirrorTo = gameObjects.length; + Dancer.mirror = true; + } + break; } } @@ -1314,6 +1328,8 @@ public class Game extends BasicGameState { } Slider.bpm = beatmap.bpmMin * GameMod.getSpeedMultiplier(); + mirrorFrom = 0; + mirrorTo = gameObjects.length; skipButton.resetHover(); if (isReplay || GameMod.AUTO.isActive()) @@ -1427,7 +1443,7 @@ public class Game extends BasicGameState { if (!loseState) { if (!Dancer.hideobjects) { gameObj.draw(g, trackPosition, false); - if (Dancer.mirror && GameMod.AUTO.isActive()) { + if (Dancer.mirror && GameMod.AUTO.isActive() && idx <= mirrorTo && idx >= mirrorFrom) { g.pushTransform(); g.rotate(Options.width / 2f, Options.height / 2f, 180f); gameObj.draw(g, trackPosition, true);