Added player List

This commit is contained in:
Cooldude2606
2019-09-28 16:17:17 +01:00
parent e2e06552ef
commit d39fd5ab18
9 changed files with 293 additions and 256 deletions

View File

@@ -40,7 +40,7 @@ end)
-- Draw
:define_draw(function(properties,parent,element)
-- Make the label right aligned
local data_name = properties.data_label_name or properties.name..'_data'
local data_name = properties.data_label_name or properties.name..'_data'
local right_align_element = right_align:draw(parent,data_name)
-- Add a new label

View File

@@ -31,19 +31,21 @@ Gui.new_concept('frame')
-- Update the table style
Gui.set_padding(element,2,2,4,4)
element.style = 'subfooter_frame'
element.caption = nil
element.caption = ''
local style = element.style
style.horizontally_stretchable = true
style.use_header_filler = false
-- Add the caption to the frame
element.add{
type = 'label',
name = 'footer_caption',
caption = properties.title,
tooltip = properties.tooltip
}
if properties.title then
element.add{
type = 'label',
name = 'footer_caption',
caption = properties.title,
tooltip = properties.tooltip
}
end
-- Add the right align area
local align = right_align:draw(element,'footer_content')

View File

@@ -27,7 +27,7 @@ Gui.new_concept('scroll_table')
Gui.new_concept('table')
:save_as('scroll_table')
:new_property('hight',nil,100)
:new_property('height',nil,100)
-- Add a scroll before the table is drawn
:define_pre_draw(function(properties,parent,element)
@@ -36,7 +36,7 @@ Gui.new_concept('table')
-- Set the scroll style
Gui.set_padding(scroll,1,1,2,2)
scroll.style.horizontally_stretchable = true
scroll.style.maximal_height = properties.hight
scroll.style.maximal_height = properties.height
-- Change the name of the element to table before it is drawn
properties.name = 'table'

View File

@@ -4,11 +4,6 @@
local Gui = require 'expcore.gui' -- @dep expcore.gui
Gui.require_concept 'label' -- @dep gui.concept.frame
local right_align =
Gui.new_concept('alignment')
--[[-- A label triplet which has a static label, a data label which can be changed, and a unit label
@see Gui.label
@see data_label
@@ -34,11 +29,8 @@ end)
local unit_label =
Gui.new_concept('data_label')
:save_as('unit_label')
:new_property('data_label_name')
:new_property('data_caption')
:new_property('data_tooltip')
:new_property('data_unit')
:new_property('data_format',nil,function(concept,element,data,...)
:set_data_format(function(concept,element,data,...)
local base_unit = concept.properties.data_unit
local caption = tostring(data)
local unit = data == 1 and base_unit or base_unit..'s'
@@ -53,6 +45,7 @@ end)
-- Add the unit label
parent.add{
name = element.name..'_unit',
type='label',
caption = unit or '',
tooltip = element.tooltip
}