From d7b8c474558bcda5b9898912ffb1bae69ec944f9 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Tue, 19 Dec 2017 18:45:45 +0000 Subject: [PATCH] Removed sytax errors --- ExpCore/GuiParts/center.lua | 7 ++++--- control.lua | 13 ++++++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ExpCore/GuiParts/center.lua b/ExpCore/GuiParts/center.lua index b69641ba..59c7761b 100644 --- a/ExpCore/GuiParts/center.lua +++ b/ExpCore/GuiParts/center.lua @@ -14,9 +14,10 @@ function center.add(obj) if not is_type(obj,'table') then return end if not is_type(obj.name,'string') then return end setmetatable(obj,{__index=center._center}) - self.tabs = {} + obj.tabs = {} + obj._tabs = {} Gui._add_data('center',obj.name,obj) - toolbar.add(obj.name,obj.caption,obj.tooltip,obj.open) + Gui.toolbar.add(obj.name,obj.caption,obj.tooltip,obj.open) return obj end @@ -82,7 +83,7 @@ end function center._center:add_tab(name,caption,tooltip,callback) self._tabs[self.name..'_'..name] = callback - self.tabs[name] = Gui.inputs.inputs.add{ + self.tabs[name] = Gui.inputs.add{ type='button', name=self.name..'_'..name, caption=caption, diff --git a/control.lua b/control.lua index 8d94b1c5..8742254d 100644 --- a/control.lua +++ b/control.lua @@ -41,4 +41,15 @@ require('/ExpCore/ranks') -- this loads any edits that are not need in core pcall as file may not be preset pcall(require,'/Addons/playerRanks') -- this makes sure that all the little details are cleaned up -Ranking._auto_edit_ranks() \ No newline at end of file +Ranking._auto_edit_ranks() + +-- testing the center gui +center.add{ + name='test-center', + caption='Gui Center', + tooltip='Just a gui test' +}:add_tab('tab-1','Tab 1','Just a tab',function(frame) + frame.add{type='lable',caption='Test'} +end):add_tab('tab-2','Tab 2','Just a tab',function(frame) + frame.add{type='lable',caption='Test 2'} +end) \ No newline at end of file