modules/menusystem: add a function to reset menus' sound state
This commit is contained in:
parent
d1c2f8634b
commit
51ea3629d0
1 changed files with 7 additions and 3 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue