From 347175a9174b721258344ff9c9e6f4cb55f3ffd6 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 29 Jan 2017 13:23:08 +0100 Subject: [PATCH] update selected list item even when mouse didn't move (so it updates when mouse is scrolled) --- src/yugecin/opsudance/ui/OptionsOverlay.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/yugecin/opsudance/ui/OptionsOverlay.java b/src/yugecin/opsudance/ui/OptionsOverlay.java index 9982ac54..c0a6ef08 100644 --- a/src/yugecin/opsudance/ui/OptionsOverlay.java +++ b/src/yugecin/opsudance/ui/OptionsOverlay.java @@ -166,7 +166,7 @@ public class OptionsOverlay extends OverlayOpsuState { // calculate positions paddingRight = (int) (displayContainer.width * 0.009375f); // not so accurate paddingLeft = (int) (displayContainer.width * 0.0180f); // not so accurate - paddingTextLeft = paddingLeft + LINEWIDTH + (int) (displayContainer.width * 0.00625); // not so accurate + paddingTextLeft = paddingLeft + LINEWIDTH + (int) (displayContainer.width * 0.00625f); // not so accurate optionStartX = paddingTextLeft; textOptionsY = Fonts.LARGE.getLineHeight() * 2; textChangeY = textOptionsY + Fonts.LARGE.getLineHeight(); @@ -544,6 +544,15 @@ public class OptionsOverlay extends OverlayOpsuState { if (sliderSoundDelay > 0) { sliderSoundDelay -= delta; } + + if (isListOptionOpen) { + if (listStartX <= mouseX && mouseX < listStartX + listWidth && listStartY <= mouseY && mouseY < listStartY + listHeight) { + listHoverIndex = (mouseY - listStartY) / listItemHeight; + } else { + listHoverIndex = -1; + } + } + if (mouseX - prevMouseX == 0 && mouseY - prevMouseY == 0) { updateIndicatorAlpha(); return; @@ -560,12 +569,6 @@ public class OptionsOverlay extends OverlayOpsuState { sliderSoundDelay = 90; SoundController.playSound(SoundEffect.MENUHIT); } - } else if (isListOptionOpen) { - if (listStartX <= mouseX && mouseX < listStartX + listWidth && listStartY <= mouseY && mouseY < listStartY + listHeight) { - listHoverIndex = (mouseY - listStartY) / listItemHeight; - } else { - listHoverIndex = -1; - } } }