Finished Rocket Gui

This commit is contained in:
Cooldude2606
2019-05-28 01:08:09 +01:00
parent 0b9e8b8cd5
commit 56b102d823
4 changed files with 411 additions and 273 deletions

View File

@@ -37,6 +37,9 @@ local Gui = require 'expcore.gui.core'
Gui.toggle_enable(element) --- Will toggle the enabled state of an element
Gui.toggle_visible(element) --- Will toggle the visiblity of an element
Gui.set_padding(element,up,down,left,right) --- Sets the padding for a gui element
Gui.set_padding_style(style,up,down,left,right) --- Sets the padding for a gui style
Gui.create_right_align(element,flow_name) --- Allows the creation of a right align flow to place elements into
Gui.destory_if_valid(element) --- Destroies an element but tests for it being present and valid first
]]
local Instances = require 'expcore.gui.instances'

View File

@@ -154,6 +154,7 @@
Gui.set_padding(element,up,down,left,right) --- Sets the padding for a gui element
Gui.set_padding_style(style,up,down,left,right) --- Sets the padding for a gui style
Gui.create_right_align(element,flow_name) --- Allows the creation of a right align flow to place elements into
Gui.destory_if_valid(element) --- Destroies an element but tests for it being present and valid first
]]
local Gui = require 'utils.gui'
local Game = require 'utils.game'
@@ -583,4 +584,14 @@ function Gui.create_right_align(element,flow_name)
return right_flow
end
--- Destroies an element but tests for it being present and valid first
-- @tparam element LuaGuiElement the element to be destroied
-- @treturn boolean true if it was destoried
function Gui.destory_if_valid(element)
if element and element.valid then
element.destroy()
return true
end
end
return Gui