mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-31 21:01:39 +09:00
More Code Cleaning
This commit is contained in:
@@ -67,11 +67,13 @@ function Button._prototype:set_click_filter(filter,...)
|
|||||||
filter[v] = true
|
filter[v] = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for k,v in pairs(filter) do
|
for k,v in pairs(filter) do
|
||||||
if type(v) == 'string' then
|
if type(v) == 'string' then
|
||||||
filter[k] = defines.mouse_button_type[v]
|
filter[k] = defines.mouse_button_type[v]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
self.mouse_button_filter = filter
|
self.mouse_button_filter = filter
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@@ -83,6 +85,7 @@ function Button._prototype:set_key_filter(filter,...)
|
|||||||
filter[v] = true
|
filter[v] = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
self.key_button_filter = filter
|
self.key_button_filter = filter
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,27 +2,32 @@ local Gui = require './core'
|
|||||||
local Store = require 'expcore.store'
|
local Store = require 'expcore.store'
|
||||||
local Game = require 'utils.game'
|
local Game = require 'utils.game'
|
||||||
|
|
||||||
local function store_state(self,element,value)
|
local function event_call(self,element,value)
|
||||||
element.state = value
|
|
||||||
if self.events.on_state_change then
|
if self.events.on_state_change then
|
||||||
local player = Game.get_player_by_index(element.player_index)
|
local player = Game.get_player_by_index(element.player_index)
|
||||||
self.events.on_state_change(player,element,value)
|
self.events.on_state_change(player,element,value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function store_call(self,element,value)
|
||||||
|
element.state = value
|
||||||
|
event_call(self,element,value)
|
||||||
|
end
|
||||||
|
|
||||||
local Checkbox = {
|
local Checkbox = {
|
||||||
option_sets={},
|
option_sets={},
|
||||||
option_categorize={},
|
option_categorize={},
|
||||||
_prototype_checkbox=Gui._extend_prototype{
|
_prototype_checkbox=Gui._extend_prototype{
|
||||||
on_state_change = Gui._new_event_adder('on_state_change'),
|
on_state_change = Gui._new_event_adder('on_state_change'),
|
||||||
add_store = Gui._new_store_adder(store_state)
|
add_store = Gui._new_store_adder(store_call),
|
||||||
|
add_sync_store = Gui._new_sync_store_adder(store_call)
|
||||||
},
|
},
|
||||||
_prototype_radiobutton=Gui._extend_prototype{
|
_prototype_radiobutton=Gui._extend_prototype{
|
||||||
on_state_change = Gui._new_event_adder('on_state_change'),
|
on_state_change = Gui._new_event_adder('on_state_change'),
|
||||||
add_store = Gui._new_store_adder(store_state)
|
add_store = Gui._new_store_adder(store_call),
|
||||||
|
add_sync_store = Gui._new_sync_store_adder(store_call)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setmetatable(Checkbox._prototype_radiobutton,{__index=Checkbox._prototype_checkbox})
|
|
||||||
|
|
||||||
function Checkbox.new_checkbox(name)
|
function Checkbox.new_checkbox(name)
|
||||||
|
|
||||||
@@ -55,8 +60,9 @@ function Checkbox.new_checkbox(name)
|
|||||||
local category = self.categorize and self.categorize(element) or value
|
local category = self.categorize and self.categorize(element) or value
|
||||||
self:set_store(category,value)
|
self:set_store(category,value)
|
||||||
|
|
||||||
elseif self.events.on_state_change then
|
else
|
||||||
self.events.on_state_change(event.player,element,element.state)
|
local value = element.state
|
||||||
|
event_call(self,element,value)
|
||||||
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@@ -72,14 +78,19 @@ function Checkbox.reset_radiobutton(element,exclude,recursive)
|
|||||||
if child and child.valid and child.type == 'radiobutton' then
|
if child and child.valid and child.type == 'radiobutton' then
|
||||||
local state = exclude[child.name] or false
|
local state = exclude[child.name] or false
|
||||||
local define = Gui.defines[child.name]
|
local define = Gui.defines[child.name]
|
||||||
|
|
||||||
if define then
|
if define then
|
||||||
local category = define.categorize and define.categorize(child) or state
|
local category = define.categorize and define.categorize(child) or state
|
||||||
define:set_store(category,state)
|
define:set_store(category,state)
|
||||||
|
|
||||||
else
|
else
|
||||||
child.state = state
|
child.state = state
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif child.children and (type(recursive) == 'number' and recursive > 0 or recursive == true) then
|
elseif child.children and (type(recursive) == 'number' and recursive > 0 or recursive == true) then
|
||||||
Checkbox.reset_radiobutton(child,exclude,recursive)
|
Checkbox.reset_radiobutton(child,exclude,recursive)
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -12,27 +12,6 @@ Global.register(Gui.instances,function(tbl)
|
|||||||
Gui.instances = tbl
|
Gui.instances = tbl
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
function Gui.get_define(name,internal)
|
|
||||||
local define = Gui.defines[name]
|
|
||||||
if not define and Gui.names[name] then
|
|
||||||
return Gui.defines[Gui.names[name]]
|
|
||||||
elseif not define then
|
|
||||||
return error('Invalid name for checkbox, name not found.',internal and 3 or 2) or nil
|
|
||||||
end
|
|
||||||
return define
|
|
||||||
end
|
|
||||||
|
|
||||||
function Gui.get_instances(self,category)
|
|
||||||
if not Gui.instances[self.name] then return end
|
|
||||||
local instances = Gui.instances[self.name]
|
|
||||||
if self.categorize then
|
|
||||||
if not instances[category] then instances[category] = {} end
|
|
||||||
return instances[category]
|
|
||||||
end
|
|
||||||
return instances
|
|
||||||
end
|
|
||||||
|
|
||||||
function Gui._extend_prototype(tbl)
|
function Gui._extend_prototype(tbl)
|
||||||
for k,v in pairs(Gui._prototype) do
|
for k,v in pairs(Gui._prototype) do
|
||||||
if not tbl[k] then tbl[k] = v end
|
if not tbl[k] then tbl[k] = v end
|
||||||
@@ -45,6 +24,7 @@ function Gui._new_event_adder(name)
|
|||||||
if type(callback) ~= 'function' then
|
if type(callback) ~= 'function' then
|
||||||
return error('Event callback must be a function',2)
|
return error('Event callback must be a function',2)
|
||||||
end
|
end
|
||||||
|
|
||||||
self.events[name] = callback
|
self.events[name] = callback
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@@ -77,6 +57,37 @@ function Gui._new_store_adder(callback)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Gui._new_sync_store_adder(callback)
|
||||||
|
return function(self,location,categorize)
|
||||||
|
if self.store then return end
|
||||||
|
|
||||||
|
if Store.is_registered(location) then
|
||||||
|
return error('Location for store is already registered: '..location,2)
|
||||||
|
end
|
||||||
|
|
||||||
|
self.store = location
|
||||||
|
self.categorize = categorize
|
||||||
|
Gui.instances[self.name]={}
|
||||||
|
|
||||||
|
Store.register_synced(self.store,function(value,category)
|
||||||
|
local instances = Gui.get_instances(self,category)
|
||||||
|
if instances then
|
||||||
|
|
||||||
|
for k,element in pairs(instances) do
|
||||||
|
if element and element.valid then
|
||||||
|
callback(self,element,value)
|
||||||
|
else
|
||||||
|
instances[k] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function Gui._new_define(prototype)
|
function Gui._new_define(prototype)
|
||||||
local uid = Gui.uid_name()
|
local uid = Gui.uid_name()
|
||||||
local define = setmetatable({
|
local define = setmetatable({
|
||||||
@@ -125,6 +136,7 @@ function Gui._prototype:set_pre_authenticator(callback)
|
|||||||
if type(callback) ~= 'function' then
|
if type(callback) ~= 'function' then
|
||||||
return error('Pre authenticator callback must be a function')
|
return error('Pre authenticator callback must be a function')
|
||||||
end
|
end
|
||||||
|
|
||||||
self.pre_authenticator = callback
|
self.pre_authenticator = callback
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@@ -134,6 +146,7 @@ function Gui._prototype:set_post_authenticator(callback)
|
|||||||
if type(callback) ~= 'function' then
|
if type(callback) ~= 'function' then
|
||||||
return error('Authenicater callback must be a function')
|
return error('Authenicater callback must be a function')
|
||||||
end
|
end
|
||||||
|
|
||||||
self.post_authenticator = callback
|
self.post_authenticator = callback
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@@ -186,6 +199,33 @@ function Gui._prototype:set_store(category,value)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Gui.get_define(name,internal)
|
||||||
|
local define = Gui.defines[name]
|
||||||
|
|
||||||
|
if not define and Gui.names[name] then
|
||||||
|
return Gui.defines[Gui.names[name]]
|
||||||
|
|
||||||
|
elseif not define then
|
||||||
|
return error('Invalid name for checkbox, name not found.',internal and 3 or 2) or nil
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
return define
|
||||||
|
end
|
||||||
|
|
||||||
|
function Gui.get_instances(self,category)
|
||||||
|
if not Gui.instances[self.name] then return end
|
||||||
|
|
||||||
|
local instances = Gui.instances[self.name]
|
||||||
|
if self.categorize then
|
||||||
|
if not instances[category] then instances[category] = {} end
|
||||||
|
return instances[category]
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
return instances
|
||||||
|
end
|
||||||
|
|
||||||
function Gui.get_store(name,category)
|
function Gui.get_store(name,category)
|
||||||
local define = Gui.get_define(name,true)
|
local define = Gui.get_define(name,true)
|
||||||
return define:get_store(category)
|
return define:get_store(category)
|
||||||
@@ -204,7 +244,6 @@ end
|
|||||||
function Gui.toggle_enable(element)
|
function Gui.toggle_enable(element)
|
||||||
if not element or not element.valid then return end
|
if not element or not element.valid then return end
|
||||||
if not element.enabled then
|
if not element.enabled then
|
||||||
-- this way round so if its nil it will become false
|
|
||||||
element.enabled = true
|
element.enabled = true
|
||||||
else
|
else
|
||||||
element.enabled = false
|
element.enabled = false
|
||||||
@@ -214,7 +253,6 @@ end
|
|||||||
function Gui.toggle_visible(element)
|
function Gui.toggle_visible(element)
|
||||||
if not element or not element.valid then return end
|
if not element or not element.valid then return end
|
||||||
if not element.visible then
|
if not element.visible then
|
||||||
-- this way round so if its nil it will become false
|
|
||||||
element.visible = true
|
element.visible = true
|
||||||
else
|
else
|
||||||
element.visible = false
|
element.visible = false
|
||||||
|
|||||||
@@ -1,20 +1,29 @@
|
|||||||
local Gui = require './core'
|
local Gui = require './core'
|
||||||
local Game = require 'utils.game'
|
local Game = require 'utils.game'
|
||||||
|
|
||||||
|
local function event_call(define,element,value)
|
||||||
|
local player = Game.get_player_by_index(element.player_index)
|
||||||
|
|
||||||
|
if define.events.on_selection then
|
||||||
|
define.events.on_selection(player,element,value)
|
||||||
|
end
|
||||||
|
|
||||||
|
if define.option_callbacks and define.option_callbacks[value] then
|
||||||
|
define.option_callbacks[value](player,element,value)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local _select_value
|
local _select_value
|
||||||
|
local function store_call(self,element,value)
|
||||||
|
_select_value(element,value)
|
||||||
|
event_call(self,element,value)
|
||||||
|
end
|
||||||
|
|
||||||
local Dropdown = {
|
local Dropdown = {
|
||||||
_prototype=Gui._extend_prototype{
|
_prototype=Gui._extend_prototype{
|
||||||
on_selection = Gui._new_event_adder('on_selection'),
|
on_selection = Gui._new_event_adder('on_selection'),
|
||||||
add_store = Gui._new_store_adder(function(self,element,value)
|
add_store = Gui._new_store_adder(store_call),
|
||||||
_select_value(element,value)
|
add_sync_store = Gui._new_sync_store_adder(store_call)
|
||||||
local player = Game.get_player_by_index(element.player_index)
|
|
||||||
if self.events.on_selection then
|
|
||||||
self.events.on_selection(player,element,value)
|
|
||||||
end
|
|
||||||
if self.option_callbacks and self.option_callbacks[value] then
|
|
||||||
self.option_callbacks[value](player,element,value)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,6 +44,7 @@ function Dropdown.new_dropdown(name)
|
|||||||
element.add_item(v)
|
element.add_item(v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.store then
|
if self.store then
|
||||||
local category = self.categorize and self.categorize(element) or nil
|
local category = self.categorize and self.categorize(element) or nil
|
||||||
local value = self:get_store(category)
|
local value = self:get_store(category)
|
||||||
@@ -49,15 +59,10 @@ function Dropdown.new_dropdown(name)
|
|||||||
if self.store then
|
if self.store then
|
||||||
local category = self.categorize and self.categorize(element) or value
|
local category = self.categorize and self.categorize(element) or value
|
||||||
self:set_store(category,value)
|
self:set_store(category,value)
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if self.events.on_selection then
|
else
|
||||||
self.events.on_selection(event.player,element,value)
|
event_call(self,element,value)
|
||||||
end
|
|
||||||
|
|
||||||
if self.option_callbacks and self.option_callbacks[value] then
|
|
||||||
self.option_callbacks[value](event.player,element,value)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end)
|
end)
|
||||||
@@ -72,6 +77,7 @@ function Dropdown._prototype:new_static_options(options,...)
|
|||||||
table.insert(options,v)
|
table.insert(options,v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
self.options = options
|
self.options = options
|
||||||
self.draw_data.items = options
|
self.draw_data.items = options
|
||||||
return self
|
return self
|
||||||
@@ -90,10 +96,12 @@ Dropdown._prototype.add_dynamic = Dropdown._prototype.new_dynamic_options
|
|||||||
function Dropdown._prototype:add_option_callback(option,callback)
|
function Dropdown._prototype:add_option_callback(option,callback)
|
||||||
if not self.option_callbacks then self.option_callbacks = {} end
|
if not self.option_callbacks then self.option_callbacks = {} end
|
||||||
if not self.options then self.options = {} end
|
if not self.options then self.options = {} end
|
||||||
|
|
||||||
self.option_callbacks[option] = callback
|
self.option_callbacks[option] = callback
|
||||||
if not table.contains(self.options,option) then
|
if not table.contains(self.options,option) then
|
||||||
table.insert(self.options,option)
|
table.insert(self.options,option)
|
||||||
end
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
local Gui = require './core'
|
local Gui = require './core'
|
||||||
local Game = require 'utils.game'
|
local Game = require 'utils.game'
|
||||||
|
|
||||||
local function get_instances(define,element)
|
local function get_labels(define,element)
|
||||||
local function cat(e)
|
local function cat(e)
|
||||||
return e.player_index
|
return e.player_index
|
||||||
end
|
end
|
||||||
@@ -11,7 +11,7 @@ local function get_instances(define,element)
|
|||||||
|
|
||||||
local categorize = define.categorize or not define.store and cat
|
local categorize = define.categorize or not define.store and cat
|
||||||
local category = categorize and categorize(element) or nil
|
local category = categorize and categorize(element) or nil
|
||||||
local instances = Gui.get_instances({
|
local instances = Gui.get_labels({
|
||||||
name=name,
|
name=name,
|
||||||
categorize=categorize
|
categorize=categorize
|
||||||
},category)
|
},category)
|
||||||
@@ -19,8 +19,8 @@ local function get_instances(define,element)
|
|||||||
return instances
|
return instances
|
||||||
end
|
end
|
||||||
|
|
||||||
local function update_instances(define,element)
|
local function update_lables(define,element)
|
||||||
local instances = get_instances(define,element)
|
local instances = get_labels(define,element)
|
||||||
local value = element.slider_value
|
local value = element.slider_value
|
||||||
if instances then
|
if instances then
|
||||||
for k,instance in pairs(instances) do
|
for k,instance in pairs(instances) do
|
||||||
@@ -33,20 +33,30 @@ local function update_instances(define,element)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function event_call(define,element,value)
|
||||||
|
local player = Game.get_player_by_index(element.player_index)
|
||||||
|
|
||||||
|
local min,max = element.get_slider_minimum(),element.get_slider_maximum()
|
||||||
|
local delta = max-min
|
||||||
|
local percent = delta == 0 and 0 or (value-min)/delta
|
||||||
|
|
||||||
|
if define.events.on_change then
|
||||||
|
define.events.on_change(player,element,value,percent)
|
||||||
|
end
|
||||||
|
|
||||||
|
update_lables(define,element)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function store_call(self,element,value)
|
||||||
|
element.slider_value = value
|
||||||
|
event_call(self,element,value)
|
||||||
|
end
|
||||||
|
|
||||||
local Slider = {
|
local Slider = {
|
||||||
_prototype=Gui._extend_prototype{
|
_prototype=Gui._extend_prototype{
|
||||||
on_change = Gui._new_event_adder('on_change'),
|
on_change = Gui._new_event_adder('on_change'),
|
||||||
add_store = Gui._new_store_adder(function(self,element,value)
|
add_store = Gui._new_store_adder(store_call),
|
||||||
element.slider_value = value
|
add_sync_store = Gui._new_sync_store_adder(store_call)
|
||||||
local min,max = element.get_slider_minimum(),element.get_slider_maximum()
|
|
||||||
local delta = max-min
|
|
||||||
local percent = delta == 0 and 0 or (value-min)/delta
|
|
||||||
local player = Game.get_player_by_index(element.player_index)
|
|
||||||
if self.events.on_change then
|
|
||||||
self.events.on_change(player,element,value,percent)
|
|
||||||
end
|
|
||||||
update_instances(self,element)
|
|
||||||
end)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,18 +72,23 @@ function Slider.new_slider(name)
|
|||||||
self.post_draw = function(element)
|
self.post_draw = function(element)
|
||||||
local player = Game.get_player_by_index(element.player_index)
|
local player = Game.get_player_by_index(element.player_index)
|
||||||
local min,max = element.get_slider_minimum(),element.get_slider_maximum()
|
local min,max = element.get_slider_minimum(),element.get_slider_maximum()
|
||||||
|
|
||||||
if type(self.min) == 'function' then
|
if type(self.min) == 'function' then
|
||||||
min = self.min(player,element)
|
min = self.min(player,element)
|
||||||
end
|
end
|
||||||
|
|
||||||
if type(self.max) == 'function' then
|
if type(self.max) == 'function' then
|
||||||
max = self.max(player,element)
|
max = self.max(player,element)
|
||||||
end
|
end
|
||||||
|
|
||||||
element.set_slider_minimum_maximum(min,max)
|
element.set_slider_minimum_maximum(min,max)
|
||||||
|
|
||||||
if self.store then
|
if self.store then
|
||||||
local category = self.categorize and self.categorize(element) or nil
|
local category = self.categorize and self.categorize(element) or nil
|
||||||
local value = self:get_store(category)
|
local value = self:get_store(category)
|
||||||
if value then element.slider_value = value end
|
if value then element.slider_value = value end
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.auto_label then
|
if self.auto_label then
|
||||||
self:draw_label(element.parent)
|
self:draw_label(element.parent)
|
||||||
end
|
end
|
||||||
@@ -82,17 +97,14 @@ function Slider.new_slider(name)
|
|||||||
Gui.on_value_changed(self.name,function(event)
|
Gui.on_value_changed(self.name,function(event)
|
||||||
local element = event.element
|
local element = event.element
|
||||||
local value = element.slider_value
|
local value = element.slider_value
|
||||||
local min,max = element.get_slider_minimum(),element.get_slider_maximum()
|
|
||||||
local delta = max-min
|
|
||||||
local percent = delta == 0 and 0 or (value-min)/delta
|
|
||||||
local category = self.categorize and self.categorize(element) or value
|
|
||||||
|
|
||||||
if self.store then
|
if self.store then
|
||||||
|
local category = self.categorize and self.categorize(element) or value
|
||||||
self:set_store(category,value)
|
self:set_store(category,value)
|
||||||
|
|
||||||
elseif self.events.on_change then
|
else
|
||||||
self.events.on_change(event.player,element,value,percent)
|
event_call(self,element,value)
|
||||||
update_instances(self,element)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end)
|
end)
|
||||||
@@ -103,31 +115,39 @@ end
|
|||||||
function Slider._prototype:set_range(min,max)
|
function Slider._prototype:set_range(min,max)
|
||||||
self.min = min
|
self.min = min
|
||||||
self.max = max
|
self.max = max
|
||||||
|
|
||||||
if type(min) == 'number' then
|
if type(min) == 'number' then
|
||||||
self.draw_data.minimum_value = min
|
self.draw_data.minimum_value = min
|
||||||
end
|
end
|
||||||
|
|
||||||
if type(max) == 'number' then
|
if type(max) == 'number' then
|
||||||
self.draw_data.maximum_value = max
|
self.draw_data.maximum_value = max
|
||||||
end
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
function Slider._prototype:draw_label(element)
|
function Slider._prototype:draw_label(element)
|
||||||
local name = self.name..'-label'
|
local name = self.name..'-label'
|
||||||
if element[name] then return end
|
if element[name] then return end
|
||||||
|
|
||||||
local value = 0
|
local value = 0
|
||||||
if self.store then
|
if self.store then
|
||||||
local category = self.categorize and self.categorize(element) or value
|
local category = self.categorize and self.categorize(element) or value
|
||||||
value = self:get_store(category) or 0
|
value = self:get_store(category) or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
local new_element = element.add{
|
local new_element = element.add{
|
||||||
name=name,
|
name=name,
|
||||||
type='label',
|
type='label',
|
||||||
caption=tostring(math.round(value,2))
|
caption=tostring(math.round(value,2))
|
||||||
}
|
}
|
||||||
|
|
||||||
if not Gui.instances[name] then Gui.instances[name] = {} end
|
if not Gui.instances[name] then Gui.instances[name] = {} end
|
||||||
local instances = get_instances(self,element)
|
|
||||||
|
local instances = get_labels(self,element)
|
||||||
table.insert(instances,new_element)
|
table.insert(instances,new_element)
|
||||||
|
|
||||||
return new_element
|
return new_element
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user