Rebase on Radiance #71

Merged
kazhnuz merged 20 commits from wip/radiance-rebase into master 2022-08-12 10:37:35 +02:00
5 changed files with 10 additions and 6 deletions
Showing only changes of commit 8c4bcc70d5 - Show all commits

View file

@ -41,6 +41,10 @@ function SceneManager:setScene(scene)
self.nextScene = scene self.nextScene = scene
end end
function SceneManager:getScene()
return self.nextScene or self.currentScene
end
function SceneManager:haveStoredScene(name) function SceneManager:haveStoredScene(name)
return (self.storage[name] ~= nil) return (self.storage[name] ~= nil)
end end

View file

@ -19,7 +19,7 @@ function GuiElement:new(name, x, y, w, h)
end end
function GuiElement:initWrapper() function GuiElement:initWrapper()
self.scene = core.scenemanager.nextScene or core.scenemanager.currentScene self.scene = core.scenemanager:getScene()
self.gui = self.scene.gui self.gui = self.scene.gui
self.assets = self.scene.assets self.assets = self.scene.assets
end end

View file

@ -45,7 +45,7 @@ function BaseWidget:new(menuName)
end end
function BaseWidget:initWrapper() function BaseWidget:initWrapper()
self.scene = core.scenemanager.nextScene or core.scenemanager.currentScene self.scene = core.scenemanager:getScene()
self.gui = self.scene.gui self.gui = self.scene.gui
self.assets = self.scene.assets self.assets = self.scene.assets
end end
@ -60,11 +60,11 @@ function BaseWidget:getMenuByName(name)
end end
function BaseWidget:getScene() function BaseWidget:getScene()
return core.scenemanager.nextScene or core.scenemanager.currentScene return core.scenemanager:getScene()
end end
function BaseWidget:getAssets() function BaseWidget:getAssets()
local scene = core.scenemanager.nextScene or core.scenemanager.currentScene local scene = core.scenemanager:getScene()
return scene.assets return scene.assets
end end

View file

@ -23,7 +23,7 @@ function GuiScreen:new(name, controller)
end end
function GuiScreen:initWrapper() function GuiScreen:initWrapper()
local scene = core.scenemanager.nextScene or core.scenemanager.currentScene local scene = core.scenemanager:getScene()
self.scene = scene self.scene = scene
self.gui = scene.gui self.gui = scene.gui
self.assets = scene.assets self.assets = scene.assets

View file

@ -63,7 +63,7 @@ function TextMenu:generateSubmenu(pageName, label, parent, list, func, backWidge
end end
function TextMenu:setFont(fontName) function TextMenu:setFont(fontName)
local scene = core.scenemanager.currentScene local scene = core.scenemanager:getScene()
self.font = scene.assets:getFont(fontName) self.font = scene.assets:getFont(fontName)
end end