From 7ca60da3fd3f6b1c9e683097794a223bcca7ad4d Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Wed, 8 Dec 2021 11:26:27 +0100 Subject: [PATCH] chore: add a screen package --- .../birb/modules/gui/{screen.lua => screen/init.lua} | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) rename sonic-radiance.love/birb/modules/gui/{screen.lua => screen/init.lua} (94%) diff --git a/sonic-radiance.love/birb/modules/gui/screen.lua b/sonic-radiance.love/birb/modules/gui/screen/init.lua similarity index 94% rename from sonic-radiance.love/birb/modules/gui/screen.lua rename to sonic-radiance.love/birb/modules/gui/screen/init.lua index d4906c6..c9049c8 100644 --- a/sonic-radiance.love/birb/modules/gui/screen.lua +++ b/sonic-radiance.love/birb/modules/gui/screen/init.lua @@ -7,9 +7,8 @@ local TweenManager = require "birb.classes.time" local elementDataStruct = require "birb.structures.elementData" -function GuiScreen:new(name, controller) +function GuiScreen:new(name) self:initWrapper() - self.controller = controller or self.gui self.name = name self.isVisible = false self.transforms = {} @@ -17,13 +16,15 @@ function GuiScreen:new(name, controller) self:reset() self:registerElements() - self.controller:addScreen(name, self) + self.gui:addScreen(name, self) end function GuiScreen:initWrapper() local scene = core.scenemanager.nextScene or core.scenemanager.currentScene self.scene = scene self.gui = scene.gui + -- Présent pour la compatibilité + self.controller = self.gui self.assets = scene.assets end