diff --git a/gamecore/modules/menusystem/init.lua b/gamecore/modules/menusystem/init.lua index 9589761..780796d 100644 --- a/gamecore/modules/menusystem/init.lua +++ b/gamecore/modules/menusystem/init.lua @@ -43,7 +43,8 @@ function MenuSystem:new(scene) self.menus = {} self.focusedMenu = "" self.isActive = true - self.lockWorld = false + self.lockWorld = false + self.lockAssets = false end function MenuSystem:reset() @@ -55,20 +56,34 @@ end function MenuSystem:activate() self.isActive = true + if (self.lockWorld) then if (self.scene.world ~= nil) then self.scene.world:setActivity(false) end end + + if (self.lockAssets) then + if (self.scene.assets ~= nil) then + self.scene.assets:setActivity(false) + end + end end function MenuSystem:deactivate() self.isActive = false + if (self.lockWorld) then if (self.scene.world ~= nil) then self.scene.world:setActivity(true) end end + + if (self.lockAssets) then + if (self.scene.assets ~= nil) then + self.scene.assets:setActivity(true) + end + end end function MenuSystem:getActiveState() @@ -79,6 +94,11 @@ function MenuSystem:lockWorldWhenActive(state) self.lockWorld = state end +function MenuSystem:lockAssetsWhenActive(state) + self.lockAssets = state +end + + -- MENUS FUNCTIONS -- Controle the menus of the menusystem