module refactoring
This commit is contained in:
+5
-7
@@ -1,14 +1,12 @@
|
||||
module 'aux.tabs.bids'
|
||||
|
||||
include 'aux'
|
||||
|
||||
local T = require 'T'
|
||||
|
||||
local aux = require 'aux'
|
||||
local info = require 'aux.util.info'
|
||||
local scan_util = require 'aux.util.scan'
|
||||
local scan = require 'aux.core.scan'
|
||||
|
||||
local tab = TAB 'Bids'
|
||||
local tab = aux.tab 'Bids'
|
||||
|
||||
auction_records = {}
|
||||
|
||||
@@ -80,7 +78,7 @@ do
|
||||
if not record.high_bidder then
|
||||
bid_button:SetScript('OnClick', function()
|
||||
if scan_util.test(record, index) and listing:ContainsRecord(record) then
|
||||
place_bid('bidder', index, record.bid_price, record.bid_price < record.buyout_price and function()
|
||||
aux.place_bid('bidder', index, record.bid_price, record.bid_price < record.buyout_price and function()
|
||||
info.bid_update(record)
|
||||
listing:SetDatabase()
|
||||
end or function() listing:RemoveAuctionRecord(record) end)
|
||||
@@ -94,7 +92,7 @@ do
|
||||
if record.buyout_price > 0 then
|
||||
buyout_button:SetScript('OnClick', function()
|
||||
if scan_util.test(record, index) and listing:ContainsRecord(record) then
|
||||
place_bid('bidder', index, record.buyout_price, function() listing:RemoveAuctionRecord(record) end)
|
||||
aux.place_bid('bidder', index, record.buyout_price, function() listing:RemoveAuctionRecord(record) end)
|
||||
end
|
||||
end)
|
||||
buyout_button:Enable()
|
||||
@@ -121,7 +119,7 @@ do
|
||||
elseif state == FOUND and not scan_util.test(selection.record, found_index) then
|
||||
buyout_button:Disable()
|
||||
bid_button:Disable()
|
||||
if not bid_in_progress() then state = IDLE end
|
||||
if not aux.bid_in_progress() then state = IDLE end
|
||||
end
|
||||
end
|
||||
end
|
||||
+6
-5
@@ -1,19 +1,20 @@
|
||||
module 'aux.tabs.bids'
|
||||
|
||||
local aux = require 'aux'
|
||||
local info = require 'aux.util.info'
|
||||
local gui = require 'aux.gui'
|
||||
local auction_listing = require 'aux.gui.auction_listing'
|
||||
local search_tab = require 'aux.tabs.search'
|
||||
|
||||
frame = CreateFrame('Frame', nil, AuxFrame)
|
||||
frame = CreateFrame('Frame', nil, aux.frame)
|
||||
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', AuxFrame.content, 'BOTTOMLEFT', 0, 0)
|
||||
frame.listing:SetPoint('BOTTOMRIGHT', AuxFrame.content, 'BOTTOMRIGHT', 0, 0)
|
||||
frame.listing:SetPoint('BOTTOMLEFT', aux.frame.content, 'BOTTOMLEFT', 0, 0)
|
||||
frame.listing:SetPoint('BOTTOMRIGHT', aux.frame.content, 'BOTTOMRIGHT', 0, 0)
|
||||
|
||||
listing = auction_listing.new(frame.listing, 20, auction_listing.bids_columns)
|
||||
listing:SetSort(1, 2, 3, 4, 5, 6, 7, 8)
|
||||
@@ -28,7 +29,7 @@ listing:SetHandler('OnClick', function(row, button)
|
||||
end
|
||||
end
|
||||
elseif button == 'RightButton' then
|
||||
set_tab(1)
|
||||
aux.set_tab(1)
|
||||
search_tab.set_filter(strlower(info.item(this.record.item_id).name) .. '/exact')
|
||||
search_tab.execute(nil, false)
|
||||
end
|
||||
@@ -42,7 +43,7 @@ do
|
||||
status_bar = gui.status_bar(frame)
|
||||
status_bar:SetWidth(265)
|
||||
status_bar:SetHeight(25)
|
||||
status_bar:SetPoint('TOPLEFT', AuxFrame.content, 'BOTTOMLEFT', 0, -6)
|
||||
status_bar:SetPoint('TOPLEFT', aux.frame.content, 'BOTTOMLEFT', 0, -6)
|
||||
status_bar:update_status(1, 0)
|
||||
status_bar:set_text('')
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user