refactorings
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
local m, public, private = Aux.tab(3, 'auctions_tab')
|
||||
local m, public, private = aux.tab(3, 'auctions_tab')
|
||||
|
||||
private.auction_records = nil
|
||||
|
||||
@@ -34,7 +34,7 @@ function public.scan_auctions()
|
||||
|
||||
m.auction_records = {}
|
||||
m.update_listing()
|
||||
Aux.scan.start{
|
||||
aux.scan.start{
|
||||
type = 'owner',
|
||||
queries = {{ blizzard_query = {} }},
|
||||
on_page_loaded = function(page, total_pages)
|
||||
@@ -58,7 +58,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
|
||||
@@ -74,9 +74,9 @@ do
|
||||
return
|
||||
end
|
||||
|
||||
Aux.scan.abort(scan_id)
|
||||
aux.scan.abort(scan_id)
|
||||
state = SEARCHING
|
||||
scan_id = Aux.scan_util.find(
|
||||
scan_id = aux.scan_util.find(
|
||||
record,
|
||||
m.status_bar,
|
||||
function()
|
||||
@@ -92,7 +92,7 @@ do
|
||||
|
||||
m.cancel_button:SetScript('OnClick', function()
|
||||
if m.test(record)(index) and m.listing:ContainsRecord(record) then
|
||||
Aux.cancel_auction(index, Aux.f(m.listing.RemoveAuctionRecord, m.listing, record))
|
||||
aux.cancel_auction(index, aux.f(m.listing.RemoveAuctionRecord, m.listing, record))
|
||||
end
|
||||
end)
|
||||
m.cancel_button:Enable()
|
||||
@@ -116,7 +116,7 @@ do
|
||||
m.find_auction(selection.record)
|
||||
elseif state == FOUND and not m.test(selection.record)(found_index) then
|
||||
m.cancel_button:Disable()
|
||||
if not Aux.cancel_in_progress() then
|
||||
if not aux.cancel_in_progress() then
|
||||
state = IDLE
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
Aux.auctions_tab.FRAMES(function(m, public, private)
|
||||
aux.auctions_tab.FRAMES(function(m, public, private)
|
||||
private.frame = CreateFrame('Frame', nil, AuxFrame)
|
||||
m.frame:SetAllPoints()
|
||||
m.frame:SetScript('OnUpdate', m.on_update)
|
||||
m.frame:Hide()
|
||||
|
||||
m.frame.listing = Aux.gui.panel(m.frame)
|
||||
m.frame.listing = aux.gui.panel(m.frame)
|
||||
m.frame.listing:SetPoint('TOP', AuxFrame, 'TOP', 0, -8)
|
||||
m.frame.listing:SetPoint('BOTTOMLEFT', AuxFrameContent, 'BOTTOMLEFT', 0, 0)
|
||||
m.frame.listing:SetPoint('BOTTOMRIGHT', AuxFrameContent, 'BOTTOMRIGHT', 0, 0)
|
||||
|
||||
private.listing = Aux.auction_listing.CreateAuctionResultsTable(m.frame.listing, Aux.auction_listing.auctions_config)
|
||||
private.listing = aux.auction_listing.CreateAuctionResultsTable(m.frame.listing, aux.auction_listing.auctions_config)
|
||||
m.listing:SetSort(1,2,3,4,5,6,7,8)
|
||||
m.listing:Reset()
|
||||
m.listing:SetHandler('OnCellClick', function(cell, button)
|
||||
@@ -23,7 +23,7 @@ Aux.auctions_tab.FRAMES(function(m, public, private)
|
||||
end)
|
||||
|
||||
do
|
||||
local status_bar = Aux.gui.status_bar(m.frame)
|
||||
local status_bar = aux.gui.status_bar(m.frame)
|
||||
status_bar:SetWidth(265)
|
||||
status_bar:SetHeight(25)
|
||||
status_bar:SetPoint('TOPLEFT', AuxFrameContent, 'BOTTOMLEFT', 0, -6)
|
||||
@@ -32,7 +32,7 @@ Aux.auctions_tab.FRAMES(function(m, public, private)
|
||||
private.status_bar = status_bar
|
||||
end
|
||||
do
|
||||
local btn = Aux.gui.button(m.frame, 16)
|
||||
local btn = aux.gui.button(m.frame, 16)
|
||||
btn:SetPoint('TOPLEFT', m.status_bar, 'TOPRIGHT', 5, 0)
|
||||
btn:SetWidth(80)
|
||||
btn:SetHeight(24)
|
||||
@@ -41,7 +41,7 @@ Aux.auctions_tab.FRAMES(function(m, public, private)
|
||||
private.cancel_button = btn
|
||||
end
|
||||
do
|
||||
local btn = Aux.gui.button(m.frame, 16)
|
||||
local btn = aux.gui.button(m.frame, 16)
|
||||
btn:SetPoint('TOPLEFT', m.cancel_button, 'TOPRIGHT', 5, 0)
|
||||
btn:SetWidth(80)
|
||||
btn:SetHeight(24)
|
||||
|
||||
Reference in New Issue
Block a user