fix: lock inputs between scenes

This commit is contained in:
Kazhnuz 2020-08-20 10:34:39 +02:00
parent e962396ee1
commit 508b044669
2 changed files with 10 additions and 3 deletions

View file

@ -40,8 +40,8 @@ function Scene:new()
self.menusystem = MenuSystem(self)
self.sources = core.input:getSources()
self.inputLocked = false
self.inputLockedTimer = 0
self.inputLocked = true
self.inputLockedTimer = 2
self:initWorld()

View file

@ -31,12 +31,14 @@ local SceneManager = Object:extend()
function SceneManager:new(controller)
self.controller = controller
self.currentScene = nil
self.nextScene = nil
self.storage = {}
end
function SceneManager:setScene(scene)
self.currentScene = scene
--self.currentScene = nil
self.nextScene = scene
end
function SceneManager:storeCurrentScene(name)
@ -63,6 +65,11 @@ end
-- Update the current scene and its subobjects
function SceneManager:update(dt)
if (self.nextScene ~= nil) then
self.currentScene = self.nextScene
self.nextScene = nil
end
if (self.currentScene ~= nil) then
self.currentScene:updateStart(dt)
self.currentScene:setKeys()