Cleaner Code

This commit is contained in:
Cooldude2606
2019-09-22 17:08:43 +01:00
parent 1f204c6dac
commit ce88e0a296
114 changed files with 951 additions and 583 deletions

View File

@@ -7,11 +7,13 @@ local Gui = require 'expcore.gui.core'
--[[-- Grey semi-transparent boxes that contain other elements. They have a caption, and, just like flows, they lay out children either horizontally or vertically.
@element frame
@tparam ?string|Concepts.LocalisedString title the title that will show in the frame
@tparam string direction the direction that children will be added
@usage-- Making a basic frame, contains a label with hello world
local basic_frame =
Gui.clone_concept('frame','basic_frame')
Gui.new_concept('frame')
:set_title('Basic Frame')
:define_draw(function(properties,parent,element)
element.add{
@@ -19,11 +21,19 @@ Gui.clone_concept('frame','basic_frame')
caption = 'Hello, World!'
}
end)
]]
Gui.new_concept('frame')
Gui.new_concept()
:save_as('frame')
-- Properties
:new_property('title')
:new_property('direction')
-- Draw
:define_draw(function(properties,parent,element)
-- Draw a frame
element = parent.add{
name = properties.name,
type = 'frame',