mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 19:45:22 +09:00
Merge branch 'core'
This commit is contained in:
@@ -17,6 +17,7 @@ center._center = {}
|
||||
function center.add(obj)
|
||||
if not is_type(obj,'table') then return end
|
||||
if not is_type(obj.name,'string') then return end
|
||||
verbose('Created Center Gui: '..name)
|
||||
setmetatable(obj,{__index=center._center})
|
||||
obj.tabs = {}
|
||||
obj._tabs = {}
|
||||
@@ -167,6 +168,7 @@ end
|
||||
-- @tparam function callback this is called when button is pressed with function(root_frame)
|
||||
-- @return self to allow chaining of _center:add_tab
|
||||
function center._center:add_tab(name,caption,tooltip,callback)
|
||||
verbose('Created Tab: '..self.name..'/'..name)
|
||||
self._tabs[self.name..'_'..name] = callback
|
||||
self.tabs[name] = Gui.inputs.add{
|
||||
type='button',
|
||||
|
||||
@@ -91,15 +91,16 @@ function inputs.add(obj)
|
||||
if not is_type(obj.type,'string') then return end
|
||||
local type = obj.type
|
||||
if type == 'button' or
|
||||
type == 'sprite-button' or
|
||||
type == 'choose-elem-button' or
|
||||
type == 'checkbox' or
|
||||
type == 'radiobutton' or
|
||||
type == 'textfield' or
|
||||
type == 'text-box' or
|
||||
type == 'slider' or
|
||||
type == 'drop-down'
|
||||
type == 'sprite-button' or
|
||||
type == 'choose-elem-button' or
|
||||
type == 'checkbox' or
|
||||
type == 'radiobutton' or
|
||||
type == 'textfield' or
|
||||
type == 'text-box' or
|
||||
type == 'slider' or
|
||||
type == 'drop-down'
|
||||
then else return end
|
||||
verbose('Created Input: '..obj.name..' ('..obj.type..')')
|
||||
if obj.type == 'button' or obj.type == 'sprite-button' then obj.style = mod_gui.button_style end
|
||||
obj.draw_data = table.deepcopy(obj)
|
||||
obj.data = {}
|
||||
|
||||
@@ -21,6 +21,7 @@ end
|
||||
function left.add(obj)
|
||||
if not is_type(obj,'table') then return end
|
||||
if not is_type(obj.name,'string') then return end
|
||||
verbose('Created Left Gui: '..obj.name)
|
||||
setmetatable(obj,{__index=left._left})
|
||||
Gui._add_data('left',obj.name,obj)
|
||||
Gui.toolbar.add(obj.name,obj.caption,obj.tooltip,obj.toggle)
|
||||
|
||||
@@ -29,6 +29,7 @@ end
|
||||
function popup.add(obj)
|
||||
if not is_type(obj,'table') then return end
|
||||
if not is_type(obj.name,'string') then return end
|
||||
verbose('Created Popup Gui: '..obj.name)
|
||||
setmetatable(obj,{__index=popup._popup})
|
||||
local name = obj.name; obj.name = nil
|
||||
Gui._add_data('popup',name,obj)
|
||||
|
||||
@@ -17,6 +17,7 @@ local toolbar = {}
|
||||
-- @tparam function callback the function which is called on_click
|
||||
-- @treturn table the button object that was made
|
||||
function toolbar.add(name,caption,tooltip,callback)
|
||||
verbose('Created Toolbar Button: '..name)
|
||||
local button = Gui.inputs.add{type='button',name=name,caption=caption,tooltip=tooltip}
|
||||
button:on_event(Gui.inputs.events.click,callback)
|
||||
Gui._add_data('toolbar',name,button)
|
||||
|
||||
@@ -135,6 +135,7 @@ commands.add_command = function(name, description, inputs, event)
|
||||
if command_calls[name] then return end
|
||||
if not is_type(name,'string') then return end
|
||||
if not is_type(event,'function') then return end
|
||||
verbose('Created Command: '..name)
|
||||
local description = is_type(description,'string') and description or 'No Description'
|
||||
local inputs = is_type(inputs,'table') and inputs or {'parameter',true}
|
||||
command_data[name] = {
|
||||
|
||||
Reference in New Issue
Block a user