finished redesign of buy

This commit is contained in:
Manuel Simon Hirsig
2015-10-15 01:00:20 +02:00
parent 1769a29f45
commit 9e17511e4c
7 changed files with 259 additions and 296 deletions
+38 -33
View File
@@ -27,7 +27,7 @@ end
function Aux.buy.dialog_cancel()
Aux.scan.abort()
AuxBuyDialog:Hide()
AuxBuyConfirmation:Hide()
AuxBuyList:Show()
AuxBuySearchButton:Enable()
end
@@ -59,6 +59,8 @@ function Aux.buy.SearchButton_onclick()
search_query = {
name = AuxBuyNameInputBox:GetText(),
min_level = AuxBuyMinLevel:GetText(),
max_level = AuxBuyMaxLevel:GetText(),
slot = category and category.slot,
class = category and category.class,
subclass = category and category.subclass,
@@ -70,8 +72,10 @@ function Aux.buy.SearchButton_onclick()
Aux.scan.start{
query = search_query,
page = 0,
on_start_page = function(ok, page, total_pages)
on_page_update = function(page)
current_page = page
end,
on_start_page = function(ok, page, total_pages)
set_message('Scanning auctions: page ' .. page + 1 .. (total_pages and ' out of ' .. total_pages or '') .. ' ...')
return ok()
end,
@@ -124,34 +128,34 @@ end
-----------------------------------------
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>
<h1>%s x %i</h1>
</body>
</html>
]],
hyperlink,
stack_size
))
if buyout_mode then
AuxBuyDialogActionButton:SetText('Buy')
MoneyFrame_Update('AuxBuyDialogBuyoutPrice', amount)
AuxBuyDialogBid:Hide()
AuxBuyDialogBuyoutPrice:Show()
function show_dialog(buyout_mode, name, texture, quality, tooltip, stack_size, amount)
AuxBuyConfirmation.tooltip = tooltip
AuxBuyConfirmationActionButton:Disable()
AuxBuyConfirmationItem:SetNormalTexture(texture)
AuxBuyConfirmationItemName:SetText(name)
local color = ITEM_QUALITY_COLORS[quality]
AuxBuyConfirmationItemName:SetTextColor(color.r, color.g, color.b)
if stack_size > 1 then
AuxBuyConfirmationItemCount:SetText(stack_size);
AuxBuyConfirmationItemCount:Show()
else
AuxBuyDialogActionButton:SetText('Bid')
MoneyInputFrame_SetCopper(AuxBuyDialogBid, amount)
AuxBuyDialogBuyoutPrice:Hide()
AuxBuyDialogBid:Show()
AuxBuyConfirmationItemCount:Hide()
end
if buyout_mode then
AuxBuyConfirmationActionButton:SetText('Buy')
MoneyFrame_Update('AuxBuyConfirmationBuyoutPrice', amount)
AuxBuyConfirmationBid:Hide()
AuxBuyConfirmationBuyoutPrice:Show()
else
AuxBuyConfirmationActionButton:SetText('Bid')
MoneyInputFrame_SetCopper(AuxBuyConfirmationBid, amount)
AuxBuyConfirmationBuyoutPrice:Hide()
AuxBuyConfirmationBid:Show()
end
AuxBuyList:Hide()
AuxBuyDialog:Show()
AuxBuyConfirmation:Show()
end
-----------------------------------------
@@ -182,7 +186,7 @@ function AuxBuyEntry_OnClick(entry_index)
end
if not express_mode then
show_dialog(buyout_mode, entry.hyperlink, entry.stack_size, amount)
show_dialog(buyout_mode, entry.name, entry.texture, entry.quality, entry.tooltip, entry.stack_size, amount)
end
PlaySound("igMainMenuOptionCheckBoxOn")
@@ -193,9 +197,8 @@ function AuxBuyEntry_OnClick(entry_index)
Aux.scan.start{
query = search_query,
page = entry.page ~= current_page and entry.page,
on_start_page = function(ok, page)
on_page_update = function(page)
current_page = page
return ok()
end,
on_read_auction = function(ok, i)
local auction_item = Aux.info.auction_item(i)
@@ -239,9 +242,10 @@ function AuxBuyEntry_OnClick(entry_index)
Aux.scan.abort()
AuxBuySearchButton:Enable()
AuxBuyDialog:Hide()
AuxBuyConfirmation:Hide()
AuxBuyList:Show()
end
AuxBuyDialogActionButton:Enable()
AuxBuyConfirmationActionButton:Enable()
end
else
return ok()
@@ -275,7 +279,7 @@ function Aux.buy.icon_on_enter()
local index = this:GetParent():GetID() + FauxScrollFrame_GetOffset(scroll_frame)
local entry = entries[index]
Aux.info.set_game_tooltip(this, entry.tooltip)
Aux.info.set_game_tooltip(this, entry.tooltip, 'ANCHOR_RIGHT')
if(EnhTooltip ~= nil) then
EnhTooltip.TooltipCall(GameTooltip, entry.name, entry.hyperlink, entry.quality, entry.stack_size)
@@ -309,6 +313,7 @@ function process_auction(auction_item, current_page)
bid_per_unit = Aux_Round(bid/stack_size),
owner = auction_item.owner,
duration = auction_item.duration,
usable = auction_item.usable,
})
end
end
+178 -87
View File
@@ -49,8 +49,19 @@
<Anchors><Anchor point="TOP"><Offset><AbsDimension x="20" y="-18"/></Offset></Anchor></Anchors>
</FontString>
<FontString name="AuxBuyMessage" inherits="GameFontNormal">
<Anchors><Anchor point="TOP"><Offset><AbsDimension x="70" y="-120"/></Offset></Anchor></Anchors>
<FontString name="AuxBuyMessage" inherits="GameFontWhite">
<Anchors><Anchor point="TOP"><Offset><AbsDimension x="145" y="-150"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
<Layer level="ARTWORK">
<FontString inherits="GameFontHighlightSmall" text="Filters">
<Anchors>
<Anchor point="TOP" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="85" y="-85"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
@@ -74,14 +85,8 @@
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString inherits="GameFontHighlightSmall" text="Name">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="-3" y="9"/>
</Offset>
</Anchor>
</Anchors>
<FontString inherits="GameFontHighlightSmall" text="Name" justifyH="LEFT">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-3" y="9"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
</Layers>
@@ -108,14 +113,8 @@
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="123" y="0" /></Offset></Anchor></Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString inherits="GameFontHighlightSmall" text="Exact">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="9"/>
</Offset>
</Anchor>
</Anchors>
<FontString inherits="GameFontHighlightSmall" text="Exact" justifyH="LEFT">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="9"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
</Layers>
@@ -125,14 +124,8 @@
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-23" y="-30" /></Offset></Anchor></Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString inherits="GameFontHighlightSmall" text="Category">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="20" y="8"/>
</Offset>
</Anchor>
</Anchors>
<FontString inherits="GameFontHighlightSmall" text="Category" justifyH="LEFT">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="20" y="8"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
</Layers>
@@ -146,20 +139,67 @@
</OnShow>
</Scripts>
</Frame>
<CheckButton name="AuxBuyUsableCheckButton" inherits="UICheckButtonTemplate">
<Size><AbsDimension x="22" y="22"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="-65" /></Offset></Anchor></Anchors>
<Frame name="AuxBuyQualityDropDown" inherits="UIDropDownMenuTemplate">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-23" y="-65" /></Offset></Anchor></Anchors>
<Scripts>
<OnLoad>
UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize)
</OnLoad>
<OnShow>
UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize)
</OnShow>
</Scripts>
<Layers>
<Layer level="OVERLAY">
<FontString inherits="GameFontHighlightSmall" text="Usable">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="9"/>
</Offset>
</Anchor>
</Anchors>
<FontString inherits="GameFontHighlightSmall" text="Rarity" justifyH="LEFT">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="20" y="8"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
<EditBox name="AuxBuyMinLevel" letters="2" numeric="true" autoFocus="false" inherits="InputBoxTemplate">
<Size><AbsDimension x="30" y="22"/></Size>
<Anchors>
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="-101"/></Offset></Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<FontString inherits="GameFontHighlightSmall" text="-">
<Anchors><Anchor point="LEFT" relativePoint="RIGHT"><Offset><AbsDimension x="-1" y="0"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
<Layer level="OVERLAY">
<FontString inherits="GameFontHighlightSmall" text="Level Range" justifyH="LEFT">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-3" y="9"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnEnterPressed>
this:ClearFocus();
</OnEnterPressed>
</Scripts>
</EditBox>
<EditBox name="AuxBuyMaxLevel" letters="2" numeric="true" autoFocus="false" inherits="InputBoxTemplate">
<Size><AbsDimension x="30" y="22"/></Size>
<Anchors>
<Anchor point="LEFT" relativeTo="AuxBuyMinLevel" relativePoint="RIGHT"><Offset><AbsDimension x="8" y="0"/></Offset></Anchor>
</Anchors>
<Scripts>
<OnEnterPressed>
this:ClearFocus();
</OnEnterPressed>
</Scripts>
</EditBox>
<CheckButton name="AuxBuyUsableCheckButton" inherits="UICheckButtonTemplate">
<Size><AbsDimension x="22" y="22"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="100" y="-101" /></Offset></Anchor></Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString inherits="GameFontHighlightSmall" text="Usable" justifyH="LEFT">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="9"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
</Layers>
@@ -167,17 +207,11 @@
<EditBox name="AuxBuyTooltipInputBox" autoFocus="false" inherits="InputBoxTemplate">
<Size><AbsDimension x="110" y="22"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="-94"/></Offset></Anchor></Anchors>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="-131"/></Offset></Anchor></Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString inherits="GameFontHighlightSmall" text="Tooltip">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="-3" y="9"/>
</Offset>
</Anchor>
</Anchors>
<FontString inherits="GameFontHighlightSmall" text="Tooltip" justifyH="LEFT">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-3" y="9"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
</Layers>
@@ -223,35 +257,20 @@
</Button>
<Button name="AuxBuyTooltipButton" inherits="UIPanelButtonTemplate" text="+">
<Size><AbsDimension x="22" y="22"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="127" y="-94"/></Offset></Anchor></Anchors>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="127" y="-131"/></Offset></Anchor></Anchors>
<Scripts>
<OnClick>
AuxBuyTooltipButton_OnClick(this)
</OnClick>
</Scripts>
</Button>
<Frame name="AuxBuyQualityDropDown" inherits="UIDropDownMenuTemplate">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="-124" /></Offset></Anchor></Anchors>
<Scripts>
<OnLoad>
UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize)
</OnLoad>
<OnShow>
UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize)
</OnShow>
</Scripts>
</Frame>
</Frames>
</Frame>
<Button name="AuxBuySearchButton" inherits="UIPanelButtonTemplate" text="Search">
<Size><AbsDimension x="166" y="22"/></Size>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="51" y="14"/>
</Offset>
</Anchor>
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="51" y="14"/></Offset></Anchor>
</Anchors>
<Scripts>
<OnClick>
@@ -262,12 +281,7 @@
<Button name="AuxBuyStopButton" inherits="UIPanelButtonTemplate" text="Stop" hidden="true">
<Size><AbsDimension x="166" y="22"/></Size>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="51" y="14"/>
</Offset>
</Anchor>
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="51" y="14"/></Offset></Anchor>
</Anchors>
<Scripts>
<OnClick>
@@ -276,30 +290,104 @@
</Scripts>
</Button>
<Frame name="AuxBuyDialog" hidden="true">
<Size><AbsDimension x="230" y="140" /></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="300" y="-150"/></Offset></Anchor></Anchors>
<Button name="AuxBuyCloseButton" inherits="UIPanelButtonTemplate" text="CLOSE">
<Size>
<AbsDimension x="80" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="130" y="14"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
HideUIPanel(this:GetParent():GetParent());
</OnClick>
</Scripts>
</Button>
<Frame name="AuxBuyConfirmation" hidden="true">
<Size><AbsDimension x="634" y="306"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="188" y="-103"/></Offset></Anchor></Anchors>
<Frames>
<SimpleHTML name="$parentHTML">
<Size><AbsDimension x="170" y="1" wraponspaces="false" /></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="30" y="-30"/></Offset></Anchor></Anchors>
<FontStringHeader1 inherits="GameFontNormalWhite"/>
</SimpleHTML>
<Button name="$parentItem">
<Size><AbsDimension x="54" y="54"/></Size>
<Anchors><Anchor point="TOP"><Offset><AbsDimension x="-102" y="-80"/></Offset></Anchor></Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentName" inherits="GameFontHighlightLarge" justifyH="LEFT">
<Size><AbsDimension x="172" y="46"/></Size>
<Anchors><Anchor point="LEFT"><Offset><AbsDimension x="70" y="0"/></Offset></Anchor></Anchors>
</FontString>
<Texture name="$parentLeft" file="Interface\AuctionFrame\UI-AuctionItemNameFrame">
<Size><AbsDimension x="10" y="54"/></Size>
<Anchors><Anchor point="LEFT" relativePoint="RIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
<TexCoords left="0" right="0.078125" top="0" bottom="1.0"/>
</Texture>
<Texture name="$parentRight" file="Interface\AuctionFrame\UI-AuctionItemNameFrame"><Size><AbsDimension x="10" y="54"/></Size>
<Anchors><Anchor point="RIGHT"><Offset><AbsDimension x="204" y="0"/></Offset></Anchor>
</Anchors>
<TexCoords left="0.75" right="0.828125" top="0" bottom="1.0"/>
</Texture>
<Texture file="Interface\AuctionFrame\UI-AuctionItemNameFrame">
<Size><AbsDimension x="10" y="54"/></Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
<Anchor point="RIGHT" relativeTo="$parentRight" relativePoint="LEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
</Anchors>
<TexCoords left="0.078125" right="0.75" top="0" bottom="1.0"/>
</Texture>
</Layer>
<Layer level="OVERLAY">
<FontString name="$parentCount" inherits="NumberFontNormalLarge" justifyH="RIGHT" hidden="true">
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-9" y="3"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnEnter>
Aux.info.set_game_tooltip(this, this:GetParent().tooltip, 'ANCHOR_LEFT')
</OnEnter>
<OnLeave>
GameTooltip:Hide()
</OnLeave>
</Scripts>
<HighlightTexture alphaMode="ADD" file="Interface\Buttons\ButtonHilight-Square"/>
</Button>
<Frame name="$parentBid" inherits="MoneyInputFrameTemplate">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="35" y="-60"/></Offset></Anchor></Anchors>
<Anchors><Anchor point="BOTTOM"><Offset><AbsDimension x="30" y="115"/></Offset></Anchor></Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString inherits="GameFontNormalLarge" text="Price:" justifyH="RIGHT">
<Anchors><Anchor point="RIGHT" relativePoint="LEFT"><Offset><AbsDimension x="-10" y="0"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
<Frame name="$parentBuyoutPrice" inherits="SmallMoneyFrameTemplate">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="30" y="-60"/></Offset></Anchor></Anchors>
<Frame name="$parentBuyoutPrice" inherits="MoneyFrameTemplate">
<Anchors><Anchor point="BOTTOM"><Offset><AbsDimension x="30" y="108"/></Offset></Anchor></Anchors>
<Scripts>
<OnLoad>
SmallMoneyFrame_OnLoad()
MoneyFrame_OnLoad()
MoneyFrame_SetType("STATIC")
</OnLoad>
</Scripts>
</Frame>
<Layers>
<Layer level="OVERLAY">
<FontString inherits="GameFontNormalLarge" text="Price:" justifyH="RIGHT">
<Anchors><Anchor point="RIGHT" relativePoint="LEFT"><Offset><AbsDimension x="-5" y="0"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
</Layers>
</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>
<Size><AbsDimension x="110" y="30"/> </Size>
<Anchors><Anchor point="BOTTOMLEFT"><Offset><AbsDimension x="190" y="60"/></Offset></Anchor></Anchors>
<NormalText inherits="GameFontNormalLarge"/>
<DisabledText inherits="GameFontDisableLarge"/>
<HighlightText inherits="GameFontHighlightLarge"/>
<Scripts>
<OnClick>
Aux.buy.dialog_action()
@@ -307,8 +395,11 @@
</Scripts>
</Button>
<Button name="$parentCancelButton" inherits="UIPanelButtonTemplate" text="Cancel">
<Size><AbsDimension x="85" y="22"/></Size>
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-20" y="15"/></Offset></Anchor></Anchors>
<Size><AbsDimension x="110" y="30"/></Size>
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-190" y="60"/></Offset></Anchor></Anchors>
<NormalText inherits="GameFontNormalLarge"/>
<DisabledText inherits="GameFontDisableLarge"/>
<HighlightText inherits="GameFontHighlightLarge"/>
<Scripts>
<OnClick>
Aux.buy.dialog_cancel()
+2
View File
@@ -276,6 +276,8 @@ end
function Aux_AddTabs()
AuctionFrameTab1:SetText('Buy')
Aux.tabs.sell.index = AuctionFrame.numTabs + 1
local sellTabName = "AuctionFrameTab"..Aux.tabs.sell.index
-170
View File
@@ -1,170 +0,0 @@
<Button name="$parentColumn2Item">
<Size><AbsDimension x="16" y="16"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn2"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
<Layers>
<Layer level="BORDER">
<Texture name="$parentIconTexture"/>
<FontString name="$parentCount" inherits="NumberFontNormal" justifyH="RIGHT" hidden="true">
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-5" y="2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentStock" inherits="NumberFontNormalYellow" justifyH="LEFT" hidden="true">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<PushedTexture file="Interface\Buttons\UI-Quickslot-Depress"/>
<HighlightTexture file="Interface\Buttons\ButtonHilight-Square" alphaMode="ADD"/>
<Scripts>
<OnEnter>
Aux.buy.icon_on_enter()
</OnEnter>
<OnLeave>
GameTooltip:Hide()
</OnLeave>
<OnClick>
AuxBuyEntry_OnClick(this:GetParent())
</OnClick>
</Scripts>
</Button>
<Frame name="AuxBuyConfirmation" hidden="true">
<Size x="634" y="306"/>
<Anchors>
<Anchor point="TOPLEFT" x="188" y="-103"/>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<FontString parentKey="BuyoutLabel" inherits="GameFontNormalLarge" text="TOKEN_CURRENT_BUYOUT_PRICE" justifyH="RIGHT">
<Anchors>
<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOM" x="-2" y="117"/>
</Anchors>
</FontString>
<FontString parentKey="BuyoutPrice" inherits="NumberFontNormalLarge" justifyH="LEFT">
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOM" x="2" y="117"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button parentKey="Token" name="$parentToken">
<Size x="254" y="61"/>
<Anchors>
<Anchor point="TOP" x="0" y="-63"/>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture parentKey="ItemBorder" atlas="token-itemslot" useAtlasSize="true">
<Anchors>
<Anchor point="TOPLEFT" x="2" y="-2"/>
</Anchors>
</Texture>
</Layer>
<Layer level="BORDER">
<Texture name="$parentIconTexture" parentKey="Icon">
<Size x="54" y="54"/>
<Anchors>
<Anchor point="TOPLEFT" x="3" y="-3"/>
</Anchors>
</Texture>
<FontString name="$parentName" inherits="GameFontHighlightLarge" justifyH="LEFT" parentKey="Name">
<Size x="172" y="46"/>
<Anchors>
<Anchor point="LEFT" x="73" y="0"/>
</Anchors>
</FontString>
</Layer>
<Layer level="ARTWORK">
<FontString name="$parentCount" inherits="NumberFontNormal" justifyH="RIGHT" parentKey="Count">
<Anchors>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentIconTexture" x="-1" y="1"/>
</Anchors>
</FontString>
</Layer>
<Layer level="OVERLAY">
<Texture parentKey="IconBorder" file="Interface\Common\WhiteIconFrame">
<Size x="54" y="54"/>
<Anchors>
<Anchor point="TOPLEFT" x="3" y="-3"/>
</Anchors>
<Color r="0" g="0.8" b="1"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_LEFT",5,-5);
GameTooltip:SetItemByID(122284);
GameTooltip:Show();
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
</Button>
<Button parentKey="Buyout" inherits="UIPanelButtonTemplate" text="BUYOUT" motionScriptsWhileDisabled="true">
<Size x="140" y="30"/>
<Anchors>
<Anchor point="TOP" relativeKey="$parent.Token" relativePoint="BOTTOM" x="0" y="-87"/>
</Anchors>
<Scripts>
<OnClick function="BrowseWowTokenResultsBuyout_OnClick"/>
</Scripts>
<NormalFont style="GameFontNormalLarge" />
<HighlightFont style="GameFontHighlightLarge" />
<DisabledFont style="GameFontDisableLarge" />
</Button>
<Frame parentKey="InvisiblePriceFrame" enableMouse="true">
<Anchors>
<Anchor point="TOPLEFT" relativeKey="$parent.BuyoutPrice" relativePoint="TOPLEFT"/>
<Anchor point="BOTTOMRIGHT" relativeKey="$parent.BuyoutPrice" relativePoint="BOTTOMRIGHT"/>
</Anchors>
<Scripts>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText(TOKEN_BUYOUT_PRICE_UPDATES, nil, nil, nil, nil, true);
GameTooltip:Show();
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
</Frame>
</Frames>
<Scripts>
<OnEvent function="BrowseWowTokenResults_OnEvent"/>
</Scripts>
</Frame>
function BrowseWowTokenResults_Update()
BrowseWowTokenResults:Show();
FauxScrollFrame_Update(BrowseScrollFrame, 0, NUM_BROWSE_TO_DISPLAY, AUCTIONS_BUTTON_HEIGHT);
local marketPrice;
if (WowToken_IsWowTokenAuctionDialogShown()) then
marketPrice = C_WowTokenPublic.GetGuaranteedPrice();
else
marketPrice = C_WowTokenPublic.GetCurrentMarketPrice();
end
BrowseWowTokenResults:Show();
local itemName, _, itemQuality, _, _, _, _, _, _, itemTexture = GetItemInfo(WOW_TOKEN_ITEM_ID);
if itemName then
BrowseWowTokenResults.Token.Icon:SetTexture(itemTexture)
BrowseWowTokenResults.Token.Name:SetText(itemName);
BrowseWowTokenResults.Token.Name:SetTextColor(ITEM_QUALITY_COLORS[itemQuality].r, ITEM_QUALITY_COLORS[itemQuality].g, ITEM_QUALITY_COLORS[itemQuality].b);
BrowseWowTokenResults.BuyoutPrice:SetText(GetMoneyString(marketPrice, true));
if (GetMoney() < marketPrice) then
BrowseWowTokenResults.Buyout:SetEnabled(false);
else
BrowseWowTokenResults.Buyout:SetEnabled(true);
end
end
end
+3 -2
View File
@@ -74,6 +74,7 @@ function Aux.info.auction_item(index)
auction_item.id = id
auction_item.has_all_info = has_all_info
auction_item.duration = duration
auction_item.usable = usable
auction_item.tooltip = Aux.info.tooltip(function(tt) tt:SetAuctionItem("list", index) end)
auction_item.charges = item_charges(auction_item.tooltip)
@@ -81,8 +82,8 @@ function Aux.info.auction_item(index)
return auction_item
end
function Aux.info.set_game_tooltip(owner, tooltip)
GameTooltip:SetOwner(owner, "ANCHOR_RIGHT")
function Aux.info.set_game_tooltip(owner, tooltip, anchor)
GameTooltip:SetOwner(owner, anchor)
for _, line in ipairs(tooltip) do
GameTooltip:AddDoubleLine(line[1].text, line[2].text, line[1].r, line[1].b, line[1].g, line[2].r, line[2].b, line[2].g, true)
end
+32 -3
View File
@@ -108,6 +108,7 @@ function Aux.sheet.create(frame, physical_columns, sort_order, on_cell_click, on
button:SetID(i)
button:SetHighlightTexture('Interface\\QuestFrame\\UI-QuestTitleHighlight')
button:SetScript("OnMouseDown", function() Aux.list.sort(sheet, this:GetID()) end)
button:RegisterForClicks("LeftButtonDown", "RightButtonDown")
local texture = content:CreateTexture(nil, 'ARTWORK')
texture:SetTexture('Interface\\QuestFrame\\UI-QuestTitleHighlight')
@@ -154,7 +155,8 @@ function Aux.sheet.create(frame, physical_columns, sort_order, on_cell_click, on
for i = 1,getn(physical_columns) do
local cell = CreateFrame('Button', nil, content)
cell:SetPoint('TOPLEFT', labels[i], 'BOTTOMLEFT', 0, -((row_index-1) * 14))
cell:SetPoint('TOPRIGHT', labels[i], 'BOTTOMRIGHT', 0, -((row_index-1) * 14))
cell:SetPoint('TOPRIGHT', labels[i], 'BOTTOMRIGHT', 0, -((row_index-1) * 14))
cell:RegisterForClicks("LeftButtonDown", "RightButtonDown")
cell:SetHeight(14)
@@ -241,9 +243,23 @@ function Aux.sheet.initialize(frame)
comparator = function(row1, row2) return Aux.util.compare(row1.tooltip[1][1].text, row2.tooltip[1][1].text, Aux.util.GT) end,
cell_initializer = function(cell)
local icon = CreateFrame('Button', nil, cell)
local icon_texture = icon:CreateTexture(nil, 'BORDER')
icon_texture:SetAllPoints(icon)
icon.icon_texture = icon_texture
local normal_texture = icon:CreateTexture(nil)
normal_texture:SetPoint('CENTER', 0, 0)
normal_texture:SetWidth(22)
normal_texture:SetHeight(22)
normal_texture:SetTexture('Interface\\Buttons\\UI-Quickslot2')
icon:SetNormalTexture(normal_texture)
icon:SetPoint('LEFT', cell)
icon:SetWidth(12)
icon:SetHeight(12)
icon:SetNormalTexture('Interface\\Buttons\\UI-Quickslot2')
icon:SetPushedTexture('Interface\\Buttons\\UI-Quickslot-Depress')
icon:SetHighlightTexture('Interface\\Buttons\\ButtonHilight-Square')
icon:SetScript('OnEnter', function() Aux.info.set_game_tooltip(this, cell.tooltip, 'ANCHOR_RIGHT') end)
icon:SetScript('OnLeave', function() GameTooltip:Hide() end)
local text = cell:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
text:SetPoint("LEFT", icon, "RIGHT", 1, 0)
text:SetPoint('TOPRIGHT', cell)
@@ -255,7 +271,13 @@ function Aux.sheet.initialize(frame)
cell.icon = icon
end,
cell_setter = function(cell, datum)
cell.icon:SetNormalTexture(datum.texture)
cell.tooltip = datum.tooltip
cell.icon.icon_texture:SetTexture(datum.texture)
if not datum.usable then
cell.icon.icon_texture:SetVertexColor(1.0, 0.1, 0.1)
else
cell.icon.icon_texture:SetVertexColor(1.0, 1.0, 1.0)
end
cell.text:SetText('['..datum.tooltip[1][1].text..']')
local color = ITEM_QUALITY_COLORS[datum.quality]
cell.text:SetTextColor(color.r, color.g, color.b)
@@ -266,7 +288,14 @@ function Aux.sheet.initialize(frame)
comparator = function(row1, row2) return Aux.util.compare(row1.level, row2.level, Aux.util.GT) end,
cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
cell_setter = function(cell, datum)
cell.text:SetText(max(1, datum.level))
local level = max(1, datum.level)
local text
if level > UnitLevel('player') then
text = RED_FONT_COLOR_CODE..level..FONT_COLOR_CODE_CLOSE
else
text = level
end
cell.text:SetText(text)
end,
},
{
+6 -1
View File
@@ -109,7 +109,12 @@ function submit_query(k)
if state.page then
wait_for_callback(state.job.on_start_page, {state.page, state.total_pages}, function()
controller().wait(CanSendAuctionQuery, function()
wait_for_results(k)
wait_for_results(function()
if state.job.on_page_update then
state.job.on_page_update(state.page)
end
k()
end)
QueryAuctionItems(
state.job.query.name,
state.job.query.min_level,