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.
pull/32/head
Ishaan Bhardwaj 2021-08-04 16:46:41 -04:00
parent a1b3f73787
commit 40cba83003
1 changed files with 6 additions and 4 deletions

View File

@ -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()