improvement: make messages part of RadianceScene

This commit is contained in:
Kazhnuz 2021-09-16 21:18:57 +02:00
parent 35764021af
commit a6ff9b2ca2
2 changed files with 4 additions and 9 deletions

View file

@ -24,6 +24,10 @@ function RadianceScene:hideOverlay()
self.gui:hideScreen("overlay")
end
function RadianceScene:showMessage(message)
self.gui.elements["messageQueue"]:addMessage(message)
end
function RadianceScene:showOverlay(darken)
self.gui:showScreen("overlay")
if (darken) then

View file

@ -60,8 +60,6 @@ function OverWorld:new(area, playerx, playery)
self.tweens:newTween(0, 0.3, {ringBorder=16}, "inOutQuad")
self.timeBorder = -10
self.messages = MessageQueue(self)
self.isPlaying = ""
self.events = EventManager(self)
@ -93,10 +91,6 @@ function OverWorld:endEvent()
self.canPause = true
end
function OverWorld:showMessage(message)
self.messages:addMessage(message)
end
function OverWorld:registerScreen(screen)
if (self.currentScreen ~= nil) then
self.currentScreen:quit()
@ -108,7 +102,6 @@ function OverWorld:update(dt)
local keys = self:getKeys(1)
self.tweens:update(dt)
self.events:update(dt)
self.messages:update(dt)
if (self.world.isActive) then
self.charsetManager:update(dt)
@ -183,8 +176,6 @@ end
function OverWorld:draw()
self.events:draw()
self.messages:draw()
self:drawScreenBottomLayer()
end