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 <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han 2015-01-13 23:00:09 -05:00
parent 71f614c90a
commit 62b7ecd648
2 changed files with 15 additions and 1 deletions

View File

@ -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: