From 62b7ecd648a6e030c11b2842d533bfcd5c49064c Mon Sep 17 00:00:00 2001 From: Jeffrey Han Date: Tue, 13 Jan 2015 23:00:09 -0500 Subject: [PATCH] Fixed a small bug with hovering over song buttons. The left/right arrow keys no longer reset hover data if the start node hasn't changed. Signed-off-by: Jeffrey Han --- pom.xml | 2 +- src/itdelatrisu/opsu/states/SongMenu.java | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b363b882..9fcf7725 100644 --- a/pom.xml +++ b/pom.xml @@ -77,7 +77,7 @@ -Dmain="itdelatrisu.opsu.Opsu" -Doutput="opsu-${project.version}-runnable.jar" ${basedir}/tools/JarSplicePlus.jar - + diff --git a/src/itdelatrisu/opsu/states/SongMenu.java b/src/itdelatrisu/opsu/states/SongMenu.java index 7220c968..4ba5a563 100644 --- a/src/itdelatrisu/opsu/states/SongMenu.java +++ b/src/itdelatrisu/opsu/states/SongMenu.java @@ -506,7 +506,14 @@ public class SongMenu extends BasicGameState { OsuGroupNode next = focusNode.next; if (next != null) { SoundController.playSound(SoundEffect.MENUCLICK); + OsuGroupNode oldStartNode = startNode; + float oldHoverOffset = hoverOffset; + int oldHoverIndex = hoverIndex; setFocus(next, 0, false); + if (startNode == oldStartNode) { + hoverOffset = oldHoverOffset; + hoverIndex = oldHoverIndex; + } } break; case Input.KEY_LEFT: @@ -515,7 +522,14 @@ public class SongMenu extends BasicGameState { OsuGroupNode prev = focusNode.prev; if (prev != null) { SoundController.playSound(SoundEffect.MENUCLICK); + OsuGroupNode oldStartNode = startNode; + float oldHoverOffset = hoverOffset; + int oldHoverIndex = hoverIndex; setFocus(prev, (prev.index == focusNode.index) ? 0 : prev.osuFiles.size() - 1, false); + if (startNode == oldStartNode) { + hoverOffset = oldHoverOffset; + hoverIndex = oldHoverIndex; + } } break; case Input.KEY_NEXT: