From 53278409faf0a1ea0595b013d6be037848d012b6 Mon Sep 17 00:00:00 2001 From: yugecin Date: Mon, 12 Dec 2016 18:43:01 +0100 Subject: [PATCH] ask for key input when mouse button released, not pressed --- src/yugecin/opsudance/ui/OptionsOverlay.java | 22 +++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/yugecin/opsudance/ui/OptionsOverlay.java b/src/yugecin/opsudance/ui/OptionsOverlay.java index aa25f0c1..ceddac0d 100644 --- a/src/yugecin/opsudance/ui/OptionsOverlay.java +++ b/src/yugecin/opsudance/ui/OptionsOverlay.java @@ -392,10 +392,6 @@ public class OptionsOverlay { if (isAdjustingSlider) { updateSliderOption(x, y); } - } else if (selectedOption == GameOption.KEY_LEFT) { - keyEntryLeft = true; - } else if (selectedOption == GameOption.KEY_RIGHT) { - keyEntryLeft = true; } } @@ -417,12 +413,18 @@ public class OptionsOverlay { return; } - if (hoverOption != null && hoverOption.getType() == OptionType.BOOLEAN) { - hoverOption.click(container); - parent.onSaveOption(hoverOption); - SoundController.playSound(SoundEffect.MENUHIT); - return; - } + if (hoverOption != null) { + if (hoverOption.getType() == OptionType.BOOLEAN) { + hoverOption.click(container); + parent.onSaveOption(hoverOption); + SoundController.playSound(SoundEffect.MENUHIT); + return; + } else if (hoverOption == GameOption.KEY_LEFT) { + keyEntryLeft = true; + } else if (hoverOption == GameOption.KEY_RIGHT) { + keyEntryLeft = true; + } + } // check if tab was clicked int tScrollOffset = 0;