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.sound = {}
self.sound.asset = nil
self.sound.active = false
self:resetSound()
self:register()
end
@ -252,6 +250,12 @@ end
-- SOUND FUNCTION
-- Handle SFX
function Menu:resetSound()
self.sound = {}
self.sound.active = true
self.sound.asset = nil
end
function Menu:setSound(soundasset)
self.sound.active = true
self.sound.asset = soundasset