From df4ef549d648bca4eca9738cab4fdbce3e42299c Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 18 Apr 2021 14:56:27 +0200 Subject: [PATCH] chore: prepare for the dialog system --- sonic-radiance.love/core/modules/scenes.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sonic-radiance.love/core/modules/scenes.lua b/sonic-radiance.love/core/modules/scenes.lua index f658769..848ab4d 100644 --- a/sonic-radiance.love/core/modules/scenes.lua +++ b/sonic-radiance.love/core/modules/scenes.lua @@ -43,6 +43,8 @@ function Scene:new() self.inputLocked = true self.inputLockedTimer = 2 + self.dialog = nil + self:initWorld() self:register() @@ -76,11 +78,17 @@ function Scene:updateEnd(dt) end 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) end end +function Scene:updateDialog(dt) + if (self.dialog ~= nil) then + self.dialog:update(dt) + end +end + -- MOUSE FUNCTIONS -- Make the scene support the pointer @@ -139,6 +147,12 @@ function Scene:drawWorld(dt) end end +function Scene:drawDialog(dt) + if (self.dialog ~= nil) then + self.dialog:draw() + end +end + -- INPUT FUNCTIONS -- Handle inputs from keyboard/controllers