huge progress on restyling of buy, new layout looks like modern auctioneer lists

This commit is contained in:
Manuel Simon Hirsig
2015-10-14 00:37:22 +02:00
parent 88ff3db151
commit 84839f5980
6 changed files with 322 additions and 1323 deletions
+3 -5
View File
@@ -155,9 +155,7 @@ end
-----------------------------------------
function AuxBuyEntry_OnClick(entry_index)
local scroll_frame = getglobal(this:GetParent():GetName().."ScrollFrame")
local entry_index = this:GetID() + FauxScrollFrame_GetOffset(scroll_frame)
local express_mode = IsAltKeyDown()
local buyout_mode = arg1 == "LeftButton"
@@ -287,7 +285,7 @@ function process_auction(auction_item, current_page)
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
if true then
tinsert(entries, {
name = auction_item.name,
level = auction_item.level,
@@ -320,7 +318,7 @@ end
-----------------------------------------
function Aux_Buy_ScrollbarUpdate()
Aux.list.populate(AuxBuyList, entries or {})
Aux.list.populate(AuxBuySheet, entries or {})
end
-----------------------------------------
+4 -144
View File
@@ -12,16 +12,12 @@
<Button name="SearchListItemTemplate" inherits="ListItemTemplate" virtual="true">
<Scripts>
local scrollFrame
local index
<OnLoad>
this:RegisterForClicks("LeftButtonUp", "RightButtonUp")
</OnLoad>
<OnLeave>
GameTooltip:Hide()
ResetCursor()
scrollFrame = nil
index = nil
</OnLeave>
<OnClick>
AuxBuyEntry_OnClick(index)
@@ -59,150 +55,14 @@
</Layer>
</Layers>
<Frames>
<Frame name="AuxBuyList" inherits="ListTemplate">
<Size><AbsDimension x="615" y="334"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="187" y="-77"/></Offset></Anchor></Anchors>
<Frame name="AuxBuyList">
<Size><AbsDimension x="615" y="326"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="179" y="-94"/></Offset></Anchor></Anchors>
<Scripts>
<OnLoad>
Aux.list.on_load(this)
AuxBuySheet = Aux.sheet.initialize(this)
</OnLoad>
</Scripts>
<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">
+29 -493
View File
@@ -1,504 +1,40 @@
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
<Script file="buy.lua"/>
<Frame>
<Scripts>
<OnUpdate>
Aux.buy.onupdate()
</OnUpdate>
</Scripts>
</Frame>
<Button name="SearchListItemTemplate" inherits="ListItemTemplate" virtual="true">
<Scripts>
local scrollFrame
local index
<OnLoad>
this:RegisterForClicks("LeftButtonUp", "RightButtonUp")
</OnLoad>
<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(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>
<Layers>
<Layer level="BACKGROUND">
<FontString inherits="GameFontNormal" text="Aux Buy">
<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>
</Layer>
</Layers>
<Frames>
<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.on_load(this)
</OnLoad>
</Scripts>
<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="$parentConfiguration">
<Size><AbsDimension x="300" y="700"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="80" y="-46"/></Offset></Anchor></Anchors>
<Backdrop bgFile="Interface/Tooltips/UI-Tooltip-Background"><Color r="1" g="1" b="1" a="0.2"/></Backdrop>
<Frames>
<Frame name="$parentItem">
<Anchors>
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="-100"/></Offset></Anchor>
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
</Anchors>
<Frames>
<EditBox name="AuxBuyNameInputBox" autoFocus="false" inherits="InputBoxTemplate">
<Size><AbsDimension x="180" y="22"/></Size>
<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>
</Layer>
</Layers>
<Scripts>
<OnTextChanged>
Aux.completion.make_suggestions(this)
</OnTextChanged>
<OnTabPressed>
Aux.completion.highlight_next(this)
</OnTabPressed>
<OnEnterPressed>
if Aux.completion.highlighted() then
Aux.completion.select(this)
else
this:ClearFocus()
Aux.buy.SearchButton_onclick()
end
</OnEnterPressed>
</Scripts>
</EditBox>
</Frames>
</Frame>
<CheckButton name="AuxBuyExactCheckButton" inherits="UICheckButtonTemplate" checked="true">
<Size><AbsDimension x="22" y="22"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="200" 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>
</Layer>
</Layers>
</CheckButton>
<Frame name="AuxBuyCategoryDropDown" inherits="UIDropDownMenuTemplate">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="235" y="3" /></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>
</Layer>
</Layers>
<Scripts>
<OnLoad>
UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize)
UIDropDownMenu_SetWidth(200)
</OnLoad>
<OnShow>
UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize)
</OnShow>
</Scripts>
</Frame>
<CheckButton name="AuxBuyUsableCheckButton" inherits="UICheckButtonTemplate">
<Size><AbsDimension x="22" y="22"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="500" y="0" /></Offset></Anchor></Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString inherits="GameFontHighlightSmall" text="Usable">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="9"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</CheckButton>
<EditBox name="AuxBuyTooltipInputBox" autoFocus="false" inherits="InputBoxTemplate">
<Size><AbsDimension x="145" y="22"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="557" y="0"/></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>
</Layer>
</Layers>
<Scripts>
<OnEnterPressed>
AuxBuyTooltipButton_OnClick(this)
</OnEnterPressed>
</Scripts>
</EditBox>
<Frame name="AuxBuyTooltipDropDown" inherits="UIDropDownMenuTemplate" hidden="true">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="555" y="0"/></Offset></Anchor></Anchors>
<Scripts>
<OnLoad>
UIDropDownMenu_Initialize(this, AuxBuyTooltipDropDown_Initialize)
</OnLoad>
</Scripts>
</Frame>
<Button name="AuxBuyTooltipArrow">
<Size><AbsDimension x="24" y="24"/></Size>
<Anchors><Anchor point="LEFT" relativePoint="RIGHT" relativeTo="AuxBuyTooltipInputBox"><Offset><AbsDimension x="-4" y="0"/></Offset></Anchor></Anchors>
<Scripts>
<OnClick>
Aux.buy.toggle_tooltip_dropdown()
PlaySound("igMainMenuOptionCheckBoxOn")
</OnClick>
</Scripts>
<NormalTexture name="$parentNormalTexture" file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Up">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="RIGHT"/>
</Anchors>
</NormalTexture>
<PushedTexture name="$parentPushedTexture" file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Down">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="RIGHT"/>
</Anchors>
</PushedTexture>
<DisabledTexture name="$parentDisabledTexture" file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Disabled">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="RIGHT"/>
</Anchors>
</DisabledTexture>
<HighlightTexture name="$parentHighlightTexture" file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="RIGHT"/>
</Anchors>
</HighlightTexture>
</Button>
<Button name="AuxBuyTooltipButton" inherits="UIPanelButtonTemplate" text="+">
<Size><AbsDimension x="22" y="22"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="720" y="0"/></Offset></Anchor></Anchors>
<Scripts>
<OnClick>
AuxBuyTooltipButton_OnClick(this)
</OnClick>
</Scripts>
</Button>
<!-- <Frame name="AuxBuySlotDropDown" inherits="UIDropDownMenuTemplate">
<Anchors><Anchor point="LEFT"><Offset><AbsDimension x="500" y="1" /></Offset></Anchor></Anchors>
<Scripts>
<OnLoad>
UIDropDownMenu_Initialize(this, AuxBuySlotDropDown_Initialize)
</OnLoad>
<OnShow>
UIDropDownMenu_Initialize(this, AuxBuySlotDropDown_Initialize)
</OnShow>
</Scripts>
</Frame> -->
</Frames>
</Frame>
<Button name="AuxBuySearchButton" inherits="UIPanelButtonTemplate" text="Search">
<Size><AbsDimension x="166" y="22"/></Size>
<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="51" y="14"/>
<AbsDimension x="-5" y="2"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
Aux.buy.SearchButton_onclick()
</OnClick>
</Scripts>
</Button>
<Button name="AuxBuyStopButton" inherits="UIPanelButtonTemplate" text="Stop" hidden="true">
<Size><AbsDimension x="166" y="22"/></Size>
</FontString>
<FontString name="$parentStock" inherits="NumberFontNormalYellow" justifyH="LEFT" hidden="true">
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="51" y="14"/>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
Aux.buy.StopButton_onclick()
</OnClick>
</Scripts>
</Button>
<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>
<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="200" y="1" /></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="30" y="-30"/></Offset></Anchor></Anchors>
<FontStringHeader1 inherits="GameFontNormalWhite"/>
</SimpleHTML>
<Frame name="$parentBid" inherits="MoneyInputFrameTemplate">
<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.dialog_action()
</OnClick>
</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>
<Scripts>
<OnClick>
Aux.buy.dialog_cancel()
</OnClick>
</Scripts>
</Button>
</Frames>
</Frame>
</Frames>
</Frame>
</Ui>
</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>
+256 -438
View File
@@ -1,14 +1,7 @@
Aux.sheet = {}
local GSC_GOLD = 'ffd100'
local GSC_SILVER = 'e6e6e6'
local GSC_COPPER= 'c8602c'
local GSC_RED = 'ff0000'
Aux.list = {}
local MAX_COLUMNS = 7
local NAME, LEVEL, OWNER, BID, BID_UNIT, BUYOUT, BUYOUT_UNIT, QUANTITY, TIME_LEFT = 1, 2, 3, 4, 5, 6, 7, 8, 9
MoneyTypeInfo["AUX_LIST"] = {
@@ -20,123 +13,58 @@ MoneyTypeInfo["AUX_LIST"] = {
showSmallerCoins = 1,
}
local logical_columns = {
{
title = 'Auction Item',
texture = function(row) return row.texture end,
comparator = function(row1, row2) return Aux.util.compare(row1.tooltip[1][1].text, row2.tooltip[1][1].text, Aux.util.GT) end,
getter = function(row) return ' ['..row.tooltip[1][1].text..']' end,
color = function(row) return ITEM_QUALITY_COLORS[row.quality] end,
cell_initializer = Aux.sheet.default_cell_initializor('LEFT'),
cell_setter = function(cell) end,
},
{
title = 'Lvl',
comparator = function(row1, row2) return Aux.util.compare(row1.level, row2.level, Aux.util.GT) end,
getter = function(row) return row.level end,
cell_initializer = Aux.sheet.default_cell_initializor('RIGHT'),
},
{
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,
cell_initializer = Aux.sheet.default_cell_initializor('LEFT'),
},
{
title = 'Bid',
comparator = function(row1, row2) return Aux.util.compare(row1.bid, row2.bid, Aux.util.GT) end,
getter = function(row) return Aux.util.coins(row.bid) end,
cell_initializer = Aux.sheet.default_cell_initializor('RIGHT'),
},
{
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 Aux.util.coins(row.bid_per_unit) end,
cell_initializer = Aux.sheet.default_cell_initializor('RIGHT'),
},
{
title = 'Buyout',
comparator = function(row1, row2) return Aux.util.compare(row1.buyout_price, row2.buyout_price, Aux.util.GT) end,
getter = function(row) return Aux.util.coins(row.buyout_price) end,
cell_initializer = Aux.sheet.default_cell_initializor('RIGHT'),
},
{
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 Aux.util.coins(row.buyout_price_per_unit) end,
cell_initializer = Aux.sheet.default_cell_initializor('RIGHT'),
},
{
title = '#',
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,
cell_initializer = Aux.sheet.default_cell_initializor('RIGHT'),
},
{
title = 'Left',
comparator = function(row1, row2) return Aux.util.compare(row1.duration, row2.duration, Aux.util.GT) end,
getter = function(row)
if row.duration == 1 then
return '30m'
elseif row.duration == 2 then
return '2h'
elseif row.duration == 3 then
return '8h'
elseif row.duration == 4 then
return '24h'
end
end,
cell_initializer = Aux.sheet.default_cell_initializor('CENTER'),
},
}
local physical_columns = {
{
logical_columns = { logical_columns[QUANTITY] },
logical_column = logical_columns[QUANTITY],
width = 30
},
{
logical_columns = { logical_columns[NAME] },
logical_column = logical_columns[NAME],
width = 180
},
{
logical_columns = { logical_columns[LEVEL] },
logical_column = logical_columns[LEVEL],
width = 40
},
{
logical_columns = { logical_columns[TIME_LEFT] },
logical_column = logical_columns[TIME_LEFT],
width = 50
},
{
logical_columns = { logical_columns[OWNER] },
logical_column = logical_columns[OWNER],
width = 90
},
{
logical_columns = { logical_columns[BID_UNIT], logical_columns[BUYOUT_UNIT] },
logical_column = logical_columns[BUYOUT_UNIT],
width = 100
},
{
logical_columns = { logical_columns[BID], logical_columns[BUYOUT] },
logical_column = logical_columns[BUYOUT],
width = 100
},
}
function Aux.list.on_load()
Aux.list.initialize(this, physical_columns, logical_columns)
Aux.sheet.initialize(this, physical_columns, logical_columns)
end
-------------------------------------------------------------------------------
-- Aux.util.compare two rows
-------------------------------------------------------------------------------
function Aux.sheet.render(sheet)
for i, physical_column in ipairs(sheet.physical_columns) do
local sort_info = sheet.sort_order[1]
local logical_column = physical_column.logical_column
if sort_info.logical_column == logical_column then
if sort_info.sort_ascending then
sheet.labels[i].sort_texture:SetTexCoord(0,0.55,0.2,0.9)
sheet.labels[i].sort_texture:SetVertexColor(0.2,1,0)
sheet.labels[i].sort_texture:Show()
else
sheet.labels[i].sort_texture:SetTexCoord(0,0.55,0.9,0.2)
sheet.labels[i].sort_texture:SetVertexColor(1,0.2,0)
sheet.labels[i].sort_texture:Show()
end
else
sheet.labels[i].texture:SetTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight")
sheet.labels[i].sort_texture:Hide()
end
end
FauxScrollFrame_Update(sheet.scroll_frame, getn(sheet.data), getn(sheet.rows), 16)
sheet.scroll_frame:Show()
local offset = FauxScrollFrame_GetOffset(sheet.scroll_frame)
--local vSize = self.panel.vSize
local hSize = getn(sheet.physical_columns)
function Aux.sheet.create(frame, physical_columns)
local rows = sheet.rows
local data = sheet.data
for i, row in ipairs(rows) do
local direction, rowR, rowG, rowB, rowA1, rowA2 = "Horizontal", 1, 1, 1, 0, 0 --row level coloring used for gradients
local datum = data[i + offset]
for j, physical_column in sheet.physical_columns do
local cell = row[j]
if datum then
physical_column.logical_column.cell_setter(cell, datum)
cell:Show()
else
cell:Hide()
end
end
rows[i].color_texture:SetGradientAlpha(direction, rowR, rowG, rowB, rowA1, rowR, rowG, rowB, rowA2)--row color to apply
end
end
function Aux.sheet.create(frame, physical_columns, sort_order, on_cell_click, on_cell_enter, on_cell_leave)
local sheet
local name = (frame:GetName() or '')..'ScrollSheet'
@@ -145,102 +73,19 @@ function Aux.sheet.create(frame, physical_columns)
id = id + 1
end
name = name..id
local scroll_frame = CreateFrame("ScrollFrame", name..'ScrollFrame', frame, "FauxScrollFrameTemplate")
scroll_frame:SetScript("OnVerticalScroll", function()
FauxScrollFrame_OnVerticalScroll(16, function() Aux.sheet.render(this.sheet) end)
end)
scroll_frame:SetPoint("TOPLEFT", frame, "TOPLEFT", 5, -10)
scroll_frame:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 5, 19)
local parent_height = frame:GetHeight()
local content = CreateFrame('Frame', name..'Content', frame)
content:SetHeight(parent_height - 30)
local panel = CreateFrame('ScrollFrame', nil, 'FauxScrol
local NUM_BUTTONS = 8
local BUTTON_HEIGHT = 20
content:SetPoint("TOPLEFT", scroll_frame, "TOPLEFT", 5, 0)
local list = {} -- put contents of the scroll frame here, for example item names
local buttons = {}
local function update(self)
local numItems = #list
FauxScrollFrame_Update(self, numItems, NUM_BUTTONS, BUTTON_HEIGHT)
local offset = FauxScrollFrame_GetOffset(self)
for line = 1, NUM_BUTTONS do
local lineplusoffset = line + offset
local button = buttons[line]
if lineplusoffset > numItems then
button:Hide()
else
button:SetText(list[lineplusoffset])
button:Show()
end
end
end
local scrollFrame = CreateFrame("ScrollFrame", "MyFirstNotReallyScrollFrame", UIParent, "FauxScrollFrameTemplate")
scrollFrame:SetScript("OnVerticalScroll", function(self, offset)
FauxScrollFrame_OnVerticalScroll(self, offset, BUTTON_HEIGHT, update)
end)
for i = 1, NUM_BUTTONS do
local button = CreateFrame("Button", nil, scrollFrame:GetParent())
if i == 1 then
button:SetPoint("TOP", scrollFrame)
else
button:SetPoint("TOP", buttons[i - 1], "BOTTOM")
end
button:SetSize(96, BUTTON_HEIGHT)
buttons[i] = button
end
<ScrollFrame name="$parentScrollFrame" inherits="FauxScrollFrameTemplate">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="-28"/>
</Offset>
</Anchor>
<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-2" y="5"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.484375" top="0" bottom="1.0"/>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="106"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-2" y="-2"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.515625" right="1.0" top="0" bottom="0.4140625"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnVerticalScroll>
FauxScrollFrame_OnVerticalScroll(16, Aux.list.scroll_frame_update)
</OnVerticalScroll>
</Scripts>
</ScrollFrame>
local total_width = 0
local labels = {}
@@ -261,8 +106,8 @@ end
button:SetWidth(column_width)
button:SetHeight(16)
button:SetID(i)
button:SetHighLightTexture('Interface\\QuestFrame\\UI-QuestTitleHighlight')
-- button:SetScript('OnMouseDown', function() end)
button:SetHighlightTexture('Interface\\QuestFrame\\UI-QuestTitleHighlight')
button:SetScript("OnMouseDown", function() Aux.list.sort(sheet, this:GetID()) end)
local texture = content:CreateTexture(nil, 'ARTWORK')
texture:SetTexture('Interface\\QuestFrame\\UI-QuestTitleHighlight')
@@ -272,7 +117,7 @@ end
local sort_texture = button:CreateTexture(nil, 'ARTWORK')
sort_texture:SetTexture('Interface\\Buttons\\UI-SortArrow')
sort_texture:SetPoint('TOPRIGHT, button, 'TOPRIGHT', 0, 0)
sort_texture:SetPoint('TOPRIGHT', button, 'TOPRIGHT', 0, 0)
sort_texture:SetPoint('BOTTOM', button, 'BOTTOM', 0, 0)
sort_texture:SetWidth(12)
sort_texture:Hide()
@@ -280,7 +125,7 @@ end
local background = content:CreateTexture(nil, 'ARTWORK')
background:SetTexture('Interface\\QuestFrame\\UI-QuestTitleHighlight')
background:SetTextCoord(0.2, 0.9, 0, 0.9)
-- background:SetTextCoord(0.2, 0.9, 0, 0.9)
background:SetPoint('TOPLEFT', button, 'BOTTOMLEFT', 0, 0)
background:SetPoint('TOPRIGHT', button, 'BOTTOMRIGHT', 0, 0)
background:SetPoint('BOTTOM', content, 'BOTTOM', 0, 0)
@@ -307,17 +152,17 @@ end
while total_height + 14 < max_height do
local row = {}
for i = 1,getn(physical_columns) do
local cell = CreateFrame('Frame', nil, content)
if row_index == 1 then
cell:SetPoint('TOPLEFT', labels[i], 'BOTTOMLEFT', 0, 0)
cell:SetPoint('TOPRIGHT', labels[i], 'BOTTOMRIGHT', 0, 0)
else
cell:SetPoint('TOPLEFT', rows[row_index-1][i], 'BOTTOMLEFT', 0, 0)
cell:SetPoint('TOPRIGHT', rows[row_index-1][i], 'BOTTOMRIGHT', 0, 0)
end
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:SetHeight(14)
local row_index, column_index = row_index, i
cell:SetScript("OnClick", function() if sheet.on_cell_click then sheet.on_cell_click(sheet, row_index, column_index) end end)
cell:SetScript("OnEnter", function() if sheet.on_cell_enter then sheet.on_cell_enter(sheet, row_index, column_index) end end)
cell:SetScript("OnLeave", function() if sheet.on_cell_leave then sheet.on_cell_leave(sheet, row_index, column_index) end end)
physical_columns[i].logical_column.cell_initializer(cell)
row[i] = cell
@@ -346,23 +191,24 @@ end
sheet = {
name = name,
content = content,
panel = panel,
scroll_frame = scroll_frame,
labels = labels,
rows = rows,
column_count = getn(labels),
physical_row_count = getn(rows),
physical_columns = physical_columns,
data = {},
style = {},
sort = {},
logical_row_count = 0,
sort_order = sort_order,
on_cell_click = on_cell_click,
on_cell_enter = on_cell_enter,
on_cell_leave = on_cell_leave,
}
scroll_frame.sheet = sheet
return sheet
end
function Aux.list.row_comparator(list_frame)
function Aux.list.row_comparator(sheet)
return function(row1, row2)
for _, sort_info in ipairs(list_frame.sort_order) do
for _, sort_info in ipairs(sheet.sort_order) do
local logical_column = sort_info.logical_column
if logical_column.comparator then
local ordering = logical_column.comparator(row1, row2)
@@ -376,245 +222,221 @@ function Aux.list.row_comparator(list_frame)
end
function Aux.sheet.default_cell_initializer(alignment)
return function(cell_frame)
local text = cell_frame:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
text:SetAllPoints(cell_frame)
return function(cell)
local text = cell:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
text:SetAllPoints(cell)
text:SetJustifyV('TOP')
text:SetJustifyH(alignment)
text:SetTextColor(0.8, 0.8, 0.8)
cell.text = text
end
end
-------------------------------------------------------------------------------
-- Initialize the list with the column information
-------------------------------------------------------------------------------
function Aux.list.initialize(frame, physical_columns, logical_columns)
function Aux.sheet.initialize(frame)
local logical_columns = {
{
title = 'Auction Item',
texture = function(row) return row.texture end,
comparator = function(row1, row2) return Aux.util.compare(row1.tooltip[1][1].text, row2.tooltip[1][1].text, Aux.util.GT) end,
color = function(row) return ITEM_QUALITY_COLORS[row.quality] end,
cell_initializer = Aux.sheet.default_cell_initializer('LEFT'),
cell_setter = function(cell, datum)
cell.text:SetText(' ['..datum.tooltip[1][1].text..']')
local color = ITEM_QUALITY_COLORS[datum.quality]
cell.text:SetTextColor(color.r, color.g, color.b)
end,
},
{
title = 'Lvl',
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(datum.level)
end,
},
{
title = 'Owner',
comparator = function(row1, row2) return Aux.util.compare(row1.owner, row2.owner, Aux.util.GT) end,
cell_initializer = Aux.sheet.default_cell_initializer('LEFT'),
cell_setter = function(cell, datum)
cell.text:SetText(datum.owner)
end,
},
{
title = 'Bid',
comparator = function(row1, row2) return Aux.util.compare(row1.bid, row2.bid, Aux.util.GT) end,
cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
cell_setter = function(cell, datum)
cell.text:SetText(Aux.util.money_string(datum.bid))
end,
},
{
title = 'Bid/ea',
comparator = function(row1, row2) return Aux.util.compare(row1.bid_per_unit, row2.bid_per_unit, Aux.util.GT) end,
cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
cell_setter = function(cell, datum)
cell.text:SetText(Aux.util.money_string(datum.bid_per_unit))
end,
},
{
title = 'Buy',
comparator = function(row1, row2) return Aux.util.compare(row1.buyout_price, row2.buyout_price, Aux.util.GT) end,
cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
cell_setter = function(cell, datum)
cell.text:SetText(Aux.util.money_string(datum.buyout_price))
end,
},
{
title = 'Buy/ea',
comparator = function(row1, row2) return Aux.util.compare(row1.buyout_price_per_unit, row2.buyout_price_per_unit, Aux.util.GT) end,
cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
cell_setter = function(cell, datum)
cell.text:SetText(Aux.util.money_string(datum.buyout_price_per_unit))
end,
},
{
title = '#',
comparator = function(row1, row2) return Aux.util.compare(row1.stack_size, row2.stack_size, Aux.util.LT) end,
cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
cell_setter = function(cell, datum)
cell.text:SetText(datum.stack_size)
end,
},
{
title = 'Left',
comparator = function(row1, row2) return Aux.util.compare(row1.duration, row2.duration, Aux.util.GT) end,
cell_initializer = Aux.sheet.default_cell_initializer('CENTER'),
cell_setter = function(cell, datum)
local text
if datum.duration == 1 then
text = '30m'
elseif datum.duration == 2 then
text = '2h'
elseif datum.duration == 3 then
text = '8h'
elseif datum.duration == 4 then
text = '24h'
end
cell.text:SetText(text)
end,
},
}
local physical_columns = {
{
logical_columns = { logical_columns[QUANTITY] },
logical_column = logical_columns[QUANTITY],
width = 23
},
{
logical_columns = { logical_columns[NAME] },
logical_column = logical_columns[NAME],
width = 157
},
{
logical_columns = { logical_columns[LEVEL] },
logical_column = logical_columns[LEVEL],
width = 23
},
{
logical_columns = { logical_columns[TIME_LEFT] },
logical_column = logical_columns[TIME_LEFT],
width = 30
},
{
logical_columns = { logical_columns[OWNER] },
logical_column = logical_columns[OWNER],
width = 70
},
{
logical_columns = { logical_columns[BID_UNIT], logical_columns[BUYOUT_UNIT] },
logical_column = logical_columns[BID_UNIT],
width = 70
},
{
logical_columns = { logical_columns[BID], logical_columns[BUYOUT] },
logical_column = logical_columns[BID],
width = 70
},
{
logical_columns = { logical_columns[BID_UNIT], logical_columns[BUYOUT_UNIT] },
logical_column = logical_columns[BUYOUT_UNIT],
width = 70
},
{
logical_columns = { logical_columns[BID], logical_columns[BUYOUT] },
logical_column = logical_columns[BUYOUT],
width = 70
},
}
Aux.sheet.create(frame, physical_columns)
--frame.lines = 19
--frame.lineHeight = 16
--frame.content = {}
--frame.physical_columns = physical_columns
--frame.logical_columns = logical_columns
--frame.sort_order = {}
--for i, logical_column in logical_columns do
--if i ~= BUYOUT_UNIT and i ~= NAME 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 })
--tinsert(frame.sort_order, 1, { logical_column = logical_columns[NAME], 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
--UIDropDownMenu_SetSelectedID(dropdown, Aux.util.index_of(logical_column, logical_columns))
--getglobal(button:GetName().."Arrow"):Hide()
--getglobal(button:GetName().."Text"):SetText(logical_column.title)
--button:Show()
--if (getn(physical_column.logical_columns) > 1) then
--dropdown:Show();
--else
--dropdown:Hide();
--end
--Aux.list.set_column_width(frame, i, physical_column.width);
--else
--button:Hide()
--dropdown:Hide()
--end
--end
end
-------------------------------------------------------------------------------
-- Initialize the list with the column information
-------------------------------------------------------------------------------
function Aux.list.set_column_width(frame, column_index, width)
-- Resize the header
local button = getglobal(frame:GetName().."Column"..column_index.."Sort")
button:SetWidth(width + 2)
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 text = getglobal(frame:GetName().."Item"..line.."Column"..column_index)
if text then
text:SetWidth(width - 3)
local sort_order = {}
for i, logical_column in logical_columns do
if i ~= BUYOUT_UNIT and i ~= NAME then
tinsert(sort_order, { logical_column = logical_column, sort_ascending = true })
end
end
tinsert(sort_order, 1, { logical_column = logical_columns[BUYOUT_UNIT], sort_ascending = true })
tinsert(sort_order, 1, { logical_column = logical_columns[NAME], sort_ascending = true })
function on_cell_click(sheet, row_index, column_index)
local entry_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
AuxBuyEntry_OnClick(entry_index)
end
function on_cell_enter(sheet, row_index, column_index)
sheet.rows[row_index].highlight:SetAlpha(.5)
end
function on_cell_leave(sheet, row_index, column_index)
sheet.rows[row_index].highlight:SetAlpha(0)
end
return Aux.sheet.create(frame, physical_columns, sort_order, on_cell_click, on_cell_enter, on_cell_leave)
end
-------------------------------------------------------------------------------
-- Set the item to display.
-------------------------------------------------------------------------------
function Aux.list.populate(frame, content)
frame.content = content
function Aux.list.populate(sheet, data)
sheet.data = data
-- Perform the sort.
Aux.util.merge_sort(frame.content, Aux.list.row_comparator(frame))
Aux.util.merge_sort(sheet.data, Aux.list.row_comparator(sheet))
-- Update the scroll pane.
Aux.list.scroll_frame_update(getglobal(frame:GetName().."ScrollFrame"))
Aux.sheet.render(sheet)
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 Aux.list.sort(sheet, physical_column_index)
-- -- 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
-- -- 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, physical_column_index)
local physical_column = frame.physical_columns[physical_column_index]
local physical_column = sheet.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
if sheet.sort_order[1].logical_column == logical_column then
sheet.sort_order[1].sort_ascending = not sheet.sort_order[1].sort_ascending
else
for index, sort_info in ipairs(frame.sort_order) do
for index, sort_info in ipairs(sheet.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)
table.remove(sheet.sort_order, index)
table.insert(sheet.sort_order, 1, temp)
break
end
end
frame.sort_order[1].sort_ascending = true
sheet.sort_order[1].sort_ascending = true
end
Aux.util.merge_sort(frame.content, Aux.list.row_comparator(frame))
Aux.util.merge_sort(sheet.data, Aux.list.row_comparator(sheet))
Aux.list.scroll_frame_update(getglobal(frame:GetName().."ScrollFrame"))
Aux.sheet.render(sheet)
end
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
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 column_index = 1, table.getn(parent.physical_columns) do
local arrow = getglobal(parent:GetName().."Column"..column_index.."SortArrow")
local sort_info = parent.sort_order[1]
local physical_column = parent.physical_columns[column_index]
local logical_column = physical_column.logical_column
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
end
for line = 1, parent.lines do
local item = getglobal(parent:GetName().."Item"..line)
local row_index = line + FauxScrollFrame_GetOffset(frame)
if row_index <= getn(content) then
for column_index = 1, MAX_COLUMNS do
local item = getglobal(parent:GetName().."Item"..line.."Column"..column_index.."Item")
if item then
item:Hide()
end
local text = getglobal(parent:GetName().."Item"..line.."Column"..column_index)
-- text:Hide() TODO
text:SetText()
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])
if value then
if item and logical_column.type == "ITEM" then
item:Show()
getglobal(item:GetName() .. 'IconTexture'):SetTexture(logical_column.texture(content[row_index]))
end
if text and (logical_column.type == "DATE" or logical_column.type == "NUMBER" or logical_column.type == "STRING" or logical_column.type == "ITEM") 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)
end
if logical_column.alphaFunc then
text:SetAlpha(logical_column.alphaFunc(content[row_index]))
else
text:SetAlpha(1.0)
end
-- if (logical_column.type == "NUMBER") then
-- text:SetJustifyH("RIGHT")
-- else
-- text:SetJustifyH("LEFT")
-- end
text:Show()
end
end
end
end
-- -- Update the row highlight
-- if parent.selectedRow and parent.selectedRow == row_index then
-- item:LockHighlight()
-- else
-- item:UnlockHighlight()
-- end
item:Show()
else
item:Hide()
end
AuxBuyListScrollFrame:Show()
end
end
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
function Aux.list.dropdown_on_load()
getglobal(this:GetName().."Text"):Hide()
this.initialize = Aux.list.dropdown_initialize
UIDropDownMenu_SetSelectedID(this, 1)
end
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
function Aux.list.dropdown_initialize()
local dropdown = this:GetParent()
local frame = dropdown:GetParent()
@@ -632,8 +454,6 @@ function Aux.list.dropdown_initialize()
end
end
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
function Aux.list.dropdown_item_onclick()
local logical_column_index = this:GetID()
local physical_column_index = this.owner:GetID()
@@ -644,11 +464,9 @@ function Aux.list.dropdown_item_onclick()
frame.physical_columns[physical_column_index].logical_column = frame.physical_columns[physical_column_index].logical_columns[logical_column_index]
getglobal(frame:GetName().."Column"..physical_column_index.."SortText"):SetText(frame.physical_columns[physical_column_index].logical_column.title)
Aux.util.merge_sort(frame.content, Aux.list.row_comparator(frame))
Aux.util.merge_sort(frame.data, Aux.list.row_comparator(frame))
UIDropDownMenu_SetSelectedID(dropdown, logical_column_index)
Aux.list.scroll_frame_update(getglobal(frame:GetName().."ScrollFrame"))
end
end
end
-233
View File
@@ -153,237 +153,4 @@
</Anchors>
</HighlightTexture>
</Button>
<Frame name="ListTemplate" virtual="true">
<Frames>
<Button name="$parentColumn1Sort" inherits="ListSortButtonTemplate">
<Size><AbsDimension x="134" y="24"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
<Scripts>
<OnClick>
Aux.list.sort(this:GetParent(), 1)
</OnClick>
</Scripts>
</Button>
<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_on_load()
</OnLoad>
</Scripts>
</Frame>
<Button name="$parentColumn2Sort" inherits="ListSortButtonTemplate">
<Size><AbsDimension x="44" y="24"/></Size>
<Anchors><Anchor point="LEFT" relativeTo="$parentColumn1Sort" relativePoint="RIGHT"><Offset><AbsDimension x="-2" y="0"/></Offset></Anchor></Anchors>
<Scripts>
<OnClick>
Aux.list.sort(this:GetParent(), 2)
</OnClick>
</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>
<Scripts>
<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>
<Scripts>
<OnClick>
Aux.list.sort(this:GetParent(), 3)
</OnClick>
</Scripts>
</Button>
<Frame name="$parentColumn3DropDown" inherits="UIDropDownMenuTemplate" id="3">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentColumn3Sort" relativePoint="LEFT">
<Offset>
<AbsDimension x="-14" y="-3"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
Aux.list.dropdown_on_load()
</OnLoad>
</Scripts>
</Frame>
<Button name="$parentColumn4Sort" inherits="ListSortButtonTemplate">
<Size>
<AbsDimension x="174" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentColumn3Sort" relativePoint="RIGHT">
<Offset>
<AbsDimension x="-2" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
Aux.list.sort(this:GetParent(), 4)
</OnClick>
</Scripts>
</Button>
<Frame name="$parentColumn4DropDown" inherits="UIDropDownMenuTemplate" id="4">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentColumn4Sort" relativePoint="LEFT">
<Offset>
<AbsDimension x="-15" y="-3"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
Aux.list.dropdown_on_load()
</OnLoad>
</Scripts>
</Frame>
<Button name="$parentColumn5Sort" inherits="ListSortButtonTemplate">
<Size>
<AbsDimension x="174" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentColumn4Sort" relativePoint="RIGHT">
<Offset>
<AbsDimension x="-2" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
Aux.list.sort(this:GetParent(), 5)
</OnClick>
</Scripts>
</Button>
<Frame name="$parentColumn5DropDown" inherits="UIDropDownMenuTemplate" id="5">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentColumn5Sort" relativePoint="LEFT">
<Offset>
<AbsDimension x="-14" y="-3"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
Aux.list.dropdown_on_load()
</OnLoad>
</Scripts>
</Frame>
<Button name="$parentColumn6Sort" inherits="ListSortButtonTemplate">
<Size>
<AbsDimension x="174" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentColumn5Sort" relativePoint="RIGHT">
<Offset>
<AbsDimension x="-2" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
Aux.list.sort(this:GetParent(), 6)
</OnClick>
</Scripts>
</Button>
<Frame name="$parentColumn6DropDown" inherits="UIDropDownMenuTemplate" id="6">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentColumn6Sort" relativePoint="LEFT">
<Offset>
<AbsDimension x="-14" y="-3"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
Aux.list.dropdown_on_load()
</OnLoad>
</Scripts>
</Frame>
<Button name="$parentColumn7Sort" inherits="ListSortButtonTemplate">
<Size>
<AbsDimension x="174" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentColumn6Sort" relativePoint="RIGHT">
<Offset>
<AbsDimension x="-2" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
Aux.list.sort(this:GetParent(), 6)
</OnClick>
</Scripts>
</Button>
<Frame name="$parentColumn7DropDown" inherits="UIDropDownMenuTemplate" id="7">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentColumn7Sort" relativePoint="LEFT">
<Offset>
<AbsDimension x="-14" y="-3"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
Aux.list.dropdown_on_load()
</OnLoad>
</Scripts>
</Frame>
<ScrollFrame name="$parentScrollFrame" inherits="FauxScrollFrameTemplate">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="-28"/>
</Offset>
</Anchor>
<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-2" y="5"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.484375" top="0" bottom="1.0"/>
</Texture>
<Texture file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="106"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-2" y="-2"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.515625" right="1.0" top="0" bottom="0.4140625"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnVerticalScroll>
FauxScrollFrame_OnVerticalScroll(16, Aux.list.scroll_frame_update)
</OnVerticalScroll>
</Scripts>
</ScrollFrame>
</Frames>
</Frame>
</Ui>
+30 -10
View File
@@ -190,16 +190,24 @@ function Aux.util.index_of(value, array)
end
end
local GOLD = "ffd100"
local SILVER = "e6e6e6"
local COPPER = "c8602c"
local GSC_GOLD = "ffd100"
local GSC_SILVER = "e6e6e6"
local GSC_COPPER = "c8602c"
local GSC_RED = "ff0000"
local GSC_3 = "|cff%s%d|cff000000.|cff%s%02d|cff000000.|cff%s%02d|r"
local GSC_2 = "|cff%s%d|cff000000.|cff%s%02d|r"
local GSC_1 = "|cff%s%d|r"
local GSC_3 = "|cff"..GSC_GOLD.."%d|cff000000.|cff"..GSC_SILVER.."%02d|cff000000.|cff"..GSC_COPPER.."%02d|r"
local GSC_2 = "|cff"..GSC_SILVER.."%d|cff000000.|cff"..GSC_COPPER.."%02d|r"
local GSC_1 = "|cff"..GSC_COPPER.."%d|r"
function Aux.util.coins(money)
local GSC_3N = "|cff"..GSC_RED.."(|cff"..GSC_GOLD.."%d|cff000000.|cff"..GSC_SILVER.."%02d|cff000000.|cff"..GSC_COPPER.."%02d|cff"..GSC_RED..")|r"
local GSC_2N = "|cff"..GSC_RED.."(|cff"..GSC_SILVER.."%d|cff000000.|cff"..GSC_COPPER.."%02d|cff"..GSC_RED..")|r"
local GSC_1N = "|cff"..GSC_RED.."(|cff"..GSC_COPPER.."%d|cff"..GSC_RED..")|r"
function Aux.util.money_string(money)
money = floor(tonumber(money) or 0)
local negative = money < 0
money = abs(money)
local g = floor(money / 10000)
money = money - g * 10000
local s = floor(money / 100)
@@ -207,10 +215,22 @@ function Aux.util.coins(money)
local c = money
if g > 0 then
return string.format(GSC_3, GOLD, g, SILVER, s, COPPER, c)
if negative then
return format(GSC_3N, g, s, c)
else
return format(GSC_3, g, s, c)
end
elseif s > 0 then
return string.format(GSC_2, SILVER, s, COPPER, c)
if negative then
return format(GSC_2N, s, c)
else
return format(GSC_2, s, c)
end
else
return string.format(GSC_1, COPPER, c)
if negative then
return format(GSC_1N, c)
else
return format(GSC_1, c)
end
end
end