refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-07-15 14:56:45 +02:00
parent 8c0208a04c
commit 9c662c9140
2 changed files with 12 additions and 9 deletions
+10 -8
View File
@@ -53,6 +53,12 @@ Aux.version = '2.16.2'
Aux.blizzard_ui_shown = false
Aux.orig = {}
function Aux:tab(index, name)
local m, private, public = self:module(name)
self.tabs[index] = self.modules[name]
return m, private, public
end
function Aux.on_load()
Aux.log('Aux v'..Aux.version..' loaded.')
tinsert(UISpecialFrames, 'AuxFrame')
@@ -318,6 +324,7 @@ function Aux.on_auction_house_closed()
Aux.stack.stop()
Aux.scan.abort()
-- Aux.tabs[previous].CLOSE() TODO
Aux.search_frame.on_close()
Aux.post_frame.on_close()
Aux.auctions_frame.on_close()
@@ -326,17 +333,18 @@ function Aux.on_auction_house_closed()
AuxFrame:Hide()
end
function Aux.on_tab_click(index)
function Aux.on_tab_click(index, previous)
-- Aux.tabs[previous].CLOSE() TODO
Aux.search_frame.on_close()
Aux.post_frame.on_close()
Aux.auctions_frame.on_close()
Aux.bids_frame.on_close()
AuxSearchFrame:Hide()
AuxPostFrame:Hide()
AuxAuctionsFrame:Hide()
AuxBidsFrame:Hide()
-- Aux.tabs[index].OPEN() TODO
if index == 1 then
AuxSearchFrame:Show()
Aux.search_frame.on_open()
@@ -505,12 +513,6 @@ function Aux.hook(name, handler, object)
object[name] = handler
end
function Aux.tab(name)
local private, public = Aux.module(name)
tinsert(Aux.tabs, Aux[name])
return private, public
end
Aux.huge = 2^100000
Aux.null = {}
+2 -1
View File
@@ -191,11 +191,12 @@ do
end
function self:set_tab(id)
local previous = self.selected
self.selected = id
self.update_tabs()
self.on_select(id)
self.on_select(id, previous)
end
function self.update_tabs()