refactoring
This commit is contained in:
+4
-4
@@ -11,16 +11,16 @@ function public.LOAD()
|
||||
end
|
||||
|
||||
function public.OPEN()
|
||||
AuxBidsFrame:Show()
|
||||
m.frame:Show()
|
||||
m.scan_bids()
|
||||
end
|
||||
|
||||
function public.CLOSE()
|
||||
AuxBidsFrame:Hide()
|
||||
m.frame:Hide()
|
||||
end
|
||||
|
||||
function private.update_listing()
|
||||
if not AuxBidsFrame:IsVisible() then
|
||||
if not m:ACTIVE() then
|
||||
return
|
||||
end
|
||||
|
||||
@@ -120,7 +120,7 @@ do
|
||||
)
|
||||
end
|
||||
|
||||
function public.on_update()
|
||||
function private.on_update()
|
||||
if state == IDLE or state == SEARCHING then
|
||||
m.buyout_button:Disable()
|
||||
m.bid_button:Disable()
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
|
||||
<Frame name="AuxBidsFrame" hidden="true" parent="AuxFrame" setAllPoints="true">
|
||||
<Scripts>
|
||||
<OnUpdate>
|
||||
Aux.bids_tab.on_update()
|
||||
</OnUpdate>
|
||||
</Scripts>
|
||||
<Frames>
|
||||
<Frame name="$parentListing" inherits="AuxFrameBoxTemplate">
|
||||
<Anchors>
|
||||
<Anchor point="TOP" relativeTo="AuxFrame"><Offset><AbsDimension x="0" y="-8"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMLEFT" relativeTo="AuxFrameContent"></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT" relativeTo="AuxFrameContent"></Anchor>
|
||||
</Anchors>
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
</Ui>
|
||||
+15
-5
@@ -1,5 +1,15 @@
|
||||
Aux.bids_tab.FRAMES(function(m, public, private)
|
||||
private.listing = Aux.auction_listing.CreateAuctionResultsTable(AuxBidsFrameListing, Aux.auction_listing.bids_config)
|
||||
private.frame = CreateFrame('Frame', nil, AuxFrame)
|
||||
m.frame:SetAllPoints()
|
||||
m.frame:SetScript('OnUpdate', m.on_update)
|
||||
m.frame:Hide()
|
||||
|
||||
m.frame.listing = CreateFrame('Frame', nil, m.frame, 'AuxFrameBoxTemplate')
|
||||
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.bids_config)
|
||||
m.listing:SetSort(1,2,3,4,5,6,7,8)
|
||||
m.listing:Reset()
|
||||
m.listing:SetHandler('OnCellClick', function(cell, button)
|
||||
@@ -17,7 +27,7 @@ Aux.bids_tab.FRAMES(function(m, public, private)
|
||||
end)
|
||||
|
||||
do
|
||||
local status_bar = Aux.gui.status_bar(AuxBidsFrame)
|
||||
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)
|
||||
@@ -26,7 +36,7 @@ Aux.bids_tab.FRAMES(function(m, public, private)
|
||||
private.status_bar = status_bar
|
||||
end
|
||||
do
|
||||
local btn = Aux.gui.button(AuxBidsFrame, 16)
|
||||
local btn = Aux.gui.button(m.frame, 16)
|
||||
btn:SetPoint('TOPLEFT', m.status_bar, 'TOPRIGHT', 5, 0)
|
||||
btn:SetWidth(80)
|
||||
btn:SetHeight(24)
|
||||
@@ -35,7 +45,7 @@ Aux.bids_tab.FRAMES(function(m, public, private)
|
||||
private.bid_button = btn
|
||||
end
|
||||
do
|
||||
local btn = Aux.gui.button(AuxBidsFrame, 16)
|
||||
local btn = Aux.gui.button(m.frame, 16)
|
||||
btn:SetPoint('TOPLEFT', m.bid_button, 'TOPRIGHT', 5, 0)
|
||||
btn:SetWidth(80)
|
||||
btn:SetHeight(24)
|
||||
@@ -44,7 +54,7 @@ Aux.bids_tab.FRAMES(function(m, public, private)
|
||||
private.buyout_button = btn
|
||||
end
|
||||
do
|
||||
local btn = Aux.gui.button(AuxBidsFrame, 16)
|
||||
local btn = Aux.gui.button(m.frame, 16)
|
||||
btn:SetPoint('TOPLEFT', m.buyout_button, 'TOPRIGHT', 5, 0)
|
||||
btn:SetWidth(80)
|
||||
btn:SetHeight(24)
|
||||
|
||||
Reference in New Issue
Block a user