From 40cba83003fb75039272864e44fe9542ec3889d8 Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj Date: Wed, 4 Aug 2021 16:46:41 -0400 Subject: [PATCH] Fixed a bug with the volume sliders... ...where the SFX that played upon changing the slider's value... ...reflected the old value instead of the new one. --- scene/game_config.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scene/game_config.lua b/scene/game_config.lua index ebc995d..e20ae32 100644 --- a/scene/game_config.lua +++ b/scene/game_config.lua @@ -100,9 +100,10 @@ function ConfigScene:onInputPress(e) local option = ConfigScene.options[self.highlight] config.gamesettings[option[1]] = Mod1(config.gamesettings[option[1]]-1, #option[4]) else - playSE("cursor") - sld = self[self.options[self.highlight][4]] + local sld = self[self.options[self.highlight][4]] sld.value = math.max(sld.min, math.min(sld.max, (sld:getValue() - 5) / (sld.max - sld.min))) + sld:update() + playSE("cursor") end elseif e.input == "right" or e.scancode == "right" then if not self.options[self.highlight][3] then @@ -110,9 +111,10 @@ function ConfigScene:onInputPress(e) local option = ConfigScene.options[self.highlight] config.gamesettings[option[1]] = Mod1(config.gamesettings[option[1]]+1, #option[4]) else - playSE("cursor") sld = self[self.options[self.highlight][4]] - sld.value = math.max(sld.min, math.min(sld.max, (sld:getValue() + 5) / (sld.max - sld.min)))--math.max(0, (math.floor(sld:getValue())+2)/(sld.max-sld.min)) + sld.value = math.max(sld.min, math.min(sld.max, (sld:getValue() + 5) / (sld.max - sld.min))) + sld:update() + playSE("cursor") end elseif e.input == "menu_back" or e.scancode == "delete" or e.scancode == "backspace" then loadSave()