refactoring
This commit is contained in:
+15
-5
@@ -1,9 +1,19 @@
|
||||
aux 'bids_tab' local scan = aux.scan
|
||||
aux_bids_tab = module
|
||||
|
||||
include (green_t)
|
||||
include (aux)
|
||||
include (aux_util)
|
||||
include (aux_control)
|
||||
include (aux_util_color)
|
||||
|
||||
TAB 'Bids'
|
||||
|
||||
local scan = aux_scan
|
||||
|
||||
private.auction_records = t
|
||||
|
||||
function LOAD()
|
||||
create_frames()
|
||||
aux_bids_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, 'bidder')
|
||||
local auction_info = aux_info.auction(index, 'bidder')
|
||||
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,
|
||||
@@ -83,7 +93,7 @@ do
|
||||
bid_button:SetScript('OnClick', function()
|
||||
if test(record)(index) and listing:ContainsRecord(record) then
|
||||
place_bid('bidder', index, record.bid_price, record.bid_price < record.buyout_price and function()
|
||||
aux.info.bid_update(record)
|
||||
aux_info.bid_update(record)
|
||||
listing:SetDatabase()
|
||||
end or papply(listing.RemoveAuctionRecord, listing, record))
|
||||
end
|
||||
|
||||
+10
-7
@@ -1,18 +1,21 @@
|
||||
aux 'bids_tab' local gui, auction_listing = aux.gui, aux.auction_listing
|
||||
aux_bids_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.bids_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 then
|
||||
@@ -32,7 +35,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, 0)
|
||||
status_bar:set_text('')
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user