chore: prepare for the dialog system

This commit is contained in:
Kazhnuz 2021-04-18 14:56:27 +02:00
parent 0529c14367
commit df4ef549d6

View file

@ -43,6 +43,8 @@ function Scene:new()
self.inputLocked = true self.inputLocked = true
self.inputLockedTimer = 2 self.inputLockedTimer = 2
self.dialog = nil
self:initWorld() self:initWorld()
self:register() self:register()
@ -76,11 +78,17 @@ function Scene:updateEnd(dt)
end end
function Scene:updateWorld(dt) function Scene:updateWorld(dt)
if ((self.world ~= nil) and (self.world.isActive)) then if ((self.world ~= nil) and (self.world.isActive) and (self.dialog == nil)) then
self.world:update(dt) self.world:update(dt)
end end
end end
function Scene:updateDialog(dt)
if (self.dialog ~= nil) then
self.dialog:update(dt)
end
end
-- MOUSE FUNCTIONS -- MOUSE FUNCTIONS
-- Make the scene support the pointer -- Make the scene support the pointer
@ -139,6 +147,12 @@ function Scene:drawWorld(dt)
end end
end end
function Scene:drawDialog(dt)
if (self.dialog ~= nil) then
self.dialog:draw()
end
end
-- INPUT FUNCTIONS -- INPUT FUNCTIONS
-- Handle inputs from keyboard/controllers -- Handle inputs from keyboard/controllers