sonic-radiance/sonic-radiance.love/game/scenes/init.lua

45 lines
1.2 KiB
Lua
Raw Normal View History

local BirbScene = require "birb.modules.scenes"
local RadianceScene = BirbScene:extend()
2021-08-26 23:27:21 +02:00
local Overlay = require "game.modules.gui.overlay"
2021-08-31 19:13:17 +02:00
local MessageQueue = require "game.modules.messagequeue"
local ActionPrompt = require "game.modules.gui.actionPrompt"
2021-08-26 23:27:21 +02:00
function RadianceScene:new(haveBorder, showVersion)
RadianceScene.super.new(self)
-- Importation Global des assets
self.assets:batchImport("assets.commons")
self.assets.fonts["small"]:setLineHeight(16/18)
self.assets.fonts["small"]:setFilter("shadow")
self.gui:addSFX("select", "mSelect")
self.gui:addSFX("navigate", "mBeep")
self.gui:addSFX("back", "mBack")
self.gui:addSFX("error", "mError")
2021-08-26 23:27:21 +02:00
Overlay(haveBorder, showVersion)
2021-08-31 19:13:17 +02:00
MessageQueue(self)
ActionPrompt()
2021-08-26 23:27:21 +02:00
end
function RadianceScene:hideOverlay()
self.gui:hideScreen("overlay")
end
function RadianceScene:showMessage(message)
self.gui.elements["messageQueue"]:addMessage(message)
end
function RadianceScene:setPrompt(message)
self.gui.elements["actionPrompt"]:setText(message)
end
2021-08-31 19:13:17 +02:00
function RadianceScene:showOverlay(darken)
2021-08-26 23:27:21 +02:00
self.gui:showScreen("overlay")
2021-08-31 19:13:17 +02:00
if (darken) then
self.gui:playScreenTransform("overlay", "showBackground")
end
2021-08-26 23:27:21 +02:00
end
return RadianceScene