From 226944b658091ac32b00c1340132d2846e5d5fc5 Mon Sep 17 00:00:00 2001 From: yugecin Date: Tue, 2 Oct 2018 22:55:52 +0200 Subject: [PATCH] fix back button being clickthrough in option overlay --- src/yugecin/opsudance/ui/OptionsOverlay.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/yugecin/opsudance/ui/OptionsOverlay.java b/src/yugecin/opsudance/ui/OptionsOverlay.java index 1b7d81d0..3fe22f63 100644 --- a/src/yugecin/opsudance/ui/OptionsOverlay.java +++ b/src/yugecin/opsudance/ui/OptionsOverlay.java @@ -655,6 +655,7 @@ public class OptionsOverlay implements ResolutionChangedListener, SkinChangedLis searchField.setFocused(false); hideAnimationTime = animationtime; hideAnimationStartProgress = (float) animationtime / SHOWANIMATIONTIME; + hoverOption = null; } public void show() { @@ -862,6 +863,15 @@ public class OptionsOverlay implements ResolutionChangedListener, SkinChangedLis } sliderOptionLength = 0; + if (backButton.contains(x, y)){ + SoundController.playSound(SoundEffect.MENUBACK); + hide(); + if (listener != null) { + listener.onLeaveOptionsMenu(); + } + return true; + } + if (x > navWidth) { if (openDropdownMenu != null) { openDropdownMenu.mouseReleased(button); @@ -925,14 +935,6 @@ public class OptionsOverlay implements ResolutionChangedListener, SkinChangedLis sectionPosition = Utils.clamp(sectionPosition, (int) scrollHandler.min, (int) scrollHandler.max); scrollHandler.scrollToPosition(sectionPosition); } - - if (backButton.contains(x, y)){ - SoundController.playSound(SoundEffect.MENUBACK); - hide(); - if (listener != null) { - listener.onLeaveOptionsMenu(); - } - } return true; }