From 401d5340fbe58a7bc2b5063ada6a2b6da8b01acd Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 22 Aug 2021 13:02:52 +0200 Subject: [PATCH] fix: fix guiElements drawing --- sonic-radiance.love/birb/modules/gui/elements/parent.lua | 6 +++--- sonic-radiance.love/birb/modules/gui/mixins/elements.lua | 2 +- sonic-radiance.love/birb/modules/scenes.lua | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sonic-radiance.love/birb/modules/gui/elements/parent.lua b/sonic-radiance.love/birb/modules/gui/elements/parent.lua index f0653b0..ad6ee1d 100644 --- a/sonic-radiance.love/birb/modules/gui/elements/parent.lua +++ b/sonic-radiance.love/birb/modules/gui/elements/parent.lua @@ -1,11 +1,11 @@ -local Rect = require "birb.objects.2D.rect" +local Rect = require "birb.classes.2D.rect" local GuiElement = Rect:extend() function GuiElement:new(name, x, y, w, h) GuiElement.super.new(self, x, y, w, h) self.name = name - self.isVisible = false + self.isVisible = true self.screen = nil self.depth = 0 @@ -14,7 +14,7 @@ function GuiElement:new(name, x, y, w, h) end function GuiElement:getGui() - local scene = core.scenemanager.currentScene + local scene = core.scenemanager.nextScene or core.scenemanager.currentScene return scene.gui end diff --git a/sonic-radiance.love/birb/modules/gui/mixins/elements.lua b/sonic-radiance.love/birb/modules/gui/mixins/elements.lua index ddfb608..a7a5020 100644 --- a/sonic-radiance.love/birb/modules/gui/mixins/elements.lua +++ b/sonic-radiance.love/birb/modules/gui/mixins/elements.lua @@ -18,7 +18,7 @@ end function ElementList:getVisibleElement(topLayer) local visibleList = {} - for _, element in ipairs(self.elements) do + for _, element in pairs(self.elements) do if (element ~= nil) then if (element:getVisibility() and ((element.depth) < 0 == topLayer)) then table.insert(visibleList, element) diff --git a/sonic-radiance.love/birb/modules/scenes.lua b/sonic-radiance.love/birb/modules/scenes.lua index 646b8a6..45218ac 100644 --- a/sonic-radiance.love/birb/modules/scenes.lua +++ b/sonic-radiance.love/birb/modules/scenes.lua @@ -151,9 +151,9 @@ end function Scene:drawScene() self:drawStart() self:drawWorld() + self.gui:drawBottom() self:draw() self:drawMenus() - self.gui:drawBottom() self:drawDialog() self:drawEnd() core.screen:drawTransition()