refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-09-30 18:32:19 +02:00
parent 4414ccf084
commit f29cb9ae1d
36 changed files with 531 additions and 298 deletions
+14 -4
View File
@@ -1,9 +1,19 @@
aux 'auctions_tab' local scan = aux.scan
aux_auctions_tab = module
include (green_t)
include (aux)
include (aux_util)
include (aux_control)
include (aux_util_color)
TAB 'Auctions'
local scan = aux_scan
private.auction_records = t
function LOAD()
create_frames()
aux_auctions_tab_frame.create()
end
function OPEN()
@@ -51,7 +61,7 @@ end
function private.test(record)
return function(index)
local auction_info = aux.info.auction(index, 'owner')
local auction_info = aux_info.auction(index, 'owner')
return auction_info and auction_info.search_signature == record.search_signature
end
end
@@ -67,7 +77,7 @@ do
scan.abort(scan_id)
state = SEARCHING
scan_id = aux.scan_util.find(
scan_id = aux_scan_util.find(
record,
status_bar,
function() state = IDLE end,
+10 -7
View File
@@ -1,18 +1,21 @@
aux 'auctions_tab' local gui, auction_listing = aux.gui, aux.auction_listing
aux_auctions_tab_frame = module
function private.create_frames()
private.frame = CreateFrame('Frame', nil, aux_frame)
local gui, auction_listing = aux_gui, aux_auction_listing
function public.create()
setfenv(1, getfenv(2))
private.frame = CreateFrame('Frame', nil, AuxFrame)
frame:SetAllPoints()
frame:SetScript('OnUpdate', on_update)
frame:Hide()
frame.listing = gui.panel(frame)
frame.listing:SetPoint('TOP', frame, 'TOP', 0, -8)
frame.listing:SetPoint('BOTTOMLEFT', aux_frame.content, 'BOTTOMLEFT', 0, 0)
frame.listing:SetPoint('BOTTOMRIGHT', aux_frame.content, 'BOTTOMRIGHT', 0, 0)
frame.listing:SetPoint('BOTTOMLEFT', AuxFrame.content, 'BOTTOMLEFT', 0, 0)
frame.listing:SetPoint('BOTTOMRIGHT', AuxFrame.content, 'BOTTOMRIGHT', 0, 0)
private.listing = auction_listing.CreateAuctionResultsTable(frame.listing, auction_listing.auctions_config)
listing:SetSort(1,2,3,4,5,6,7,8)
listing:SetSort(1, 2, 3, 4, 5, 6, 7, 8)
listing:Reset()
listing:SetHandler('OnCellClick', function(cell, button)
if IsAltKeyDown() and listing:GetSelection().record == cell.row.data.record and cancel_button:IsEnabled() then
@@ -28,7 +31,7 @@ function private.create_frames()
private.status_bar = gui.status_bar(frame)
status_bar:SetWidth(265)
status_bar:SetHeight(25)
status_bar:SetPoint('TOPLEFT', aux_frame.content, 'BOTTOMLEFT', 0, -6)
status_bar:SetPoint('TOPLEFT', AuxFrame.content, 'BOTTOMLEFT', 0, -6)
status_bar:update_status(100, 100)
status_bar:set_text('')
end