modules/menusystem: add a function to reset menus' sound state

This commit is contained in:
Kazhnuz 2019-04-20 17:45:58 +02:00
parent d1c2f8634b
commit 51ea3629d0

View file

@ -58,9 +58,7 @@ function Menu:new(menusystem, name, x, y, w, h)
self.depth = 0 self.depth = 0
self.sound = {} self:resetSound()
self.sound.asset = nil
self.sound.active = false
self:register() self:register()
end end
@ -252,6 +250,12 @@ end
-- SOUND FUNCTION -- SOUND FUNCTION
-- Handle SFX -- Handle SFX
function Menu:resetSound()
self.sound = {}
self.sound.active = true
self.sound.asset = nil
end
function Menu:setSound(soundasset) function Menu:setSound(soundasset)
self.sound.active = true self.sound.active = true
self.sound.asset = soundasset self.sound.asset = soundasset