fix back button being clickthrough in option overlay
This commit is contained in:
@@ -655,6 +655,7 @@ public class OptionsOverlay implements ResolutionChangedListener, SkinChangedLis
|
|||||||
searchField.setFocused(false);
|
searchField.setFocused(false);
|
||||||
hideAnimationTime = animationtime;
|
hideAnimationTime = animationtime;
|
||||||
hideAnimationStartProgress = (float) animationtime / SHOWANIMATIONTIME;
|
hideAnimationStartProgress = (float) animationtime / SHOWANIMATIONTIME;
|
||||||
|
hoverOption = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void show() {
|
public void show() {
|
||||||
@@ -862,6 +863,15 @@ public class OptionsOverlay implements ResolutionChangedListener, SkinChangedLis
|
|||||||
}
|
}
|
||||||
sliderOptionLength = 0;
|
sliderOptionLength = 0;
|
||||||
|
|
||||||
|
if (backButton.contains(x, y)){
|
||||||
|
SoundController.playSound(SoundEffect.MENUBACK);
|
||||||
|
hide();
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onLeaveOptionsMenu();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (x > navWidth) {
|
if (x > navWidth) {
|
||||||
if (openDropdownMenu != null) {
|
if (openDropdownMenu != null) {
|
||||||
openDropdownMenu.mouseReleased(button);
|
openDropdownMenu.mouseReleased(button);
|
||||||
@@ -925,14 +935,6 @@ public class OptionsOverlay implements ResolutionChangedListener, SkinChangedLis
|
|||||||
sectionPosition = Utils.clamp(sectionPosition, (int) scrollHandler.min, (int) scrollHandler.max);
|
sectionPosition = Utils.clamp(sectionPosition, (int) scrollHandler.min, (int) scrollHandler.max);
|
||||||
scrollHandler.scrollToPosition(sectionPosition);
|
scrollHandler.scrollToPosition(sectionPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (backButton.contains(x, y)){
|
|
||||||
SoundController.playSound(SoundEffect.MENUBACK);
|
|
||||||
hide();
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onLeaveOptionsMenu();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user