improved buy dialogs
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
Aux.buy = {}
|
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_buyout_dialog, show_bid_dialog
|
||||||
local entries
|
local entries
|
||||||
local selectedEntries = {}
|
local selectedEntries = {}
|
||||||
local search_query
|
local search_query
|
||||||
@@ -77,19 +77,8 @@ function Aux.buy.SearchButton_onclick()
|
|||||||
on_read_auction = function(k, i)
|
on_read_auction = function(k, i)
|
||||||
local auction_item = Aux.info.auction_item(i)
|
local auction_item = Aux.info.auction_item(i)
|
||||||
if auction_item then
|
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
|
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(
|
process_auction(auction_item, current_page)
|
||||||
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
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
k()
|
k()
|
||||||
@@ -138,11 +127,11 @@ function show_buyout_dialog(hyperlink, stack_size, buyout_price)
|
|||||||
hyperlink,
|
hyperlink,
|
||||||
stack_size
|
stack_size
|
||||||
))
|
))
|
||||||
--MoneyFrame_Update('AuxBuyBuyoutDialogBuyoutPrice', Aux_Round(buyout_price))
|
MoneyFrame_Update('AuxBuyBuyoutDialogBuyoutPrice', buyout_price)
|
||||||
AuxBuyBuyoutDialog:Show()
|
AuxBuyBuyoutDialog:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
function show_bid_dialog(hyperlink, stack_size, bid)
|
function show_bid_dialog(hyperlink, stack_size, highest_bid, min_increment)
|
||||||
AuxBuyBidDialogBidButton:Disable()
|
AuxBuyBidDialogBidButton:Disable()
|
||||||
AuxBuyBidDialogHTML:SetFontObject('h1', GameFontWhite)
|
AuxBuyBidDialogHTML:SetFontObject('h1', GameFontWhite)
|
||||||
AuxBuyBidDialogHTML:SetScript('OnHyperlinkClick', function() SetItemRef(arg1) end)
|
AuxBuyBidDialogHTML:SetScript('OnHyperlinkClick', function() SetItemRef(arg1) end)
|
||||||
@@ -158,7 +147,8 @@ function show_bid_dialog(hyperlink, stack_size, bid)
|
|||||||
stack_size
|
stack_size
|
||||||
))
|
))
|
||||||
AuxBuyBidDialog:Show()
|
AuxBuyBidDialog:Show()
|
||||||
MoneyInputFrame_SetCopper(AuxBuyBidDialogBid, 5)
|
MoneyFrame_Update('AuxBuyBuyoutDialogBuyoutPrice', buyout_price)
|
||||||
|
MoneyInputFrame_SetCopper(AuxBuyBidDialogBid, highest_bid + min_increment)
|
||||||
end
|
end
|
||||||
|
|
||||||
function AuxBuyEntry_OnClick()
|
function AuxBuyEntry_OnClick()
|
||||||
@@ -266,24 +256,23 @@ 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 {}
|
entries = entries or {}
|
||||||
|
|
||||||
if buyout_price > 0 and owner ~= UnitName("player") then
|
local stack_size = auction_item.charges or auction_item.count
|
||||||
|
if auction_item.buyout_price > 0 and auction_item.owner ~= UnitName("player") then
|
||||||
tinsert(entries, {
|
tinsert(entries, {
|
||||||
name = name,
|
name = auction_item.name,
|
||||||
tooltip = tooltip,
|
tooltip = auction_item.tooltip,
|
||||||
stack_size = stack_size,
|
stack_size = stack_size,
|
||||||
buyout_price = buyout_price,
|
buyout_price = auction_item.buyout_price,
|
||||||
item_price = buyout_price / stack_size,
|
unit_price = Aux_Round(auction_item.buyout_price / stack_size),
|
||||||
quality = quality,
|
quality = auction_item.quality,
|
||||||
hyperlink = hyperlink,
|
hyperlink = auction_item.hyperlink,
|
||||||
itemstring = itemstring,
|
itemstring = auction_item.itemstring,
|
||||||
page = current_page,
|
page = current_page,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
table.sort(entries, function(a,b) return a.item_price < b.item_price end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
@@ -298,6 +287,10 @@ end
|
|||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|
||||||
function Aux_Buy_ScrollbarUpdate()
|
function Aux_Buy_ScrollbarUpdate()
|
||||||
|
if entries then
|
||||||
|
table.sort(entries, function(a,b) return a.unit_price < b.unit_price end)
|
||||||
|
end
|
||||||
|
|
||||||
if entries and getn(entries) == 0 then
|
if entries and getn(entries) == 0 then
|
||||||
set_message("No auctions were found")
|
set_message("No auctions were found")
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -373,7 +373,7 @@
|
|||||||
<Button name="AuxBuyEntry19" inherits="AuxBuyEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuxBuyEntry18" 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">
|
<Frame name="AuxBuyBuyoutDialog" frameStrata="FULLSCREEN_DIALOG" toplevel="true" enableMouse="true" hidden="true" movable="true">
|
||||||
<Size><AbsDimension x="260" y="160" /></Size>
|
<Size><AbsDimension x="230" y="140" /></Size>
|
||||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="300" y="-150"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="300" y="-150"/></Offset></Anchor></Anchors>
|
||||||
|
|
||||||
<Scripts>
|
<Scripts>
|
||||||
@@ -388,30 +388,21 @@
|
|||||||
</Backdrop>
|
</Backdrop>
|
||||||
<Frames>
|
<Frames>
|
||||||
<SimpleHTML name="$parentHTML">
|
<SimpleHTML name="$parentHTML">
|
||||||
<Size><AbsDimension x="260" y="160" /></Size>
|
<Size><AbsDimension x="200" y="110" /></Size>
|
||||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="30" y="-30"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="30" y="-30"/></Offset></Anchor></Anchors>
|
||||||
<FontStringHeader1 inherits="GameFontNormalWhite"/>
|
<FontStringHeader1 inherits="GameFontNormalWhite"/>
|
||||||
</SimpleHTML>
|
</SimpleHTML>
|
||||||
<Frame>
|
<Frame name="$parentBuyoutPrice" inherits="SmallMoneyFrameTemplate">
|
||||||
<Frame>
|
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="30" y="-60"/></Offset></Anchor></Anchors>
|
||||||
<Size><AbsDimension x="120" y="16" /></Size>
|
<Scripts>
|
||||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="30" y="-70"/></Offset></Anchor></Anchors>
|
<OnLoad>
|
||||||
<Frames>
|
SmallMoneyFrame_OnLoad()
|
||||||
<Frame name="$parentBuyoutPrice" inherits="SmallMoneyFrameTemplate">
|
MoneyFrame_SetType("STATIC")
|
||||||
<Anchors><Anchor point="RIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
</OnLoad>
|
||||||
<Scripts>
|
</Scripts>
|
||||||
<OnLoad>
|
|
||||||
SmallMoneyFrame_OnLoad()
|
|
||||||
MoneyFrame_SetType("STATIC")
|
|
||||||
snipe.log('kek'..this:GetName())
|
|
||||||
</OnLoad>
|
|
||||||
</Scripts>
|
|
||||||
</Frame>
|
|
||||||
</Frames>
|
|
||||||
</Frame>
|
|
||||||
</Frame>
|
</Frame>
|
||||||
<Button name="$parentBuyButton" inherits="UIPanelButtonTemplate" text="Buy" disabled="true">
|
<Button name="$parentBuyButton" inherits="UIPanelButtonTemplate" text="Buy" disabled="true">
|
||||||
<Size><AbsDimension x="100" y="22"/> </Size>
|
<Size><AbsDimension x="85" y="22"/> </Size>
|
||||||
<Anchors><Anchor point="BOTTOMLEFT"><Offset><AbsDimension x="20" y="15"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="BOTTOMLEFT"><Offset><AbsDimension x="20" y="15"/></Offset></Anchor></Anchors>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
@@ -420,7 +411,7 @@
|
|||||||
</Scripts>
|
</Scripts>
|
||||||
</Button>
|
</Button>
|
||||||
<Button name="$parentCancelButton" inherits="UIPanelButtonTemplate" text="Cancel">
|
<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>
|
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-20" y="15"/></Offset></Anchor></Anchors>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
@@ -433,8 +424,8 @@
|
|||||||
|
|
||||||
<Frame name="AuxBuyBidDialog" frameStrata="FULLSCREEN_DIALOG" toplevel="true" enableMouse="true" hidden="true" movable="true">
|
<Frame name="AuxBuyBidDialog" frameStrata="FULLSCREEN_DIALOG" toplevel="true" enableMouse="true" hidden="true" movable="true">
|
||||||
|
|
||||||
<Size><AbsDimension x="260" y="160" /></Size>
|
<Size><AbsDimension x="230" y="170" /></Size>
|
||||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="300" y="-150"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="300" y="-135"/></Offset></Anchor></Anchors>
|
||||||
|
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>this:RegisterForDrag("LeftButton")</OnLoad>
|
<OnLoad>this:RegisterForDrag("LeftButton")</OnLoad>
|
||||||
@@ -449,14 +440,23 @@
|
|||||||
|
|
||||||
<Frames>
|
<Frames>
|
||||||
<SimpleHTML name="$parentHTML">
|
<SimpleHTML name="$parentHTML">
|
||||||
<Size><AbsDimension x="260" y="160" /></Size>
|
<Size><AbsDimension x="200" y="110" /></Size>
|
||||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="30" y="-30"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="30" y="-30"/></Offset></Anchor></Anchors>
|
||||||
</SimpleHTML>
|
</SimpleHTML>
|
||||||
|
<Frame name="$parentHighestBid" 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>
|
||||||
<Frame name="$parentBid" inherits="MoneyInputFrameTemplate">
|
<Frame name="$parentBid" inherits="MoneyInputFrameTemplate">
|
||||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="30" y="-70"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="35" y="-88"/></Offset></Anchor></Anchors>
|
||||||
</Frame>
|
</Frame>
|
||||||
<Button name="$parentBidButton" inherits="UIPanelButtonTemplate" text="Bid" disabled="true">
|
<Button name="$parentBidButton" inherits="UIPanelButtonTemplate" text="Bid" disabled="true">
|
||||||
<Size><AbsDimension x="100" y="22"/> </Size>
|
<Size><AbsDimension x="85" y="22"/> </Size>
|
||||||
<Anchors><Anchor point="BOTTOMLEFT"><Offset><AbsDimension x="20" y="15"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="BOTTOMLEFT"><Offset><AbsDimension x="20" y="15"/></Offset></Anchor></Anchors>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
@@ -465,7 +465,7 @@
|
|||||||
</Scripts>
|
</Scripts>
|
||||||
</Button>
|
</Button>
|
||||||
<Button name="$parentCancelButton" inherits="UIPanelButtonTemplate" text="Cancel">
|
<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>
|
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-20" y="15"/></Offset></Anchor></Anchors>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
|
|||||||
Reference in New Issue
Block a user