Refonte pour utiliser le systeme de GUI #112

Merged
kazhnuz merged 102 commits from feat/gui into master 2022-01-06 19:15:16 +01:00
Showing only changes of commit 7ca60da3fd - Show all commits

View file

@ -7,9 +7,8 @@ local TweenManager = require "birb.classes.time"
local elementDataStruct = require "birb.structures.elementData" local elementDataStruct = require "birb.structures.elementData"
function GuiScreen:new(name, controller) function GuiScreen:new(name)
self:initWrapper() self:initWrapper()
self.controller = controller or self.gui
self.name = name self.name = name
self.isVisible = false self.isVisible = false
self.transforms = {} self.transforms = {}
@ -17,13 +16,15 @@ function GuiScreen:new(name, controller)
self:reset() self:reset()
self:registerElements() self:registerElements()
self.controller:addScreen(name, self) self.gui:addScreen(name, self)
end end
function GuiScreen:initWrapper() function GuiScreen:initWrapper()
local scene = core.scenemanager.nextScene or core.scenemanager.currentScene local scene = core.scenemanager.nextScene or core.scenemanager.currentScene
self.scene = scene self.scene = scene
self.gui = scene.gui self.gui = scene.gui
-- Présent pour la compatibilité
self.controller = self.gui
self.assets = scene.assets self.assets = scene.assets
end end