Final Fixes

This commit is contained in:
Cooldude2606
2023-10-02 00:56:58 +01:00
parent edbfcd3afd
commit f7eb9c0c37
7 changed files with 73 additions and 68 deletions

View File

@@ -49,7 +49,7 @@ end)
]]
function Gui._prototype_element:add_to_top_flow(authenticator)
if not self.name then error("Elements for the top flow must have a static name") end
Gui.top_elements[self.name] = authenticator or true
Gui.top_elements[self] = authenticator or true
return self
end
@@ -66,11 +66,11 @@ function Gui.update_top_flow(player)
local is_visible = hide_button.visible
-- Set the visible state of all elements in the flow
for name, authenticator in pairs(Gui.top_elements) do
for element_define, authenticator in pairs(Gui.top_elements) do
-- Ensure the element exists
local element = top_flow[name]
local element = top_flow[element_define.name]
if not element then
element = Gui.defines[name](top_flow)
element = element_define(top_flow)
end
-- Set the visible state