update selected list item even when mouse didn't move (so it updates when mouse is scrolled)

This commit is contained in:
yugecin 2017-01-29 13:23:08 +01:00
parent 7e135550e0
commit 347175a917

View File

@ -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;
}
}
}