From 8571a510f7a797d23f5b1c01d587a8c35cfd8bbb Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sun, 20 May 2018 18:41:27 +0100 Subject: [PATCH] Added more verbose to gui loading --- ExpCore/GuiParts/center.lua | 2 ++ ExpCore/GuiParts/inputs.lua | 17 +++++++++-------- ExpCore/GuiParts/left.lua | 1 + ExpCore/GuiParts/popup.lua | 1 + ExpCore/GuiParts/toolbar.lua | 1 + ExpCore/commands.lua | 1 + 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ExpCore/GuiParts/center.lua b/ExpCore/GuiParts/center.lua index 2333dcbb..7c9d20ff 100644 --- a/ExpCore/GuiParts/center.lua +++ b/ExpCore/GuiParts/center.lua @@ -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', diff --git a/ExpCore/GuiParts/inputs.lua b/ExpCore/GuiParts/inputs.lua index 7639eab5..73e249e1 100644 --- a/ExpCore/GuiParts/inputs.lua +++ b/ExpCore/GuiParts/inputs.lua @@ -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 = {} diff --git a/ExpCore/GuiParts/left.lua b/ExpCore/GuiParts/left.lua index 3ff4d562..372f0289 100644 --- a/ExpCore/GuiParts/left.lua +++ b/ExpCore/GuiParts/left.lua @@ -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) diff --git a/ExpCore/GuiParts/popup.lua b/ExpCore/GuiParts/popup.lua index dca3fd9f..c0708093 100644 --- a/ExpCore/GuiParts/popup.lua +++ b/ExpCore/GuiParts/popup.lua @@ -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) diff --git a/ExpCore/GuiParts/toolbar.lua b/ExpCore/GuiParts/toolbar.lua index bf7fe56a..f197312e 100644 --- a/ExpCore/GuiParts/toolbar.lua +++ b/ExpCore/GuiParts/toolbar.lua @@ -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) diff --git a/ExpCore/commands.lua b/ExpCore/commands.lua index 5367343b..8b6ca10e 100644 --- a/ExpCore/commands.lua +++ b/ExpCore/commands.lua @@ -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] = {