more refactoring
This commit is contained in:
+26
-26
@@ -2,34 +2,34 @@ aux.module 'bids_tab'
|
||||
|
||||
function create_frames()
|
||||
frame = CreateFrame('Frame', nil, aux.frame)
|
||||
m.frame:SetAllPoints()
|
||||
m.frame:SetScript('OnUpdate', m.on_update)
|
||||
m.frame:Hide()
|
||||
frame:SetAllPoints()
|
||||
frame:SetScript('OnUpdate', on_update)
|
||||
frame:Hide()
|
||||
|
||||
m.frame.listing = aux.gui.panel(m.frame)
|
||||
m.frame.listing:SetPoint('TOP', aux.frame, 'TOP', 0, -8)
|
||||
m.frame.listing:SetPoint('BOTTOMLEFT', aux.frame.content, 'BOTTOMLEFT', 0, 0)
|
||||
m.frame.listing:SetPoint('BOTTOMRIGHT', aux.frame.content, 'BOTTOMRIGHT', 0, 0)
|
||||
frame.listing = aux.gui.panel(frame)
|
||||
frame.listing:SetPoint('TOP', aux.frame, 'TOP', 0, -8)
|
||||
frame.listing:SetPoint('BOTTOMLEFT', aux.frame.content, 'BOTTOMLEFT', 0, 0)
|
||||
frame.listing:SetPoint('BOTTOMRIGHT', aux.frame.content, 'BOTTOMRIGHT', 0, 0)
|
||||
|
||||
listing = aux.auction_listing.CreateAuctionResultsTable(m.frame.listing, aux.auction_listing.bids_config)
|
||||
m.listing:SetSort(1,2,3,4,5,6,7,8)
|
||||
m.listing:Reset()
|
||||
m.listing:SetHandler('OnCellClick', function(cell, button)
|
||||
if IsAltKeyDown() and m.listing:GetSelection().record == cell.row.data.record then
|
||||
if button == 'LeftButton' and m.buyout_button:IsEnabled() then
|
||||
m.buyout_button:Click()
|
||||
elseif button == 'RightButton' and m.bid_button:IsEnabled() then
|
||||
m.bid_button:Click()
|
||||
listing = aux.auction_listing.CreateAuctionResultsTable(frame.listing, aux.auction_listing.bids_config)
|
||||
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
|
||||
if button == 'LeftButton' and buyout_button:IsEnabled() then
|
||||
buyout_button:Click()
|
||||
elseif button == 'RightButton' and bid_button:IsEnabled() then
|
||||
bid_button:Click()
|
||||
end
|
||||
end
|
||||
end)
|
||||
m.listing:SetHandler('OnSelectionChanged', function(rt, datum)
|
||||
listing:SetHandler('OnSelectionChanged', function(rt, datum)
|
||||
if not datum then return end
|
||||
m.find_auction(datum.record)
|
||||
find_auction(datum.record)
|
||||
end)
|
||||
|
||||
do
|
||||
status_bar = aux.gui.status_bar(m.frame)
|
||||
status_bar = aux.gui.status_bar(frame)
|
||||
status_bar:SetWidth(265)
|
||||
status_bar:SetHeight(25)
|
||||
status_bar:SetPoint('TOPLEFT', aux.frame.content, 'BOTTOMLEFT', 0, -6)
|
||||
@@ -37,8 +37,8 @@ function create_frames()
|
||||
status_bar:set_text('')
|
||||
end
|
||||
do
|
||||
local btn = aux.gui.button(m.frame, 16)
|
||||
btn:SetPoint('TOPLEFT', m.status_bar, 'TOPRIGHT', 5, 0)
|
||||
local btn = aux.gui.button(frame, 16)
|
||||
btn:SetPoint('TOPLEFT', status_bar, 'TOPRIGHT', 5, 0)
|
||||
btn:SetWidth(80)
|
||||
btn:SetHeight(24)
|
||||
btn:SetText('Bid')
|
||||
@@ -46,8 +46,8 @@ function create_frames()
|
||||
bid_button = btn
|
||||
end
|
||||
do
|
||||
local btn = aux.gui.button(m.frame, 16)
|
||||
btn:SetPoint('TOPLEFT', m.bid_button, 'TOPRIGHT', 5, 0)
|
||||
local btn = aux.gui.button(frame, 16)
|
||||
btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0)
|
||||
btn:SetWidth(80)
|
||||
btn:SetHeight(24)
|
||||
btn:SetText('Buyout')
|
||||
@@ -55,13 +55,13 @@ function create_frames()
|
||||
buyout_button = btn
|
||||
end
|
||||
do
|
||||
local btn = aux.gui.button(m.frame, 16)
|
||||
btn:SetPoint('TOPLEFT', m.buyout_button, 'TOPRIGHT', 5, 0)
|
||||
local btn = aux.gui.button(frame, 16)
|
||||
btn:SetPoint('TOPLEFT', buyout_button, 'TOPRIGHT', 5, 0)
|
||||
btn:SetWidth(80)
|
||||
btn:SetHeight(24)
|
||||
btn:SetText('Refresh')
|
||||
btn:SetScript('OnClick', function()
|
||||
m.scan_bids()
|
||||
scan_bids()
|
||||
end)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user