Merge branch 'master' into dev
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
## SavedVariablesPerCharacter: AUX_SELL_SHORTCUT, AUX_BUY_SHORTCUT, AUX_OPEN_SELL, AUX_OPEN_BUY, AUX_INSTANT_BUYOUT, AUX_AUCTION_DURATION
|
||||
## SavedVariables: auxSellEntries
|
||||
core.xml
|
||||
control.xml
|
||||
|
||||
sell.xml
|
||||
buy.xml
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Aux.buy = {}
|
||||
|
||||
local record_auction, set_message, report, tooltip_match, show_buyout_dialog, show_bid_dialog
|
||||
local process_auction, set_message, report, tooltip_match, show_dialog
|
||||
local entries
|
||||
local selectedEntries = {}
|
||||
local search_query
|
||||
@@ -10,15 +10,14 @@ local refresh
|
||||
|
||||
|
||||
function Aux.buy.exit()
|
||||
|
||||
Aux.buy.buyout_dialog_cancel()
|
||||
Aux.buy.dialog_cancel()
|
||||
current_page = nil
|
||||
end
|
||||
|
||||
-----------------------------------------
|
||||
|
||||
function Aux_AuctionFrameBids_Update()
|
||||
Aux.orig.AuctionFrameBids_Update()
|
||||
function Aux_AuctionFrameBid_Update()
|
||||
Aux.orig.AuctionFrameBid_Update()
|
||||
if PanelTemplates_GetSelectedTab(AuctionFrame) == Aux.tabs.buy.index and AuctionFrame:IsShown() then
|
||||
Aux_HideElems(Aux.tabs.buy.hiddenElements)
|
||||
end
|
||||
@@ -26,9 +25,9 @@ end
|
||||
|
||||
-----------------------------------------
|
||||
|
||||
function Aux.buy.buyout_dialog_cancel()
|
||||
function Aux.buy.dialog_cancel()
|
||||
Aux.scan.abort()
|
||||
AuxBuyBuyoutDialog:Hide()
|
||||
AuxBuyDialog:Hide()
|
||||
AuxBuySearchButton:Enable()
|
||||
end
|
||||
|
||||
@@ -69,30 +68,19 @@ function Aux.buy.SearchButton_onclick()
|
||||
Aux.scan.start{
|
||||
query = search_query,
|
||||
page = 0,
|
||||
on_start_page = function(k, i)
|
||||
current_page = i
|
||||
set_message('Scanning auctions: page ' .. i + 1 .. ' ...')
|
||||
k()
|
||||
on_start_page = function(k, page)
|
||||
current_page = page
|
||||
set_message('Scanning auctions: page ' .. page + 1 .. ' ...')
|
||||
return k()
|
||||
end,
|
||||
on_read_auction = function(k, i)
|
||||
local auction_item = Aux.info.auction_item(i)
|
||||
if auction_item then
|
||||
local stack_size = auction_item.charges or auction_item.count
|
||||
if (auction_item.name == search_query.name or search_query.name == '' or not AuxBuyExactCheckButton:GetChecked()) and tooltip_match(tooltip_patterns, auction_item.tooltip) then
|
||||
record_auction(
|
||||
auction_item.name,
|
||||
auction_item.tooltip,
|
||||
stack_size,
|
||||
auction_item.buyout_price,
|
||||
auction_item.quality,
|
||||
auction_item.owner,
|
||||
auction_item.hyperlink,
|
||||
auction_item.itemstring,
|
||||
current_page
|
||||
)
|
||||
process_auction(auction_item, current_page)
|
||||
end
|
||||
end
|
||||
k()
|
||||
return k()
|
||||
end,
|
||||
on_complete = function()
|
||||
entries = entries or {}
|
||||
@@ -123,11 +111,12 @@ function set_message(msg)
|
||||
end
|
||||
|
||||
-----------------------------------------
|
||||
function show_buyout_dialog(hyperlink, stack_size, buyout_price)
|
||||
AuxBuyBuyoutDialogBuyButton:Disable()
|
||||
AuxBuyBuyoutDialogHTML:SetFontObject('h1', GameFontWhite)
|
||||
AuxBuyBuyoutDialogHTML:SetScript('OnHyperlinkClick', function() SetItemRef(arg1) end)
|
||||
AuxBuyBuyoutDialogHTML:SetText(string.format(
|
||||
|
||||
function show_dialog(buyout_mode, hyperlink, stack_size, amount)
|
||||
AuxBuyDialogActionButton:Disable()
|
||||
AuxBuyDialogHTML:SetFontObject('h1', GameFontWhite)
|
||||
AuxBuyDialogHTML:SetScript('OnHyperlinkClick', function() SetItemRef(arg1) end)
|
||||
AuxBuyDialogHTML:SetText(string.format(
|
||||
[[
|
||||
<html>
|
||||
<body>
|
||||
@@ -138,108 +127,116 @@ function show_buyout_dialog(hyperlink, stack_size, buyout_price)
|
||||
hyperlink,
|
||||
stack_size
|
||||
))
|
||||
--MoneyFrame_Update('AuxBuyBuyoutDialogBuyoutPrice', Aux_Round(buyout_price))
|
||||
AuxBuyBuyoutDialog:Show()
|
||||
if buyout_mode then
|
||||
AuxBuyDialogActionButton:SetText('Buy')
|
||||
MoneyFrame_Update('AuxBuyDialogBuyoutPrice', amount)
|
||||
AuxBuyDialogBid:Hide()
|
||||
AuxBuyDialogBuyoutPrice:Show()
|
||||
else
|
||||
AuxBuyDialogActionButton:SetText('Bid')
|
||||
MoneyInputFrame_SetCopper(AuxBuyDialogBid, amount)
|
||||
AuxBuyDialogBuyoutPrice:Hide()
|
||||
AuxBuyDialogBid:Show()
|
||||
end
|
||||
AuxBuyDialog:Show()
|
||||
end
|
||||
|
||||
function show_bid_dialog(hyperlink, stack_size, bid)
|
||||
AuxBuyBidDialogBidButton:Disable()
|
||||
AuxBuyBidDialogHTML:SetFontObject('h1', GameFontWhite)
|
||||
AuxBuyBidDialogHTML:SetScript('OnHyperlinkClick', function() SetItemRef(arg1) end)
|
||||
AuxBuyBidDialogHTML:SetText(string.format(
|
||||
[[
|
||||
<html>
|
||||
<body>
|
||||
<h1>%s x %i</h1>
|
||||
</body>
|
||||
</html>
|
||||
]],
|
||||
hyperlink,
|
||||
stack_size
|
||||
))
|
||||
AuxBuyBidDialog:Show()
|
||||
MoneyInputFrame_SetCopper(AuxBuyBidDialogBid, 5)
|
||||
end
|
||||
-----------------------------------------
|
||||
|
||||
function AuxBuyEntry_OnClick()
|
||||
local express_mode = IsControlKeyDown()
|
||||
function AuxBuyEntry_OnClick(entry_index)
|
||||
local express_mode = IsAltKeyDown()
|
||||
local buyout_mode = arg1 == "LeftButton"
|
||||
|
||||
local entry = entries[entry_index]
|
||||
|
||||
if buyout_mode and not entry.buyout_price then
|
||||
return
|
||||
end
|
||||
|
||||
if IsControlKeyDown() then
|
||||
DressUpItemLink(entry.hyperlink)
|
||||
return
|
||||
end
|
||||
|
||||
AuxBuySearchButton:Disable()
|
||||
|
||||
local entry_index = this:GetID()
|
||||
local entry = entries[entry_index]
|
||||
local amount
|
||||
if buyout_mode then
|
||||
amount = entry.buyout_price
|
||||
else
|
||||
amount = entry.bid
|
||||
end
|
||||
|
||||
if not express_mode then
|
||||
if arg1 == "LeftButton" then
|
||||
show_buyout_dialog(entry.hyperlink, entry.stack_size, entry.buyout_price)
|
||||
elseif arg1 == "RightButton" then
|
||||
show_bid_dialog(entry.hyperlink, entry.stack_size, entry.buyout_price)
|
||||
end
|
||||
show_dialog(buyout_mode, entry.hyperlink, entry.stack_size, amount)
|
||||
end
|
||||
|
||||
PlaySound("igMainMenuOptionCheckBoxOn")
|
||||
|
||||
local found
|
||||
local order_key = Aux.auction_key(entry.tooltip, entry.stack_size, entry.buyout_price)
|
||||
local order_key = Aux.auction_key(entry.tooltip, entry.stack_size, amount)
|
||||
|
||||
Aux.scan.start{
|
||||
query = search_query,
|
||||
page = entry.page ~= current_page and entry.page,
|
||||
on_start_page = function(k, page)
|
||||
on_start_page = function(ok, page)
|
||||
current_page = page
|
||||
k()
|
||||
return ok()
|
||||
end,
|
||||
on_read_auction = function(k, i)
|
||||
on_read_auction = function(ok, i)
|
||||
local auction_item = Aux.info.auction_item(i)
|
||||
|
||||
if not auction_item then
|
||||
k()
|
||||
return
|
||||
return ok()
|
||||
end
|
||||
|
||||
local stack_size = auction_item.charges or auction_item.count
|
||||
|
||||
if not auction_item.tooltip or not stack_size or not auction_item.buyout_price then
|
||||
k()
|
||||
return
|
||||
end
|
||||
local bid = (auction_item.current_bid > 0 and auction_item.current_bid or auction_item.min_bid) + auction_item.min_increment
|
||||
|
||||
local key = Aux.auction_key(auction_item.tooltip, stack_size, auction_item.buyout_price)
|
||||
local auction_amount
|
||||
if buyout_mode then
|
||||
auction_amount = auction_item.buyout_price
|
||||
else
|
||||
auction_amount = bid
|
||||
end
|
||||
|
||||
local key = Aux.auction_key(auction_item.tooltip, stack_size, auction_amount)
|
||||
|
||||
if key == order_key then
|
||||
found = true
|
||||
|
||||
if express_mode then
|
||||
if GetMoney() >= auction_item.buyout_price then
|
||||
|
||||
if express_mode then
|
||||
if GetMoney() >= amount then
|
||||
tremove(entries, entry_index)
|
||||
refresh = true
|
||||
end
|
||||
|
||||
PlaceAuctionBid("list", i, auction_item.buyout_price)
|
||||
PlaceAuctionBid("list", i, amount)
|
||||
|
||||
Aux.scan.abort()
|
||||
else
|
||||
Aux.buy.buyout_dialog_buy = function()
|
||||
if GetMoney() >= auction_item.buyout_price then
|
||||
Aux.buy.dialog_action = function()
|
||||
if GetMoney() >= amount then
|
||||
tremove(entries, entry_index)
|
||||
refresh = true
|
||||
end
|
||||
|
||||
PlaceAuctionBid("list", i, auction_item.buyout_price)
|
||||
PlaceAuctionBid("list", i, amount)
|
||||
|
||||
Aux.scan.abort()
|
||||
AuxBuySearchButton:Enable()
|
||||
AuxBuyBuyoutDialog:Hide()
|
||||
AuxBuyDialog:Hide()
|
||||
end
|
||||
AuxBuyBuyoutDialogBuyButton:Enable()
|
||||
AuxBuyDialogActionButton:Enable()
|
||||
end
|
||||
end
|
||||
k()
|
||||
return ok()
|
||||
end,
|
||||
on_complete = function()
|
||||
if not found then
|
||||
tremove(entries, entry_index)
|
||||
refresh = true
|
||||
Aux.buy.buyout_dialog_cancel()
|
||||
Aux.buy.dialog_cancel()
|
||||
end
|
||||
if express_mode then
|
||||
AuxBuySearchButton:Enable()
|
||||
@@ -253,9 +250,8 @@ function AuxBuyEntry_OnClick()
|
||||
}
|
||||
end
|
||||
|
||||
function AuxBuyEntry_OnEnter()
|
||||
local i = this:GetID()
|
||||
local entry = entries[i]
|
||||
function AuxBuyEntry_OnEnter(entry_index)
|
||||
local entry = entries[entry_index]
|
||||
|
||||
Aux.info.set_game_tooltip(this, entry.tooltip)
|
||||
|
||||
@@ -266,24 +262,31 @@ end
|
||||
|
||||
-----------------------------------------
|
||||
|
||||
function record_auction(name, tooltip, stack_size, buyout_price, quality, owner, hyperlink, itemstring, page)
|
||||
function process_auction(auction_item, current_page)
|
||||
entries = entries or {}
|
||||
|
||||
if buyout_price > 0 and owner ~= UnitName("player") then
|
||||
local stack_size = auction_item.charges or auction_item.count
|
||||
local bid = auction_item.current_bid > 0 and auction_item.current_bid or auction_item.min_bid + auction_item.min_increment
|
||||
local buyout_price = auction_item.buyout_price > 0 and auction_item.buyout_price or nil
|
||||
local buyout_price_per_unit = buyout_price and Aux_Round(auction_item.buyout_price / stack_size)
|
||||
|
||||
if auction_item.owner ~= UnitName("player") then
|
||||
tinsert(entries, {
|
||||
name = name,
|
||||
tooltip = tooltip,
|
||||
name = auction_item.name,
|
||||
tooltip = auction_item.tooltip,
|
||||
stack_size = stack_size,
|
||||
buyout_price = buyout_price,
|
||||
item_price = buyout_price / stack_size,
|
||||
quality = quality,
|
||||
hyperlink = hyperlink,
|
||||
itemstring = itemstring,
|
||||
buyout_price_per_unit = buyout_price_per_unit,
|
||||
quality = auction_item.quality,
|
||||
hyperlink = auction_item.hyperlink,
|
||||
itemstring = auction_item.itemstring,
|
||||
page = current_page,
|
||||
bid = bid,
|
||||
bid_per_unit = Aux_Round(bid / stack_size),
|
||||
owner = auction_item.owner,
|
||||
duration = auction_item.duration,
|
||||
})
|
||||
end
|
||||
|
||||
table.sort(entries, function(a,b) return a.item_price < b.item_price end)
|
||||
end
|
||||
|
||||
-----------------------------------------
|
||||
@@ -298,64 +301,17 @@ end
|
||||
-----------------------------------------
|
||||
|
||||
function Aux_Buy_ScrollbarUpdate()
|
||||
Aux.list.populate(AuxBuyList, entries or {})
|
||||
|
||||
-- if entries then
|
||||
-- table.sort(entries, function(a,b) return a.buyout_price_per_unit < b.buyout_price_per_unit end)
|
||||
-- end
|
||||
|
||||
if entries and getn(entries) == 0 then
|
||||
set_message("No auctions were found")
|
||||
else
|
||||
AuxBuyMessage:Hide()
|
||||
end
|
||||
|
||||
local numrows
|
||||
if not entries then
|
||||
numrows = 0
|
||||
else
|
||||
numrows = getn(entries)
|
||||
end
|
||||
|
||||
FauxScrollFrame_Update(AuxBuyScrollFrame, numrows, 19, 16);
|
||||
|
||||
for line = 1,19 do
|
||||
|
||||
local dataOffset = line + FauxScrollFrame_GetOffset(AuxBuyScrollFrame)
|
||||
local lineEntry = getglobal("AuxBuyEntry"..line)
|
||||
|
||||
if numrows <= 19 then
|
||||
lineEntry:SetWidth(800)
|
||||
else
|
||||
lineEntry:SetWidth(782)
|
||||
end
|
||||
|
||||
lineEntry:SetID(dataOffset)
|
||||
|
||||
if dataOffset <= numrows and entries[dataOffset] then
|
||||
|
||||
local entry = entries[dataOffset]
|
||||
|
||||
local lineEntry_name = getglobal("AuxBuyEntry"..line.."_Name")
|
||||
local lineEntry_stack_size = getglobal("AuxBuyEntry"..line.."_StackSize")
|
||||
|
||||
local color = "ffffffff"
|
||||
if Aux_QualityColor(entry.quality) then
|
||||
color = Aux_QualityColor(entry.quality)
|
||||
end
|
||||
|
||||
lineEntry_name:SetText("\124c" .. color .. entry.name .. "\124r")
|
||||
|
||||
if Aux.util.set_contains(selectedEntries, entry) then
|
||||
lineEntry:LockHighlight()
|
||||
else
|
||||
lineEntry:UnlockHighlight()
|
||||
end
|
||||
|
||||
lineEntry_stack_size:SetText(entry.stack_size)
|
||||
|
||||
MoneyFrame_Update("AuxBuyEntry"..line.."_UnitPrice", Aux_Round(entry.buyout_price/entry.stack_size))
|
||||
MoneyFrame_Update("AuxBuyEntry"..line.."_TotalPrice", Aux_Round(entry.buyout_price))
|
||||
|
||||
lineEntry:Show()
|
||||
else
|
||||
lineEntry:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------
|
||||
|
||||
@@ -10,95 +10,48 @@
|
||||
</Scripts>
|
||||
</Frame>
|
||||
|
||||
<Button name="AuxBuyEntryTemplate" virtual="true" hidden="true">
|
||||
<Size><AbsDimension y="16"/></Size>
|
||||
<Button name="SearchListItemTemplate" inherits="ListItemTemplate" virtual="true">
|
||||
<Scripts>
|
||||
local scrollFrame
|
||||
local index
|
||||
<OnLoad>
|
||||
this:RegisterForClicks("LeftButtonUp", "RightButtonUp")
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
<Frames>
|
||||
<Frame>
|
||||
<Size><AbsDimension x="120" y="16" /></Size>
|
||||
<Anchors><Anchor point="LEFT"><Offset><AbsDimension x="25" y="-3"/></Offset></Anchor></Anchors>
|
||||
<Layers>
|
||||
<Layer level="BACKGROUND">
|
||||
<FontString name="$parent_Name" inherits="GameFontHighlightSmall">
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
</Layer>
|
||||
</Layers>
|
||||
</Frame>
|
||||
|
||||
<Frame>
|
||||
<Size><AbsDimension x="120" y="16" /></Size>
|
||||
<Anchors><Anchor point="LEFT"><Offset><AbsDimension x="300" y="0"/></Offset></Anchor></Anchors>
|
||||
<Frames>
|
||||
<Frame name="$parent_UnitPrice" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors><Anchor point="RIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
MoneyFrame_SetType("STATIC")
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
|
||||
<Frame>
|
||||
<Size><AbsDimension x="50" y="16" /></Size>
|
||||
<Anchors><Anchor point="LEFT"><Offset><AbsDimension x="485" y="-3"/></Offset></Anchor></Anchors>
|
||||
<Layers>
|
||||
<Layer level="BACKGROUND">
|
||||
<FontString name="$parent_StackSize" inherits="GameFontHighlightSmall">
|
||||
<Anchors><Anchor point="TOPRIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
</Layer>
|
||||
</Layers>
|
||||
</Frame>
|
||||
|
||||
<Frame>
|
||||
<Size><AbsDimension x="120" y="16" /></Size>
|
||||
<Anchors><Anchor point="LEFT"><Offset><AbsDimension x="620" y="0"/></Offset></Anchor></Anchors>
|
||||
<Frames>
|
||||
<Frame name="$parent_TotalPrice" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors><Anchor point="RIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
MoneyFrame_SetType("STATIC")
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
</Frames>
|
||||
|
||||
<HighlightTexture file="Interface\HelpFrame\HelpFrameButton-Highlight" alphaMode="ADD">
|
||||
<TexCoords left="0" right="1.0" top="0.0" bottom="0.6"/>
|
||||
</HighlightTexture>
|
||||
<Scripts>
|
||||
<OnEnter>
|
||||
AuxBuyEntry_OnEnter()
|
||||
scrollFrame = getglobal(this:GetParent():GetName().."ScrollFrame")
|
||||
index = this:GetID() + FauxScrollFrame_GetOffset(scrollFrame)
|
||||
AuxBuyEntry_OnEnter(index)
|
||||
</OnEnter>
|
||||
<OnLeave>
|
||||
GameTooltip:Hide()
|
||||
ResetCursor()
|
||||
scrollFrame = nil
|
||||
index = nil
|
||||
</OnLeave>
|
||||
<OnClick>
|
||||
AuxBuyEntry_OnClick()
|
||||
AuxBuyEntry_OnClick(index)
|
||||
</OnClick>
|
||||
<OnUpdate>
|
||||
if index then
|
||||
if IsControlKeyDown() then
|
||||
ShowInspectCursor()
|
||||
elseif IsAltKeyDown() then
|
||||
SetCursor("BUY_CURSOR")
|
||||
else
|
||||
ResetCursor()
|
||||
end
|
||||
end
|
||||
</OnUpdate>
|
||||
</Scripts>
|
||||
<HighlightTexture name="$parentHighlight" file="Interface\HelpFrame\HelpFrameButton-Highlight" alphaMode="ADD">
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor><Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
<TexCoords left="0" right="1.0" top="0" bottom="0.578125"/>
|
||||
</HighlightTexture>
|
||||
</Button>
|
||||
|
||||
<Frame name="AuxBuyTemplate" virtual="true" hidden="true">
|
||||
<Size>
|
||||
<AbsDimension x="694" y="447"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"/>
|
||||
</Anchors>
|
||||
|
||||
<Size><AbsDimension x="694" y="447"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"/></Anchors>
|
||||
<Layers>
|
||||
<Layer level="BACKGROUND">
|
||||
<FontString inherits="GameFontNormal" text="Aux Buy">
|
||||
@@ -109,47 +62,154 @@
|
||||
<Anchors><Anchor point="TOP"><Offset><AbsDimension x="70" y="-120"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
</Layer>
|
||||
<Layer level="ARTWORK">
|
||||
<Texture name="$parentMiddle" file="Interface\Glues\CharacterCreate\CharacterCreate-LabelFrame">
|
||||
<Size><AbsDimension x="802" y="64"/></Size>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT">
|
||||
<Offset>
|
||||
<AbsDimension x="20" y="-52"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<TexCoords left="0.1953125" right="0.8046875" top="0" bottom="1"/>
|
||||
</Texture>
|
||||
|
||||
<FontString inherits="GameFontHighlightSmall" text="Name">
|
||||
<Anchors><Anchor point="LEFT" relativePoint="LEFT" relativeTo="$parentMiddle"><Offset><AbsDimension x="27" y="1"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
|
||||
<FontString inherits="GameFontHighlightSmall" text="Unit Price">
|
||||
<Anchors><Anchor point="LEFT" relativePoint="LEFT" relativeTo="$parentMiddle"><Offset><AbsDimension x="358" y="1"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
|
||||
<FontString inherits="GameFontHighlightSmall" text="Stack Size">
|
||||
<Anchors><Anchor point="LEFT" relativePoint="LEFT" relativeTo="$parentMiddle"><Offset><AbsDimension x="509" y="1"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
|
||||
<FontString inherits="GameFontHighlightSmall" text="Total Price">
|
||||
<Anchors><Anchor point="LEFT" relativePoint="LEFT" relativeTo="$parentMiddle"><Offset><AbsDimension x="675" y="1"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
</Layer>
|
||||
</Layers>
|
||||
|
||||
<Frames>
|
||||
<!-- <Frame name="AuxBuyList" inherits="ListTemplate">
|
||||
<Size><AbsDimension x="610" y="334"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="187" y="-77"/></Offset></Anchor></Anchors>
|
||||
<Frame name="AuxBuyList" inherits="ListTemplate">
|
||||
<Size><AbsDimension x="781" y="334"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="18" y="-74"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
Aux.list.initialize(this, {{ width=50, logicalColumns={1,2,3} }, { width=50, logicalColumns={1,2,3} }})
|
||||
Aux.list.on_load(this)
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame> -->
|
||||
<Frames>
|
||||
<Frame>
|
||||
<Size><AbsDimension x="40" y="43"/></Size>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="783" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Backdrop bgFile="Interface/AuctionFrame/UI-AuctionFrame-FilterBg"></Backdrop>
|
||||
</Frame>
|
||||
<Button name="$parentItem1" inherits="SearchListItemTemplate" id="1">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn1Sort" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="4" y="-4"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Frame>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parentItem1"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT" relativeTo="$parentItem1"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Backdrop bgFile="Interface/Tooltips/UI-Tooltip-Background"><Color r="1" g="1" b="1" a="0.2"/></Backdrop>
|
||||
</Frame>
|
||||
<Button name="$parentItem2" inherits="SearchListItemTemplate" id="2">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentItem1" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Button name="$parentItem3" inherits="SearchListItemTemplate" id="3">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentItem2" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Frame>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parentItem3"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT" relativeTo="$parentItem3"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Backdrop bgFile="Interface/Tooltips/UI-Tooltip-Background"><Color r="1" g="1" b="1" a="0.2"/></Backdrop>
|
||||
</Frame>
|
||||
<Button name="$parentItem4" inherits="SearchListItemTemplate" id="4">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentItem3" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Button name="$parentItem5" inherits="SearchListItemTemplate" id="5">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentItem4" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Frame>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parentItem5"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT" relativeTo="$parentItem5"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Backdrop bgFile="Interface/Tooltips/UI-Tooltip-Background"><Color r="1" g="1" b="1" a="0.2"/></Backdrop>
|
||||
</Frame>
|
||||
<Button name="$parentItem6" inherits="SearchListItemTemplate" id="6">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentItem5" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Button name="$parentItem7" inherits="SearchListItemTemplate" id="7">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentItem6" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Frame>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parentItem7"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT" relativeTo="$parentItem7"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Backdrop bgFile="Interface/Tooltips/UI-Tooltip-Background"><Color r="1" g="1" b="1" a="0.2"/></Backdrop>
|
||||
</Frame>
|
||||
<Button name="$parentItem8" inherits="SearchListItemTemplate" id="8">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentItem7" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Button name="$parentItem9" inherits="SearchListItemTemplate" id="9">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentItem8" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Frame>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parentItem9"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT" relativeTo="$parentItem9"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Backdrop bgFile="Interface/Tooltips/UI-Tooltip-Background"><Color r="1" g="1" b="1" a="0.2"/></Backdrop>
|
||||
</Frame>
|
||||
<Button name="$parentItem10" inherits="SearchListItemTemplate" id="10">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentItem9" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Button name="$parentItem11" inherits="SearchListItemTemplate" id="11">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentItem10" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Frame>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parentItem11"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT" relativeTo="$parentItem11"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Backdrop bgFile="Interface/Tooltips/UI-Tooltip-Background"><Color r="1" g="1" b="1" a="0.2"/></Backdrop>
|
||||
</Frame>
|
||||
<Button name="$parentItem12" inherits="SearchListItemTemplate" id="12">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentItem11" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Button name="$parentItem13" inherits="SearchListItemTemplate" id="13">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentItem12" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Frame>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parentItem13"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT" relativeTo="$parentItem13"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Backdrop bgFile="Interface/Tooltips/UI-Tooltip-Background"><Color r="1" g="1" b="1" a="0.2"/></Backdrop>
|
||||
</Frame>
|
||||
<Button name="$parentItem14" inherits="SearchListItemTemplate" id="14">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentItem13" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Button name="$parentItem15" inherits="SearchListItemTemplate" id="15">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentItem14" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Frame>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parentItem15"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT" relativeTo="$parentItem15"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Backdrop bgFile="Interface/Tooltips/UI-Tooltip-Background"><Color r="1" g="1" b="1" a="0.2"/></Backdrop>
|
||||
</Frame>
|
||||
<Button name="$parentItem16" inherits="SearchListItemTemplate" id="16">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentItem15" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Button name="$parentItem17" inherits="SearchListItemTemplate" id="17">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentItem16" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Frame>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parentItem17"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT" relativeTo="$parentItem17"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Backdrop bgFile="Interface/Tooltips/UI-Tooltip-Background"><Color r="1" g="1" b="1" a="0.2"/></Backdrop>
|
||||
</Frame>
|
||||
<Button name="$parentItem18" inherits="SearchListItemTemplate" id="18">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentItem17" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Button name="$parentItem19" inherits="SearchListItemTemplate" id="19">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentItem18" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Frame>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parentItem19"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT" relativeTo="$parentItem19"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Backdrop bgFile="Interface/Tooltips/UI-Tooltip-Background"><Color r="1" g="1" b="1" a="0.2"/></Backdrop>
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
|
||||
<Frame name="AuxBuyFilters">
|
||||
<Size><AbsDimension x="1" y="1"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="80" y="-46"/></Offset></Anchor></Anchors>
|
||||
@@ -335,47 +395,10 @@
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
|
||||
<ScrollFrame name="AuxBuyScrollFrame" inherits="FauxScrollFrameTemplate">
|
||||
<Size><AbsDimension x="785" y="309"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="13" y="-98"/></Offset></Anchor></Anchors>
|
||||
|
||||
<Scripts>
|
||||
<OnVerticalScroll>
|
||||
FauxScrollFrame_OnVerticalScroll(16, Aux_Buy_ScrollbarUpdate)
|
||||
</OnVerticalScroll>
|
||||
<OnShow>
|
||||
<!--Aux_ScrollbarUpdate();-->
|
||||
</OnShow>
|
||||
</Scripts>
|
||||
</ScrollFrame>
|
||||
|
||||
<Button name="AuxBuyEntry1" inherits="AuxBuyEntryTemplate">
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyScrollFrame" relativePoint="TOPLEFT"><Offset><AbsDimension x="8" y="0"/></Offset></Anchor></Anchors>
|
||||
</Button>
|
||||
<Button name="AuxBuyEntry2" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry1" relativePoint="BOTTOMLEFT"/></Anchors></Button>
|
||||
<Button name="AuxBuyEntry3" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry2" relativePoint="BOTTOMLEFT"/></Anchors></Button>
|
||||
<Button name="AuxBuyEntry4" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry3" relativePoint="BOTTOMLEFT"/></Anchors></Button>
|
||||
<Button name="AuxBuyEntry5" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry4" relativePoint="BOTTOMLEFT"/></Anchors></Button>
|
||||
<Button name="AuxBuyEntry6" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry5" relativePoint="BOTTOMLEFT"/></Anchors></Button>
|
||||
<Button name="AuxBuyEntry7" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry6" relativePoint="BOTTOMLEFT"/></Anchors></Button>
|
||||
<Button name="AuxBuyEntry8" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry7" relativePoint="BOTTOMLEFT"/></Anchors></Button>
|
||||
<Button name="AuxBuyEntry9" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry8" relativePoint="BOTTOMLEFT"/></Anchors></Button>
|
||||
<Button name="AuxBuyEntry10" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry9" relativePoint="BOTTOMLEFT"/></Anchors></Button>
|
||||
<Button name="AuxBuyEntry11" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry10" relativePoint="BOTTOMLEFT"/></Anchors></Button>
|
||||
<Button name="AuxBuyEntry12" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry11" relativePoint="BOTTOMLEFT"/></Anchors></Button>
|
||||
<Button name="AuxBuyEntry13" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry12" relativePoint="BOTTOMLEFT"/></Anchors></Button>
|
||||
<Button name="AuxBuyEntry14" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry13" relativePoint="BOTTOMLEFT"/></Anchors></Button>
|
||||
<Button name="AuxBuyEntry15" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry14" relativePoint="BOTTOMLEFT"/></Anchors></Button>
|
||||
<Button name="AuxBuyEntry16" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry15" relativePoint="BOTTOMLEFT"/></Anchors></Button>
|
||||
<Button name="AuxBuyEntry17" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry16" relativePoint="BOTTOMLEFT"/></Anchors></Button>
|
||||
<Button name="AuxBuyEntry18" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry17" relativePoint="BOTTOMLEFT"/></Anchors></Button>
|
||||
<Button name="AuxBuyEntry19" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry18" relativePoint="BOTTOMLEFT"/></Anchors></Button>
|
||||
|
||||
<Frame name="AuxBuyBuyoutDialog" frameStrata="FULLSCREEN_DIALOG" toplevel="true" enableMouse="true" hidden="true" movable="true">
|
||||
<Size><AbsDimension x="260" y="160" /></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="300" y="-150"/></Offset></Anchor></Anchors>
|
||||
|
||||
<Frame name="AuxBuyDialog" frameStrata="FULLSCREEN_DIALOG" toplevel="true" enableMouse="true" hidden="true" movable="true">
|
||||
<Size><AbsDimension x="230" y="140" /></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="300" y="-150"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>this:RegisterForDrag("LeftButton")</OnLoad>
|
||||
<OnDragStart>this:StartMoving()</OnDragStart>
|
||||
@@ -388,88 +411,37 @@
|
||||
</Backdrop>
|
||||
<Frames>
|
||||
<SimpleHTML name="$parentHTML">
|
||||
<Size><AbsDimension x="260" y="160" /></Size>
|
||||
<Size><AbsDimension x="200" y="1" /></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="30" y="-30"/></Offset></Anchor></Anchors>
|
||||
<FontStringHeader1 inherits="GameFontNormalWhite"/>
|
||||
</SimpleHTML>
|
||||
<Frame>
|
||||
<Frame>
|
||||
<Size><AbsDimension x="120" y="16" /></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="30" y="-70"/></Offset></Anchor></Anchors>
|
||||
<Frames>
|
||||
<Frame name="$parentBuyoutPrice" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors><Anchor point="RIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
MoneyFrame_SetType("STATIC")
|
||||
snipe.log('kek'..this:GetName())
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
</Frame>
|
||||
<Button name="$parentBuyButton" inherits="UIPanelButtonTemplate" text="Buy" disabled="true">
|
||||
<Size><AbsDimension x="100" y="22"/> </Size>
|
||||
<Anchors><Anchor point="BOTTOMLEFT"><Offset><AbsDimension x="20" y="15"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Aux.buy.buyout_dialog_buy()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
<Button name="$parentCancelButton" inherits="UIPanelButtonTemplate" text="Cancel">
|
||||
<Size><AbsDimension x="100" y="22"/> </Size>
|
||||
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-20" y="15"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Aux.buy.buyout_dialog_cancel()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
</Frames>
|
||||
</Frame>
|
||||
|
||||
<Frame name="AuxBuyBidDialog" frameStrata="FULLSCREEN_DIALOG" toplevel="true" enableMouse="true" hidden="true" movable="true">
|
||||
|
||||
<Size><AbsDimension x="260" y="160" /></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="300" y="-150"/></Offset></Anchor></Anchors>
|
||||
|
||||
<Scripts>
|
||||
<OnLoad>this:RegisterForDrag("LeftButton")</OnLoad>
|
||||
<OnDragStart>this:StartMoving()</OnDragStart>
|
||||
<OnDragStop>this:StopMovingOrSizing()</OnDragStop>
|
||||
</Scripts>
|
||||
<Backdrop bgFile="Interface\CharacterFrame\UI-Party-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
|
||||
<BackgroundInsets><AbsInset left="11" right="12" top="12" bottom="11"/></BackgroundInsets>
|
||||
<TileSize><AbsValue val="32"/></TileSize>
|
||||
<EdgeSize><AbsValue val="32"/></EdgeSize>
|
||||
</Backdrop>
|
||||
|
||||
<Frames>
|
||||
<SimpleHTML name="$parentHTML">
|
||||
<Size><AbsDimension x="260" y="160" /></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="30" y="-30"/></Offset></Anchor></Anchors>
|
||||
</SimpleHTML>
|
||||
<Frame name="$parentBid" inherits="MoneyInputFrameTemplate">
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="30" y="-70"/></Offset></Anchor></Anchors>
|
||||
</Frame>
|
||||
<Button name="$parentBidButton" inherits="UIPanelButtonTemplate" text="Bid" disabled="true">
|
||||
<Size><AbsDimension x="100" y="22"/> </Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="35" y="-60"/></Offset></Anchor></Anchors>
|
||||
</Frame>
|
||||
<Frame name="$parentBuyoutPrice" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="30" y="-60"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
MoneyFrame_SetType("STATIC")
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Button name="$parentActionButton" inherits="UIPanelButtonTemplate" text="Buy" disabled="true">
|
||||
<Size><AbsDimension x="85" y="22"/> </Size>
|
||||
<Anchors><Anchor point="BOTTOMLEFT"><Offset><AbsDimension x="20" y="15"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Aux.buy.bid_dialog_bid()
|
||||
Aux.buy.dialog_action()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
<Button name="$parentCancelButton" inherits="UIPanelButtonTemplate" text="Cancel">
|
||||
<Size><AbsDimension x="100" y="22"/> </Size>
|
||||
<Size><AbsDimension x="85" y="22"/> </Size>
|
||||
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-20" y="15"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Aux.buy.bid_dialog_cancel()
|
||||
Aux.buy.dialog_cancel()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
@@ -477,32 +449,4 @@
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
|
||||
<Frame name="AuxBuyReport" frameStrata="FULLSCREEN_DIALOG" toplevel="true" parent="UIParent" enableMouse="true" hidden="true">
|
||||
<Size><AbsDimension x="400" y="180" /></Size>
|
||||
<Anchors><Anchor point="TOP"><Offset><AbsDimension x="0" y="-90"/></Offset></Anchor></Anchors>
|
||||
|
||||
<Backdrop bgFile="Interface\CharacterFrame\UI-Party-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
|
||||
<BackgroundInsets><AbsInset left="11" right="12" top="12" bottom="11"/></BackgroundInsets>
|
||||
<TileSize><AbsValue val="32"/></TileSize>
|
||||
<EdgeSize><AbsValue val="32"/></EdgeSize>
|
||||
</Backdrop>
|
||||
|
||||
<Frames>
|
||||
<SimpleHTML name="AuxBuyReportHTML">
|
||||
<Size><AbsDimension x="420" y="420" /></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="30" y="-30"/></Offset></Anchor></Anchors>
|
||||
</SimpleHTML>
|
||||
|
||||
<Button inherits="UIPanelButtonTemplate" text="Close">
|
||||
<Size><AbsDimension x="100" y="22"/> </Size>
|
||||
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-20" y="15"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
AuxBuyReport:Hide()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
</Frames>
|
||||
</Frame>
|
||||
</Ui>
|
||||
+57
-50
@@ -1,45 +1,49 @@
|
||||
Aux.control = {}
|
||||
|
||||
local event_listeners = {}
|
||||
|
||||
local update_listeners = {}
|
||||
|
||||
function Aux.control.on_event()
|
||||
for listener, _ in pairs(event_listeners) do
|
||||
if event == listener.event then
|
||||
if event == listener.event and not listener.deleted then
|
||||
listener.action()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Aux.control.on_update()
|
||||
event_listeners = Aux.util.set_filter(event_listeners, function(l) return not l.deleted end)
|
||||
update_listeners = Aux.util.set_filter(update_listeners, function(l) return not l.deleted end)
|
||||
|
||||
for listener, _ in pairs(update_listeners) do
|
||||
listener.action()
|
||||
if not listener.deleted then
|
||||
listener.action()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
function Aux.control.event_listener(event, action) -- async!
|
||||
function Aux.control.event_listener(event, action)
|
||||
local self = {}
|
||||
|
||||
local listener = { event=event, action=action }
|
||||
|
||||
function self:set_action(self, action)
|
||||
function self.set_action(action)
|
||||
listener.action = action
|
||||
end
|
||||
|
||||
function self:start(self)
|
||||
function self.start()
|
||||
Aux.util.set_add(event_listeners, listener)
|
||||
if not Aux.util.any(event_listeners, function(l) l.event == event end then
|
||||
if not Aux.util.any(event_listeners, function(l) return l.event == event end) then
|
||||
AuxControlFrame:RegisterEvent(event)
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
function self:stop(self)
|
||||
Aux.util.set_remove(event_listeners, listener)
|
||||
if not Aux.util.any(event_listeners, function(l) l.event == event end then
|
||||
function self.stop()
|
||||
listener.deleted = true
|
||||
if not Aux.util.any(event_listeners, function(l) return l.event == event end) then
|
||||
AuxControlFrame:UnregisterEvent(event)
|
||||
end
|
||||
return self
|
||||
@@ -53,84 +57,87 @@ function Aux.control.update_listener(action)
|
||||
|
||||
local listener = { action=action }
|
||||
|
||||
function self:set_action(self, action)
|
||||
function self.set_action(action)
|
||||
listener.action = action
|
||||
end
|
||||
|
||||
function self:start(self)
|
||||
function self.start()
|
||||
Aux.util.set_add(update_listeners, listener)
|
||||
return self
|
||||
end
|
||||
|
||||
function self:stop(self)
|
||||
Aux.util.set_remove(update_listeners, listener)
|
||||
function self.stop()
|
||||
listener.deleted = true
|
||||
return self
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
function Aux.control.on_next_update(callback)
|
||||
local listener = Aux.control.update_listener()
|
||||
|
||||
listener:set_action(function()
|
||||
listener.set_action(function()
|
||||
listener:stop()
|
||||
callback()
|
||||
end
|
||||
return callback()
|
||||
end)
|
||||
|
||||
listener:start()
|
||||
listener.start()
|
||||
end
|
||||
|
||||
function Aux.control.on_next_event(event, callback)
|
||||
local listener = Aux.control.event_listener(event)
|
||||
|
||||
listener.set_action(function()
|
||||
listener:stop()
|
||||
return callback()
|
||||
end)
|
||||
|
||||
listener.start()
|
||||
end
|
||||
|
||||
function Aux.control.as_soon_as(p, callback)
|
||||
local listener = Aux.control.update_listener()
|
||||
|
||||
listener:set_action(function()
|
||||
listener.set_action(function()
|
||||
if p() then
|
||||
callback()
|
||||
listener:stop()
|
||||
listener.stop()
|
||||
return callback()
|
||||
end
|
||||
end)
|
||||
|
||||
listener:start()
|
||||
end
|
||||
|
||||
function Aux.control.on_next_event(event, callback)
|
||||
local ok
|
||||
|
||||
local listener = Aux.control.event_listener(event)
|
||||
|
||||
listener:set_action(function()
|
||||
listener:stop()
|
||||
ok = true
|
||||
end
|
||||
|
||||
listener:start()
|
||||
|
||||
Aux.control.as_soon_as(function() return ok end, callback)
|
||||
listener.start()
|
||||
end
|
||||
|
||||
|
||||
|
||||
function Aux.control.timer()
|
||||
function Aux.control.controller()
|
||||
local self = {}
|
||||
|
||||
local t_0
|
||||
local state
|
||||
|
||||
function self:start(self)
|
||||
t_0 = GetTime()
|
||||
local listener = Aux.control.update_listener()
|
||||
listener.set_action(function()
|
||||
if state and state.p() then
|
||||
local k = state.k
|
||||
state = nil
|
||||
return k()
|
||||
end
|
||||
end)
|
||||
listener.start()
|
||||
|
||||
function self.wait(p, k)
|
||||
state = {
|
||||
k = k,
|
||||
p = p,
|
||||
}
|
||||
end
|
||||
|
||||
function self:after(self, t, callback)
|
||||
Aux.util.as_soon_as(function() return t_0 and GetTime() - t_0 > t end, callback)
|
||||
function self.cleanup()
|
||||
listener.stop()
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
function Aux.control.after_time(t, callback)
|
||||
local timer = Aux.control.timer()
|
||||
timer:start()
|
||||
timer:after(t, callback)
|
||||
end
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
|
||||
|
||||
<Script file="control.lua"/>
|
||||
|
||||
<Frame name="AuxControlFrame">
|
||||
<Scripts>
|
||||
<OnEvent>
|
||||
Aux.control.on_event()
|
||||
</OnEvent>
|
||||
<OnUpdate>
|
||||
Aux.control.on_update()
|
||||
</OnUpdate>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
</Ui>
|
||||
@@ -1,4 +1,4 @@
|
||||
AuxVersion = "1.3.0"
|
||||
AuxVersion = "1.4.1"
|
||||
AuxAuthors = "shirsig; Zerf; Zirco (Auctionator); Nimeral (Auctionator backport)"
|
||||
|
||||
local lastRightClickAction = GetTime()
|
||||
@@ -172,8 +172,8 @@ function Aux_SetupHookFunctions()
|
||||
Aux.orig.ContainerFrameItemButton_OnClick = ContainerFrameItemButton_OnClick
|
||||
ContainerFrameItemButton_OnClick = Aux_ContainerFrameItemButton_OnClick
|
||||
|
||||
Aux.orig.AuctionFrameBids_Update = AuctionFrameBids_Update
|
||||
AuctionFrameBids_Update = Aux_AuctionFrameBids_Update
|
||||
Aux.orig.AuctionFrameBid_Update = AuctionFrameBid_Update
|
||||
AuctionFrameBid_Update = Aux_AuctionFrameBid_Update
|
||||
|
||||
Aux.orig.AuctionFrameAuctions_Update = AuctionFrameAuctions_Update
|
||||
AuctionFrameAuctions_Update = Aux_AuctionFrameAuctions_Update
|
||||
@@ -484,7 +484,7 @@ end
|
||||
|
||||
-----------------------------------------
|
||||
|
||||
function Aux.auction_key(tooltip, stack_size, buyout_price)
|
||||
function Aux.auction_key(tooltip, stack_size, amount)
|
||||
local key = ''
|
||||
for i, line in ipairs(tooltip) do
|
||||
local left_text = line[1].text
|
||||
@@ -496,5 +496,5 @@ function Aux.auction_key(tooltip, stack_size, buyout_price)
|
||||
key = key .. right_text .. '_'
|
||||
end
|
||||
end
|
||||
return key .. stack_size .. '_' .. buyout_price
|
||||
return key .. (stack_size or '0') .. '_' .. (amount or '0')
|
||||
end
|
||||
@@ -26,7 +26,7 @@ function Aux.info.container_item(bag, slot)
|
||||
end
|
||||
|
||||
function Aux.info.auction_sell_item()
|
||||
local name, texture, count, quality, usable, price, unit_price, max_stack, total_count = GetAuctionSellItemInfo()
|
||||
local name, texture, count, quality, usable, price, buyout_price_per_unit, max_stack, total_count = GetAuctionSellItemInfo()
|
||||
auction_sell_item = {
|
||||
name = name,
|
||||
texture = texture,
|
||||
@@ -34,7 +34,7 @@ function Aux.info.auction_sell_item()
|
||||
quality = quality,
|
||||
usable = usable,
|
||||
price = price,
|
||||
unit_price = unit_price,
|
||||
buyout_price_per_unit = buyout_price_per_unit,
|
||||
max_stack = max_stack,
|
||||
total_count = total_count,
|
||||
}
|
||||
@@ -54,7 +54,7 @@ function Aux.info.auction_item(index)
|
||||
|
||||
local auction_item = hyperlink_item(hyperlink)
|
||||
|
||||
local name, texture, count, quality, usable, level, min_bid, min_increment, buyout_price, bid_amount, high_bidder, owner, sale_status, id, has_all_info = GetAuctionItemInfo("list", index)
|
||||
local name, texture, count, quality, usable, level, min_bid, min_increment, buyout_price, current_bid, high_bidder, owner, sale_status, id, has_all_info = GetAuctionItemInfo("list", index)
|
||||
local duration = GetAuctionItemTimeLeft("list", index)
|
||||
|
||||
auction_item.texture = texture
|
||||
@@ -62,7 +62,7 @@ function Aux.info.auction_item(index)
|
||||
auction_item.min_bid = min_bid
|
||||
auction_item.min_increment = min_increment
|
||||
auction_item.buyout_price = buyout_price
|
||||
auction_item.bid_amount = bid_amount
|
||||
auction_item.current_bid = current_bid
|
||||
auction_item.high_bidder = high_bidder
|
||||
auction_item.owner = owner
|
||||
auction_item.sale_status = sale_status
|
||||
|
||||
@@ -2,93 +2,164 @@ Aux.list = {}
|
||||
|
||||
local MAX_COLUMNS = 6
|
||||
|
||||
local order = {
|
||||
BUYOUT = "Buyout price",
|
||||
BID = "Bid price",
|
||||
BUYOUT_UNIT = "Unit buyout price",
|
||||
BID_UNIT = "Unit bid price",
|
||||
local NAME, OWNER, BID, BID_UNIT, BUYOUT, BUYOUT_UNIT, QUANTITY = 1, 2, 3, 4, 5, 6, 7, 8
|
||||
|
||||
MoneyTypeInfo["AUX_LIST"] = {
|
||||
UpdateFunc = function()
|
||||
return this.staticMoney
|
||||
end,
|
||||
collapse = 1,
|
||||
fixedWidth = 1,
|
||||
showSmallerCoins = 1,
|
||||
}
|
||||
|
||||
local logical_columns = {
|
||||
{
|
||||
type = 'STRING',
|
||||
title = 'Name',
|
||||
comparator = function(row1, row2) return Aux.util.compare(row1.name, row2.name, Aux.util.GT) end,
|
||||
getter = function(row) return row.name end,
|
||||
color = function(row) return ITEM_QUALITY_COLORS[row.quality] end,
|
||||
},
|
||||
{
|
||||
type = 'STRING',
|
||||
title = 'Owner',
|
||||
comparator = function(row1, row2) return Aux.util.compare(row1.owner, row2.owner, Aux.util.GT) end,
|
||||
getter = function(row) return row.owner end,
|
||||
},
|
||||
{
|
||||
type = 'MONEY',
|
||||
title = 'Bid',
|
||||
comparator = function(row1, row2) return Aux.util.compare(row1.bid, row2.bid, Aux.util.GT) end,
|
||||
getter = function(row) return row.bid end,
|
||||
},
|
||||
{
|
||||
type = 'MONEY',
|
||||
title = 'Bid (Unit)',
|
||||
comparator = function(row1, row2) return Aux.util.compare(row1.bid_per_unit, row2.bid_per_unit, Aux.util.GT) end,
|
||||
getter = function(row) return row.bid_per_unit end,
|
||||
},
|
||||
{
|
||||
type = 'MONEY',
|
||||
title = 'Buyout',
|
||||
comparator = function(row1, row2) return Aux.util.compare(row1.buyout_price, row2.buyout_price, Aux.util.GT) end,
|
||||
getter = function(row) return row.buyout_price end,
|
||||
},
|
||||
{
|
||||
type = 'MONEY',
|
||||
title = 'Buyout (Unit)',
|
||||
comparator = function(row1, row2) return Aux.util.compare(row1.buyout_price_per_unit, row2.buyout_price_per_unit, Aux.util.GT) end,
|
||||
getter = function(row) return row.buyout_price_per_unit end,
|
||||
},
|
||||
{
|
||||
type = 'NUMBER',
|
||||
title = 'Quantity',
|
||||
comparator = function(row1, row2) return Aux.util.compare(row1.stack_size, row2.stack_size, Aux.util.LT) end,
|
||||
getter = function(row) return row.stack_size end,
|
||||
},
|
||||
{
|
||||
type = 'STRING',
|
||||
title = 'Time Left',
|
||||
comparator = function(row1, row2) return Aux.util.invert_order(Aux.util.compare(row1.duration, row2.duration, Aux.util.GT)) end,
|
||||
getter = function(row)
|
||||
if row.duration == 1 then
|
||||
return 'Short'
|
||||
elseif row.duration == 2 then
|
||||
return 'Medium'
|
||||
elseif row.duration == 3 then
|
||||
return 'Long'
|
||||
elseif row.duration == 4 then
|
||||
return 'Very Long'
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
local physical_columns = {
|
||||
{ logical_column = logical_columns[NAME], width = 156 },
|
||||
{ logical_column = logical_columns[OWNER], width = 156 },
|
||||
{ logical_column = logical_columns[BUYOUT_UNIT], width = 156 },
|
||||
{ logical_column = logical_columns[QUANTITY], width = 156 },
|
||||
{ logical_column = logical_columns[BUYOUT], width = 156 },
|
||||
}
|
||||
|
||||
|
||||
|
||||
function Aux.list.on_load()
|
||||
Aux.list.initialize(this, physical_columns, logical_columns)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Compare two rows
|
||||
-- Aux.util.compare two rows
|
||||
-------------------------------------------------------------------------------
|
||||
local CurrentListFrame = nil;
|
||||
function ListTemplate_CompareRows(row1, row2)
|
||||
frame = CurrentListFrame;
|
||||
for index, value in ipairs(frame.sortOrder) do
|
||||
local column = value;
|
||||
local physicalColumn = frame.physicalColumns[column.columnIndex];
|
||||
local logicalColumn = physicalColumn.logicalColumn;
|
||||
if (logicalColumn.compareAscendingFunc and logicalColumn.compareDescendingFunc) then
|
||||
local ascending = logicalColumn.compareAscendingFunc(row1, row2);
|
||||
local descending = logicalColumn.compareDescendingFunc(row1, row2);
|
||||
if (ascending or descending) then
|
||||
if (column.sortAscending) then
|
||||
return ascending;
|
||||
else
|
||||
return descending;
|
||||
|
||||
function Aux.list.row_comparator(list_frame)
|
||||
return function(row1, row2)
|
||||
for _, sort_info in ipairs(list_frame.sort_order) do
|
||||
local logical_column = sort_info.logical_column
|
||||
if logical_column.comparator then
|
||||
local ordering = logical_column.comparator(row1, row2)
|
||||
if ordering ~= Aux.util.EQ then
|
||||
return sort_info.sort_ascending and ordering or Aux.util.invert_order(ordering)
|
||||
end
|
||||
end
|
||||
end
|
||||
return Aux.util.EQ
|
||||
end
|
||||
return false;
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Initialize the list with the column information
|
||||
-------------------------------------------------------------------------------
|
||||
function Aux.list.initialize(frame, physicalColumns, logicalColumns)
|
||||
function Aux.list.initialize(frame, physical_columns, logical_columns)
|
||||
frame.lines = 19
|
||||
frame.lineHeight = 16
|
||||
frame.content = {}
|
||||
frame.physicalColumns = physicalColumns
|
||||
frame.logicalColumns = logicalColumns
|
||||
frame.physical_columns = physical_columns
|
||||
frame.logical_columns = logical_columns
|
||||
|
||||
frame.sortOrder = {}
|
||||
for physicalColumnIndex = 1, MAX_COLUMNS do
|
||||
local button = getglobal(frame:GetName().."Column"..physicalColumnIndex.."Sort")
|
||||
local dropdown = getglobal(frame:GetName().."Column"..physicalColumnIndex.."DropDown")
|
||||
if (physicalColumnIndex <= table.getn(physicalColumns)) then
|
||||
local physicalColumn = physicalColumns[physicalColumnIndex]
|
||||
local logicalColumn = {title='kek'} -- physicalColumn.logicalColumn
|
||||
local column = {}
|
||||
column.columnIndex = physicalColumnIndex
|
||||
column.sortAscending = true
|
||||
table.insert(frame.sortOrder, column)
|
||||
frame.sort_order = {}
|
||||
for i, logical_column in logical_columns do
|
||||
if i ~= BUYOUT_UNIT then
|
||||
tinsert(frame.sort_order, { logical_column = logical_column, sort_ascending = true })
|
||||
end
|
||||
end
|
||||
tinsert(frame.sort_order, 1, { logical_column = logical_columns[BUYOUT_UNIT], sort_ascending = true })
|
||||
|
||||
for i = 1, MAX_COLUMNS do
|
||||
local button = getglobal(frame:GetName().."Column"..i.."Sort")
|
||||
local dropdown = getglobal(frame:GetName().."Column"..i.."DropDown")
|
||||
if (i <= table.getn(physical_columns)) then
|
||||
local physical_column = physical_columns[i]
|
||||
local logical_column = physical_column.logical_column
|
||||
getglobal(button:GetName().."Arrow"):Hide()
|
||||
getglobal(button:GetName().."Text"):SetText(logicalColumn.title)
|
||||
getglobal(button:GetName().."Text"):SetText(logical_column.title)
|
||||
button:Show()
|
||||
if (table.getn(physicalColumn.logicalColumns) > 1) then
|
||||
dropdown:Show()
|
||||
else
|
||||
dropdown:Hide()
|
||||
end
|
||||
Aux.list.set_column_width(frame, physicalColumnIndex, physicalColumn.width);
|
||||
dropdown:Show()
|
||||
|
||||
Aux.list.set_column_width(frame, i, physical_column.width);
|
||||
else
|
||||
button:Hide()
|
||||
dropdown:Hide()
|
||||
end
|
||||
end
|
||||
getglobal(frame:GetName().."Column1SortArrow"):Show()
|
||||
getglobal(frame:GetName().."Column1SortArrow"):SetTexCoord(0, 0.5625, 0, 1.0)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Initialize the list with the column information
|
||||
-------------------------------------------------------------------------------
|
||||
function Aux.list.set_column_width(frame, column, width)
|
||||
function Aux.list.set_column_width(frame, column_index, width)
|
||||
-- Resize the header
|
||||
frame.physicalColumns[column].width = width
|
||||
local button = getglobal(frame:GetName().."Column"..column.."Sort")
|
||||
local button = getglobal(frame:GetName().."Column"..column_index.."Sort")
|
||||
button:SetWidth(width + 2)
|
||||
local dropdown = getglobal(frame:GetName().."Column"..column.."DropDown")
|
||||
local dropdown = getglobal(frame:GetName().."Column"..column_index.."DropDown")
|
||||
UIDropDownMenu_SetWidth(width - 18, dropdown)
|
||||
|
||||
-- Resize each cell in the columns
|
||||
for line = 1, frame.lines do
|
||||
local textControl = getglobal(frame:GetName().."Item"..line.."Column"..column)
|
||||
if textControl then
|
||||
textControl:SetWidth(width - 20)
|
||||
local text = getglobal(frame:GetName().."Item"..line.."Column"..column_index)
|
||||
if text then
|
||||
text:SetWidth(width - 20)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -96,194 +167,176 @@ end
|
||||
-------------------------------------------------------------------------------
|
||||
-- Set the item to display.
|
||||
-------------------------------------------------------------------------------
|
||||
function ListTemplate_SetContent(frame, content)
|
||||
function Aux.list.populate(frame, content)
|
||||
frame.content = content
|
||||
|
||||
-- Perform the sort.
|
||||
CurrentListFrame = frame
|
||||
table.sort(frame.content, ListTemplate_CompareRows)
|
||||
CurrentListFrame = nil
|
||||
Aux.util.merge_sort(frame.content, Aux.list.row_comparator(frame))
|
||||
|
||||
-- Update the scroll pane.
|
||||
ListTemplateScrollFrame_Update(getglobal(frame:GetName().."ScrollFrame"))
|
||||
Aux.list.scroll_frame_update(getglobal(frame:GetName().."ScrollFrame"))
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------
|
||||
function ListTemplate_SelectRow(frame, row)
|
||||
if (frame.selectedRow ~= row) then
|
||||
local scrollFrame = getglobal(frame:GetName().."ScrollFrame");
|
||||
local firstVisibleRow = FauxScrollFrame_GetOffset(scrollFrame) + 1;
|
||||
local lastVisibleRow = firstVisibleRow + frame.lines - 1;
|
||||
-- function ListTemplate_SelectRow(frame, row)
|
||||
-- if frame.selectedRow ~= row then
|
||||
-- local scrollFrame = getglobal(frame:GetName().."ScrollFrame")
|
||||
-- local firstVisibleRow = FauxScrollFrame_GetOffset(scrollFrame) + 1
|
||||
-- local lastVisibleRow = firstVisibleRow + frame.lines - 1
|
||||
|
||||
-- Deselect the previous row
|
||||
if (frame.selectedRow and firstVisibleRow <= frame.selectedRow and frame.selectedRow <= lastVisibleRow) then
|
||||
local line = frame.selectedRow - firstVisibleRow + 1;
|
||||
local item = getglobal(frame:GetName().."Item"..line);
|
||||
item:UnlockHighlight();
|
||||
end
|
||||
-- -- Deselect the previous row
|
||||
-- if frame.selectedRow and firstVisibleRow <= frame.selectedRow and frame.selectedRow <= lastVisibleRow then
|
||||
-- local line = frame.selectedRow - firstVisibleRow + 1
|
||||
-- local item = getglobal(frame:GetName().."Item"..line)
|
||||
-- item:UnlockHighlight()
|
||||
-- end
|
||||
|
||||
-- Update the selected item
|
||||
frame.selectedRow = row;
|
||||
-- -- Update the selected item
|
||||
-- frame.selectedRow = row
|
||||
|
||||
-- Select the new row
|
||||
if (frame.selectedRow and firstVisibleRow <= frame.selectedRow and frame.selectedRow <= lastVisibleRow) then
|
||||
local line = frame.selectedRow - firstVisibleRow + 1;
|
||||
local item = getglobal(frame:GetName().."Item"..line);
|
||||
item:LockHighlight();
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------
|
||||
function Aux.list.sort(frame, columnIndex)
|
||||
-- -- Update the SortColumn order
|
||||
-- if (frame.sortOrder[1].columnIndex == columnIndex) then
|
||||
-- frame.sortOrder[1].sortAscending = not frame.sortOrder[1].sortAscending;
|
||||
-- else
|
||||
-- getglobal(frame:GetName().."Column"..frame.sortOrder[1].columnIndex.."SortArrow"):Hide();
|
||||
-- for index, value in ipairs(frame.sortOrder) do
|
||||
-- if (value.columnIndex == columnIndex) then
|
||||
-- local temp = value;
|
||||
-- table.remove(frame.sortOrder, index);
|
||||
-- table.insert(frame.sortOrder, 1, temp);
|
||||
-- break;
|
||||
-- end
|
||||
-- -- Select the new row
|
||||
-- if frame.selectedRow and firstVisibleRow <= frame.selectedRow and frame.selectedRow <= lastVisibleRow then
|
||||
-- local line = frame.selectedRow - firstVisibleRow + 1
|
||||
-- local item = getglobal(frame:GetName().."Item"..line)
|
||||
-- item:LockHighlight()
|
||||
-- end
|
||||
-- frame.sortOrder[1].sortAscending = true;
|
||||
-- getglobal(frame:GetName().."Column"..frame.sortOrder[1].columnIndex.."SortArrow"):Show();
|
||||
-- end
|
||||
-- end
|
||||
|
||||
-- -- Perform the sort.
|
||||
-- CurrentListFrame = frame;
|
||||
-- table.sort(frame.content, ListTemplate_CompareRows);
|
||||
-- CurrentListFrame = nil;
|
||||
-------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------
|
||||
function Aux.list.sort(frame, physical_column_index)
|
||||
|
||||
-- -- Update the sort arrow.
|
||||
-- if (frame.sortOrder[1].sortAscending) then
|
||||
-- getglobal(frame:GetName().."Column"..frame.sortOrder[1].columnIndex.."SortArrow"):SetTexCoord(0, 0.5625, 0, 1.0);
|
||||
-- else
|
||||
-- getglobal(frame:GetName().."Column"..frame.sortOrder[1].columnIndex.."SortArrow"):SetTexCoord(0, 0.5625, 1.0, 0);
|
||||
-- end
|
||||
local physical_column = frame.physical_columns[physical_column_index]
|
||||
local logical_column = physical_column.logical_column
|
||||
|
||||
if frame.sort_order[1].logical_column == logical_column then
|
||||
frame.sort_order[1].sort_ascending = not frame.sort_order[1].sort_ascending
|
||||
else
|
||||
for index, sort_info in ipairs(frame.sort_order) do
|
||||
if sort_info.logical_column == logical_column then
|
||||
local temp = sort_info
|
||||
table.remove(frame.sort_order, index)
|
||||
table.insert(frame.sort_order, 1, temp)
|
||||
break
|
||||
end
|
||||
end
|
||||
frame.sort_order[1].sort_ascending = true
|
||||
end
|
||||
|
||||
Aux.util.merge_sort(frame.content, Aux.list.row_comparator(frame))
|
||||
|
||||
-- -- Update the scroll pane.
|
||||
-- ListTemplateScrollFrame_Update(getglobal(frame:GetName().."ScrollFrame"));
|
||||
Aux.list.scroll_frame_update(getglobal(frame:GetName().."ScrollFrame"))
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------
|
||||
function ListTemplateScrollFrame_Update(frame)
|
||||
if (not frame) then frame = this end;
|
||||
local parent = frame:GetParent();
|
||||
local content = parent.content;
|
||||
FauxScrollFrame_Update(frame, table.getn(content), parent.lines, parent.lineHeight);
|
||||
function Aux.list.scroll_frame_update(frame)
|
||||
if not frame then frame = this end
|
||||
local parent = frame:GetParent()
|
||||
local content = parent.content
|
||||
FauxScrollFrame_Update(frame, table.getn(content), parent.lines, parent.lineHeight)
|
||||
for line = 1, parent.lines do
|
||||
local item = getglobal(parent:GetName().."Item"..line);
|
||||
local contentIndex = line + FauxScrollFrame_GetOffset(frame);
|
||||
if contentIndex <= table.getn(content) then
|
||||
for columnIndex = 1, MAX_COLUMNS do
|
||||
-- Get the text control (if any)
|
||||
local text = getglobal(parent:GetName().."Item"..line.."Column"..columnIndex);
|
||||
if (text) then
|
||||
text:Hide();
|
||||
end
|
||||
local item = getglobal(parent:GetName().."Item"..line)
|
||||
local row_index = line + FauxScrollFrame_GetOffset(frame)
|
||||
if row_index <= table.getn(content) then
|
||||
for column_index = 1, MAX_COLUMNS do
|
||||
|
||||
local text = getglobal(parent:GetName().."Item"..line.."Column"..column_index)
|
||||
-- text:Hide() TODO
|
||||
text:SetText()
|
||||
|
||||
-- Get the money frame (if any)
|
||||
local moneyFrame = getglobal(parent:GetName().."Item"..line.."Column"..columnIndex.."MoneyFrame");
|
||||
if (moneyFrame) then
|
||||
moneyFrame:Hide();
|
||||
end
|
||||
local moneyFrame = getglobal(parent:GetName().."Item"..line.."Column"..column_index.."MoneyFrame")
|
||||
moneyFrame:Hide()
|
||||
|
||||
-- If the column exists, update it
|
||||
if (columnIndex <= table.getn(parent.physicalColumns)) then
|
||||
local physicalColumn = parent.physicalColumns[columnIndex];
|
||||
local logicalColumn = physicalColumn.logicalColumn;
|
||||
local value = logicalColumn.valueFunc(content[contentIndex]);
|
||||
|
||||
-- Setup the control based on the datatype
|
||||
if (value) then
|
||||
if (text and (logicalColumn.dataType == "Date" or logicalColumn.dataType == "Number" or logicalColumn.dataType == "String")) then
|
||||
text:SetText(value);
|
||||
if (logicalColumn.colorFunc) then
|
||||
local color = logicalColumn.colorFunc(content[contentIndex]);
|
||||
text:SetTextColor(color.r, color.g, color.b);
|
||||
if column_index <= table.getn(parent.physical_columns) then
|
||||
local physical_column = parent.physical_columns[column_index]
|
||||
local logical_column = physical_column.logical_column
|
||||
local value = logical_column.getter(content[row_index])
|
||||
|
||||
local arrow = getglobal(parent:GetName().."Column"..column_index.."SortArrow")
|
||||
local sort_info = parent.sort_order[1]
|
||||
if sort_info.logical_column == logical_column then
|
||||
if sort_info.sort_ascending then
|
||||
arrow:SetTexCoord(0, 0.5625, 0, 1.0)
|
||||
else
|
||||
arrow:SetTexCoord(0, 0.5625, 1.0, 0)
|
||||
end
|
||||
arrow:Show()
|
||||
else
|
||||
arrow:Hide()
|
||||
end
|
||||
|
||||
if value then
|
||||
if text and (logical_column.type == "DATE" or logical_column.type == "NUMBER" or logical_column.type == "STRING") then
|
||||
text:SetText(value)
|
||||
if logical_column.color then
|
||||
local color = logical_column.color(content[row_index])
|
||||
text:SetTextColor(color.r, color.g, color.b)
|
||||
else
|
||||
text:SetTextColor(255, 255, 255);
|
||||
text:SetTextColor(255, 255, 255)
|
||||
end
|
||||
if (logicalColumn.alphaFunc) then
|
||||
text:SetAlpha(logicalColumn.alphaFunc(content[contentIndex]));
|
||||
if logical_column.alphaFunc then
|
||||
text:SetAlpha(logical_column.alphaFunc(content[row_index]))
|
||||
else
|
||||
text:SetAlpha(1.0);
|
||||
text:SetAlpha(1.0)
|
||||
end
|
||||
if (logicalColumn.dataType == "Number") then
|
||||
text:SetJustifyH("RIGHT");
|
||||
if (logical_column.type == "NUMBER") then
|
||||
text:SetJustifyH("RIGHT")
|
||||
else
|
||||
text:SetJustifyH("LEFT");
|
||||
text:SetJustifyH("LEFT")
|
||||
end
|
||||
text:Show();
|
||||
elseif (moneyFrame and logicalColumn.dataType == "Money") then
|
||||
if (value >= 0) then
|
||||
MoneyFrame_Update(moneyFrame:GetName(), value);
|
||||
SetMoneyFrameColor(moneyFrame:GetName(), 255, 255, 255);
|
||||
text:Show()
|
||||
elseif moneyFrame and logical_column.type == "MONEY" then
|
||||
if value >= 0 then
|
||||
MoneyFrame_Update(moneyFrame:GetName(), value)
|
||||
SetMoneyFrameColor(moneyFrame:GetName(), 255, 255, 255)
|
||||
else
|
||||
MoneyFrame_Update(moneyFrame:GetName(), -value);
|
||||
SetMoneyFrameColor(moneyFrame:GetName(), 255, 0, 0);
|
||||
MoneyFrame_Update(moneyFrame:GetName(), -value)
|
||||
SetMoneyFrameColor(moneyFrame:GetName(), 255, 0, 0)
|
||||
end
|
||||
if (logicalColumn.alphaFunc) then
|
||||
moneyFrame:SetAlpha(logicalColumn.alphaFunc(content[contentIndex]));
|
||||
if logical_column.alphaFunc then
|
||||
moneyFrame:SetAlpha(logical_column.alphaFunc(content[row_index]))
|
||||
else
|
||||
moneyFrame:SetAlpha(1.0);
|
||||
moneyFrame:SetAlpha(1.0)
|
||||
end
|
||||
moneyFrame:Show();
|
||||
moneyFrame:Show()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Update the row highlight
|
||||
if (parent.selectedRow and parent.selectedRow == contentIndex) then
|
||||
item:LockHighlight();
|
||||
else
|
||||
item:UnlockHighlight();
|
||||
end
|
||||
item:Show();
|
||||
-- -- Update the row highlight
|
||||
-- if parent.selectedRow and parent.selectedRow == row_index then
|
||||
-- item:LockHighlight()
|
||||
-- else
|
||||
-- item:UnlockHighlight()
|
||||
-- end
|
||||
item:Show()
|
||||
else
|
||||
item:Hide();
|
||||
item:Hide()
|
||||
end
|
||||
AuxBuyListScrollFrame:Show()
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------
|
||||
function Aux.list.dropdown_onload()
|
||||
function Aux.list.dropdown_on_load()
|
||||
getglobal(this:GetName().."Text"):Hide()
|
||||
this.initialize = ListTemplate_DropDown_Initialize
|
||||
UIDropDownMenu_SetSelectedID(this, 1)
|
||||
this.initialize = Aux.list.dropdown_initialize
|
||||
-- UIDropDownMenu_SetSelectedID(this, 1) TODO
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------
|
||||
function ListTemplate_DropDown_Initialize()
|
||||
function Aux.list.dropdown_initialize()
|
||||
local dropdown = this:GetParent()
|
||||
local frame = dropdown:GetParent()
|
||||
|
||||
-- if (frame.physicalColumns) then
|
||||
-- local physicalColumnIndex = dropdown:GetID();
|
||||
-- local physicalColumn = frame.physicalColumns[physicalColumnIndex];
|
||||
-- for index, value in pairs(physicalColumn.logicalColumns) do
|
||||
-- local logicalColumn = value;
|
||||
-- local info = {};
|
||||
-- info.text = logicalColumn.title;
|
||||
-- info.func = ListTemplate_DropDownItem_OnClick;
|
||||
-- info.owner = dropdown;
|
||||
-- UIDropDownMenu_AddButton(info);
|
||||
-- end
|
||||
-- end
|
||||
|
||||
for _, name in pairs(order) do
|
||||
for _, logical_column in pairs(frame.logical_columns) do
|
||||
UIDropDownMenu_AddButton({
|
||||
text = name,
|
||||
text = logical_column.title,
|
||||
owner = dropdown,
|
||||
func = Aux.list.dropdown_item_onclick
|
||||
})
|
||||
@@ -292,25 +345,21 @@ end
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------
|
||||
function Aux.list.dropdown_item_onclick()
|
||||
-- local logicalColumnIndex = this:GetID()
|
||||
-- local physicalColumnIndex = this.owner:GetID()
|
||||
-- local dropdown = this.owner
|
||||
-- local frame = dropdown:GetParent()
|
||||
-- if (frame.physicalColumns[physicalColumnIndex].logicalColumn ~= frame.physicalColumns[physicalColumnIndex].logicalColumns[logicalColumnIndex]) then
|
||||
-- -- Change the physical column's logical column
|
||||
-- frame.physicalColumns[physicalColumnIndex].logicalColumn = frame.physicalColumns[physicalColumnIndex].logicalColumns[logicalColumnIndex]
|
||||
-- getglobal(frame:GetName().."Column"..physicalColumnIndex.."SortText"):SetText(frame.physicalColumns[physicalColumnIndex].logicalColumn.title)
|
||||
function Aux.list.dropdown_item_onclick()
|
||||
local logical_column_index = this:GetID()
|
||||
local physical_column_index = this.owner:GetID()
|
||||
local dropdown = this.owner
|
||||
local frame = dropdown:GetParent()
|
||||
if (frame.physical_columns[physical_column_index].logical_column ~= frame.logical_columns[logical_column_index]) then
|
||||
|
||||
-- -- Sort the content based on the new logical column
|
||||
-- CurrentListFrame = frame;
|
||||
-- table.sort(frame.content, ListTemplate_CompareRows)
|
||||
-- CurrentListFrame = nil
|
||||
frame.physical_columns[physical_column_index].logical_column = frame.logical_columns[logical_column_index]
|
||||
getglobal(frame:GetName().."Column"..physical_column_index.."SortText"):SetText(frame.physical_columns[physical_column_index].logical_column.title)
|
||||
|
||||
-- -- Update the combo and scroll pane.
|
||||
-- UIDropDownMenu_SetSelectedID(dropdown, logicalColumnIndex)
|
||||
-- ListTemplateScrollFrame_Update(getglobal(frame:GetName().."ScrollFrame"))
|
||||
-- end
|
||||
Aux.util.merge_sort(frame.content, Aux.list.row_comparator(frame))
|
||||
|
||||
UIDropDownMenu_SetSelectedID(dropdown, logical_column_index)
|
||||
Aux.list.scroll_frame_update(getglobal(frame:GetName().."ScrollFrame"))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -2,149 +2,93 @@
|
||||
|
||||
<Script file="list.lua"/>
|
||||
|
||||
<!-- <Button name="ListItemTemplate" hidden="true" virtual="true">
|
||||
<Size>
|
||||
<AbsDimension x="605" y="16"/>
|
||||
</Size>
|
||||
<Button name="ListItemTemplate" hidden="false" virtual="true">
|
||||
<Size><AbsDimension x="776" y="16"/></Size>
|
||||
<Layers>
|
||||
<Layer level="BORDER">
|
||||
<FontString name="$parentColumn1" inherits="GameFontHighlight" wraponspaces="false" justifyH="LEFT">
|
||||
<Size>
|
||||
<AbsDimension x="100" y="16"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT">
|
||||
<Offset>
|
||||
<AbsDimension x="10" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Size><AbsDimension x="100" y="16"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
<FontString name="$parentColumn2" inherits="GameFontHighlight" wraponspaces="false" justifyH="LEFT">
|
||||
<Size>
|
||||
<AbsDimension x="100" y="16"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parentColumn1" relativePoint="TOPRIGHT">
|
||||
<Offset>
|
||||
<AbsDimension x="20" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Size><AbsDimension x="100" y="16"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn1" relativePoint="TOPRIGHT"><Offset><AbsDimension x="20" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
<FontString name="$parentColumn3" inherits="GameFontHighlight" wraponspaces="false" justifyH="LEFT">
|
||||
<Size>
|
||||
<AbsDimension x="100" y="16"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parentColumn2" relativePoint="TOPRIGHT">
|
||||
<Offset>
|
||||
<AbsDimension x="20" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Size><AbsDimension x="100" y="16"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn2" relativePoint="TOPRIGHT"><Offset><AbsDimension x="20" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
<FontString name="$parentColumn4" inherits="GameFontHighlight" wraponspaces="false" justifyH="LEFT">
|
||||
<Size>
|
||||
<AbsDimension x="100" y="16"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parentColumn3" relativePoint="TOPRIGHT">
|
||||
<Offset>
|
||||
<AbsDimension x="20" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Size><AbsDimension x="100" y="16"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn3" relativePoint="TOPRIGHT"><Offset><AbsDimension x="20" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
<FontString name="$parentColumn5" inherits="GameFontHighlight" wraponspaces="false" justifyH="LEFT">
|
||||
<Size>
|
||||
<AbsDimension x="100" y="16"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parentColumn4" relativePoint="TOPRIGHT">
|
||||
<Offset>
|
||||
<AbsDimension x="20" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Size><AbsDimension x="100" y="16"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn4" relativePoint="TOPRIGHT"><Offset><AbsDimension x="20" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
<FontString name="$parentColumn6" inherits="GameFontHighlight" wraponspaces="false" justifyH="RIGHT">
|
||||
<Size>
|
||||
<AbsDimension x="100" y="16"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parentColumn5" relativePoint="TOPRIGHT">
|
||||
<Offset>
|
||||
<AbsDimension x="20" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Size><AbsDimension x="100" y="16"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn5" relativePoint="TOPRIGHT"><Offset><AbsDimension x="20" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
</Layer>
|
||||
</Layers>
|
||||
<Frames>
|
||||
<Frame name="$parentColumn3MoneyFrame" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors>
|
||||
<Anchor point="TOPRIGHT" relativeTo="$parentColumn3" relativePoint="TOPRIGHT">
|
||||
<Offset>
|
||||
<AbsDimension x="10" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Frame name="$parentColumn1MoneyFrame" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn1" relativePoint="TOPRIGHT"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad();
|
||||
MoneyFrame_SetType("AUCTIONEER");
|
||||
SmallMoneyFrame_OnLoad()
|
||||
MoneyFrame_SetType("AUX_LIST")
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentColumn2MoneyFrame" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn2" relativePoint="TOPRIGHT"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
MoneyFrame_SetType("AUX_LIST")
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentColumn3MoneyFrame" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn3" relativePoint="TOPRIGHT"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
MoneyFrame_SetType("AUX_LIST")
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentColumn4MoneyFrame" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors>
|
||||
<Anchor point="TOPRIGHT" relativeTo="$parentColumn4" relativePoint="TOPRIGHT">
|
||||
<Offset>
|
||||
<AbsDimension x="10" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn4" relativePoint="TOPRIGHT"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad();
|
||||
MoneyFrame_SetType("AUCTIONEER");
|
||||
SmallMoneyFrame_OnLoad()
|
||||
MoneyFrame_SetType("AUX_LIST")
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentColumn5MoneyFrame" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors>
|
||||
<Anchor point="TOPRIGHT" relativeTo="$parentColumn5" relativePoint="TOPRIGHT">
|
||||
<Offset>
|
||||
<AbsDimension x="10" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn5" relativePoint="TOPRIGHT"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad();
|
||||
MoneyFrame_SetType("AUCTIONEER");
|
||||
SmallMoneyFrame_OnLoad()
|
||||
MoneyFrame_SetType("AUX_LIST")
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentColumn6MoneyFrame" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors>
|
||||
<Anchor point="TOPRIGHT" relativeTo="$parentColumn6" relativePoint="TOPRIGHT">
|
||||
<Offset>
|
||||
<AbsDimension x="10" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn6" relativePoint="TOPRIGHT"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad();
|
||||
MoneyFrame_SetType("AUCTIONEER");
|
||||
SmallMoneyFrame_OnLoad()
|
||||
MoneyFrame_SetType("AUX_LIST")
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Button> -->
|
||||
</Button>
|
||||
|
||||
<Button name="ListSortButtonTemplate" virtual="true">
|
||||
<Layers>
|
||||
@@ -234,7 +178,7 @@
|
||||
<Frame name="$parentColumn1DropDown" inherits="UIDropDownMenuTemplate" id="1"><Anchors><Anchor point="LEFT" relativeTo="$parentColumn1Sort" relativePoint="LEFT"><Offset><AbsDimension x="-14" y="-3"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
Aux.list.dropdown_onload()
|
||||
Aux.list.dropdown_on_load()
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
@@ -248,30 +192,15 @@
|
||||
</Scripts>
|
||||
</Button>
|
||||
<Frame name="$parentColumn2DropDown" inherits="UIDropDownMenuTemplate" id="2">
|
||||
<Anchors>
|
||||
<Anchor point="LEFT" relativeTo="$parentColumn2Sort" relativePoint="LEFT">
|
||||
<Offset>
|
||||
<AbsDimension x="-14" y="-3"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Anchors><Anchor point="LEFT" relativeTo="$parentColumn2Sort" relativePoint="LEFT"><Offset><AbsDimension x="-14" y="-3"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
Aux.list.dropdown_onload()
|
||||
Aux.list.dropdown_on_load()
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Button name="$parentColumn3Sort" inherits="ListSortButtonTemplate">
|
||||
<Size>
|
||||
<AbsDimension x="174" y="24"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="LEFT" relativeTo="$parentColumn2Sort" relativePoint="RIGHT">
|
||||
<Offset>
|
||||
<AbsDimension x="-2" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Size><AbsDimension x="174" y="24"/></Size><Anchors><Anchor point="LEFT" relativeTo="$parentColumn2Sort" relativePoint="RIGHT"><Offset><AbsDimension x="-2" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Aux.list.sort(this:GetParent(), 3)
|
||||
@@ -288,7 +217,7 @@
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
Aux.list.dropdown_onload()
|
||||
Aux.list.dropdown_on_load()
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
@@ -319,7 +248,7 @@
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
Aux.list.dropdown_onload()
|
||||
Aux.list.dropdown_on_load()
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
@@ -350,7 +279,7 @@
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
Aux.list.dropdown_onload()
|
||||
Aux.list.dropdown_on_load()
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
@@ -381,11 +310,11 @@
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
Aux.list.dropdown_onload()
|
||||
Aux.list.dropdown_on_load()
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<!-- <ScrollFrame name="$parentScrollFrame" inherits="FauxScrollFrameTemplate">
|
||||
<ScrollFrame name="$parentScrollFrame" inherits="FauxScrollFrameTemplate">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT">
|
||||
<Offset>
|
||||
@@ -430,10 +359,10 @@
|
||||
</Layers>
|
||||
<Scripts>
|
||||
<OnVerticalScroll>
|
||||
FauxScrollFrame_OnVerticalScroll(16, ListTemplateScrollFrame_Update)
|
||||
FauxScrollFrame_OnVerticalScroll(16, Aux.list.scroll_frame_update)
|
||||
</OnVerticalScroll>
|
||||
</Scripts>
|
||||
</ScrollFrame> -->
|
||||
</ScrollFrame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
</Ui>
|
||||
@@ -2,110 +2,77 @@ Aux.scan = {}
|
||||
|
||||
local AUCTIONS_PER_PAGE = 50
|
||||
|
||||
|
||||
local controller = (function()
|
||||
local controller
|
||||
return function()
|
||||
controller = controller or Aux.control.controller()
|
||||
return controller
|
||||
end
|
||||
end)()
|
||||
|
||||
local state, abort, new_job
|
||||
|
||||
-- forward declaration of local functions
|
||||
local wait, wait_after, wait_for_function, wait_until, listen_for_event
|
||||
local wait_for_callback, wait_for_results, wait_for_update
|
||||
local scan, scan_auctions, scan_auctions_helper, submit_query
|
||||
|
||||
|
||||
|
||||
function Aux.scan.on_update()
|
||||
if abort then
|
||||
if state and state.job and state.job.on_abort then
|
||||
state.job.on_abort()
|
||||
end
|
||||
state = nil
|
||||
abort = false
|
||||
elseif new_job then
|
||||
state = {
|
||||
job = new_job,
|
||||
page = new_job.page
|
||||
}
|
||||
new_job = nil
|
||||
scan()
|
||||
elseif state and state.ready and state.ready() then
|
||||
state.ready = nil
|
||||
state.continuation()
|
||||
end
|
||||
end
|
||||
|
||||
function Aux.scan.start(job)
|
||||
abort = true
|
||||
new_job = job
|
||||
Aux.scan.abort(function() --;
|
||||
wait_for_update(function() --;
|
||||
state = {
|
||||
job = job,
|
||||
page = job.page
|
||||
}
|
||||
return scan()
|
||||
end)end)
|
||||
end
|
||||
|
||||
function Aux.scan.abort()
|
||||
abort = true
|
||||
function Aux.scan.abort(k)
|
||||
wait_for_update(function() --;
|
||||
if state and state.job and state.job.on_abort then
|
||||
state.job.on_abort()
|
||||
end
|
||||
state = nil
|
||||
|
||||
if k then
|
||||
return k()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
|
||||
function wait(timeout, k)
|
||||
state.continuation = k
|
||||
local start_time = GetTime()
|
||||
state.ready = function()
|
||||
return GetTime() - start_time >= timeout
|
||||
end
|
||||
function wait_for_results(k)
|
||||
local ok
|
||||
Aux.control.on_next_event('AUCTION_ITEM_LIST_UPDATE', function()
|
||||
ok = true
|
||||
end)
|
||||
|
||||
return controller().wait(function() return ok end, k)
|
||||
end
|
||||
|
||||
function wait_from()
|
||||
local from
|
||||
return function()
|
||||
from = GetTime()
|
||||
end,
|
||||
function(timeout, k)
|
||||
state.continuation = k
|
||||
state.ready = function()
|
||||
return from and GetTime() - from >= timeout
|
||||
end
|
||||
end
|
||||
function wait_for_update(k)
|
||||
return controller().wait(function() return true end, k)
|
||||
end
|
||||
|
||||
function listen_for_event(e)
|
||||
local occurred
|
||||
Aux.scan.on_event = function()
|
||||
if event == e then
|
||||
occurred = true
|
||||
end
|
||||
end
|
||||
return function(k)
|
||||
state.continuation = k
|
||||
state.ready = function()
|
||||
return occurred
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function wait_for_function(f, args, k)
|
||||
state.continuation = k
|
||||
local complete
|
||||
state.ready = function()
|
||||
return complete
|
||||
end
|
||||
function wait_for_callback(f, args, k)
|
||||
local ok
|
||||
|
||||
if not f then
|
||||
complete = true
|
||||
ok = true
|
||||
else
|
||||
tinsert(args, 1, function() complete = true end)
|
||||
tinsert(args, 1, function() ok = true end)
|
||||
f(unpack(args))
|
||||
end
|
||||
end
|
||||
|
||||
function wait_until(p, k)
|
||||
state.continuation = k
|
||||
state.ready = function()
|
||||
return p()
|
||||
end
|
||||
return controller().wait(function() return ok end, k)
|
||||
end
|
||||
|
||||
|
||||
|
||||
function scan()
|
||||
|
||||
wait_for_function(state.job.on_start_page, {state.page}, function() --;
|
||||
|
||||
submit_query(function() --;
|
||||
|
||||
@@ -123,17 +90,18 @@ function scan()
|
||||
if state.job.on_complete then
|
||||
state.job.on_complete()
|
||||
end
|
||||
state = nil
|
||||
end
|
||||
|
||||
end)end)end)
|
||||
end)end)
|
||||
end
|
||||
|
||||
function scan_auctions(count, k)
|
||||
scan_auctions_helper(1, count, k)
|
||||
return scan_auctions_helper(1, count, k)
|
||||
end
|
||||
|
||||
function scan_auctions_helper(i, n, k)
|
||||
wait_for_function(state.job.on_read_auction, {i}, function() --;
|
||||
wait_for_callback(state.job.on_read_auction, {i}, function() --;
|
||||
|
||||
if i >= n then
|
||||
return k()
|
||||
@@ -146,8 +114,9 @@ end
|
||||
|
||||
function submit_query(k)
|
||||
if state.page then
|
||||
wait_until(CanSendAuctionQuery, function() --;
|
||||
local wait_for_event = listen_for_event('AUCTION_ITEM_LIST_UPDATE')
|
||||
wait_for_callback(state.job.on_start_page, {state.page}, function() --;
|
||||
controller().wait(CanSendAuctionQuery, function() --;
|
||||
wait_for_results(k)
|
||||
QueryAuctionItems(
|
||||
state.job.query.name,
|
||||
state.job.query.min_level,
|
||||
@@ -159,10 +128,8 @@ function submit_query(k)
|
||||
state.job.query.usable,
|
||||
state.job.query.quality
|
||||
)
|
||||
wait_for_event(k)
|
||||
|
||||
end)
|
||||
end)end)
|
||||
else
|
||||
k()
|
||||
return k()
|
||||
end
|
||||
end
|
||||
@@ -1,19 +1,5 @@
|
||||
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
|
||||
|
||||
<Script file="scan.lua"/>
|
||||
|
||||
<!-- Frame to handle all core events -->
|
||||
<Frame>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
this:RegisterEvent("AUCTION_ITEM_LIST_UPDATE")
|
||||
</OnLoad>
|
||||
<OnEvent>
|
||||
Aux.scan.on_event()
|
||||
</OnEvent>
|
||||
<OnUpdate>
|
||||
Aux.scan.on_update()
|
||||
</OnUpdate>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
|
||||
</Ui>
|
||||
@@ -525,7 +525,7 @@ end
|
||||
-----------------------------------------
|
||||
|
||||
function report(item_name, stack_size, buyout_price, posted)
|
||||
AuxBuyReportHTML:SetText(string.format(
|
||||
AuxSellReportHTML:SetText(string.format(
|
||||
[[
|
||||
<html>
|
||||
<body>
|
||||
@@ -547,7 +547,7 @@ function report(item_name, stack_size, buyout_price, posted)
|
||||
Aux.util.format_money(buyout_price)
|
||||
))
|
||||
|
||||
AuxBuyReportHTML:SetSpacing(3)
|
||||
AuxSellReportHTML:SetSpacing(3)
|
||||
|
||||
AuxBuyReport:Show()
|
||||
AuxSellReport:Show()
|
||||
end
|
||||
|
||||
@@ -463,6 +463,35 @@
|
||||
</EditBox>
|
||||
</frames>
|
||||
</frame>
|
||||
<Frame name="AuxSellReport" frameStrata="FULLSCREEN_DIALOG" toplevel="true" parent="UIParent" enableMouse="true" hidden="true">
|
||||
<Size><AbsDimension x="400" y="180" /></Size>
|
||||
<Anchors><Anchor point="TOP"><Offset><AbsDimension x="0" y="-90"/></Offset></Anchor></Anchors>
|
||||
|
||||
<Backdrop bgFile="Interface\CharacterFrame\UI-Party-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
|
||||
<BackgroundInsets><AbsInset left="11" right="12" top="12" bottom="11"/></BackgroundInsets>
|
||||
<TileSize><AbsValue val="32"/></TileSize>
|
||||
<EdgeSize><AbsValue val="32"/></EdgeSize>
|
||||
</Backdrop>
|
||||
|
||||
<Frames>
|
||||
<SimpleHTML name="AuxSellReportHTML">
|
||||
<Size><AbsDimension x="420" y="1" /></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="30" y="-30"/></Offset></Anchor></Anchors>
|
||||
<FontString inherits="GameFontHighlightSmall"/>
|
||||
<FontStringHeader1 inherits="GameFontNormal"/>
|
||||
</SimpleHTML>
|
||||
|
||||
<Button inherits="UIPanelButtonTemplate" text="Close">
|
||||
<Size><AbsDimension x="100" y="22"/> </Size>
|
||||
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-20" y="15"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
AuxSellReport:Hide()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
</Frames>
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
</Ui>
|
||||
@@ -1,5 +1,11 @@
|
||||
Aux.util = {}
|
||||
|
||||
Aux.util.LT = {}
|
||||
Aux.util.EQ = {}
|
||||
Aux.util.GT = {}
|
||||
|
||||
local merge, copy_array
|
||||
|
||||
function Aux.util.iter(array)
|
||||
local with_index = ipairs(array)
|
||||
return function()
|
||||
@@ -83,4 +89,78 @@ function Aux.util.all(xs, p)
|
||||
holds = holds and p(x)
|
||||
end
|
||||
return holds
|
||||
end
|
||||
|
||||
function Aux.util.set_filter(set, p)
|
||||
filtered = {}
|
||||
for x, _ in pairs(set) do
|
||||
if p(x) then
|
||||
Aux.util.set_add(filtered, x)
|
||||
end
|
||||
end
|
||||
return filtered
|
||||
end
|
||||
|
||||
function Aux.util.merge_sort(A, comp)
|
||||
local n = getn(A)
|
||||
local B = {}
|
||||
|
||||
local width = 1
|
||||
while width <= n do
|
||||
|
||||
for i=1, n, 2 * width do
|
||||
merge(A, i, min(i + width, n), min(i + 2 * width - 1, n), B, comp)
|
||||
end
|
||||
|
||||
copy_array(B, A, n)
|
||||
|
||||
width = 2 * width
|
||||
end
|
||||
end
|
||||
|
||||
function merge(A, start1, start2, last, B, comp)
|
||||
local i1 = start1
|
||||
local i2 = start2
|
||||
|
||||
for i=start1,last do
|
||||
if i1 < start2 and (i2 > last or comp(A[i1], A[i2]) == Aux.util.LT or comp(A[i1], A[i2]) == Aux.util.EQ) then
|
||||
B[i] = A[i1]
|
||||
i1 = i1 + 1
|
||||
else
|
||||
B[i] = A[i2]
|
||||
i2 = i2 + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function copy_array(A, B, n)
|
||||
for i=1,n do
|
||||
B[i] = A[i]
|
||||
end
|
||||
end
|
||||
|
||||
function Aux.util.invert_order(ordering)
|
||||
if ordering == Aux.util.LT then
|
||||
return Aux.util.GT
|
||||
elseif ordering == Aux.util.GT then
|
||||
return Aux.util.LT
|
||||
else
|
||||
return Aux.util.EQ
|
||||
end
|
||||
end
|
||||
|
||||
function Aux.util.compare(a, b, nil_ordering)
|
||||
if not a and b then
|
||||
return nil_ordering
|
||||
elseif a and not b then
|
||||
return Aux.util.invert_order(nil_ordering)
|
||||
elseif not a and not b then
|
||||
return Aux.util.EQ
|
||||
elseif a < b then
|
||||
return Aux.util.LT
|
||||
elseif a > b then
|
||||
return Aux.util.GT
|
||||
else
|
||||
return Aux.util.EQ
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user