module refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-10-14 01:55:38 +02:00
parent 2660b44861
commit cc7139c0e2
30 changed files with 326 additions and 343 deletions
+5 -5
View File
@@ -9,7 +9,7 @@ local scan = require 'aux.core.scan'
TAB 'Bids'
private.auction_records = t
auction_records = t
function OPEN()
frame:Show()
@@ -20,7 +20,7 @@ function CLOSE()
frame:Hide()
end
function private.update_listing()
function update_listing()
if not ACTIVE then return end
listing:SetDatabase(auction_records)
end
@@ -54,7 +54,7 @@ function public.scan_bids()
}
end
function private.test(record)
function test(record)
return function(index)
local auction_info = info.auction(index, 'bidder')
return auction_info and auction_info.search_signature == record.search_signature
@@ -67,7 +67,7 @@ do
local state = IDLE
local found_index
function private.find_auction(record)
function find_auction(record)
if not listing:ContainsRecord(record) then return end
scan.abort(scan_id)
@@ -108,7 +108,7 @@ do
)
end
function private.on_update()
function on_update()
if state == IDLE or state == SEARCHING then
buyout_button:Disable()
bid_button:Disable()
+5 -5
View File
@@ -3,7 +3,7 @@ module 'aux.tabs.bids'
local gui = require 'aux.gui'
local auction_listing = require 'aux.gui.auction_listing'
private.frame = CreateFrame('Frame', nil, AuxFrame)
frame = CreateFrame('Frame', nil, AuxFrame)
frame:SetAllPoints()
frame:SetScript('OnUpdate', on_update)
frame:Hide()
@@ -13,7 +13,7 @@ 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)
private.listing = auction_listing.CreateAuctionResultsTable(frame.listing, auction_listing.bids_config)
listing = auction_listing.CreateAuctionResultsTable(frame.listing, auction_listing.bids_config)
listing:SetSort(1, 2, 3, 4, 5, 6, 7, 8)
listing:Reset()
listing:SetHandler('OnCellClick', function(cell, button)
@@ -31,7 +31,7 @@ listing:SetHandler('OnSelectionChanged', function(rt, datum)
end)
do
private.status_bar = gui.status_bar(frame)
status_bar = gui.status_bar(frame)
status_bar:SetWidth(265)
status_bar:SetHeight(25)
status_bar:SetPoint('TOPLEFT', AuxFrame.content, 'BOTTOMLEFT', 0, -6)
@@ -43,14 +43,14 @@ do
btn:SetPoint('TOPLEFT', status_bar, 'TOPRIGHT', 5, 0)
btn:SetText'Bid'
btn:Disable()
private.bid_button = btn
bid_button = btn
end
do
local btn = gui.button(frame)
btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0)
btn:SetText'Buyout'
btn:Disable()
private.buyout_button = btn
buyout_button = btn
end
do
local btn = gui.button(frame)