working on redesign and new features for buy

This commit is contained in:
Manuel Simon Hirsig
2015-10-13 01:19:37 +02:00
parent 6216e8b08d
commit cf04807e2b
5 changed files with 185 additions and 142 deletions
+24 -19
View File
@@ -154,6 +154,9 @@ end
----------------------------------------- -----------------------------------------
function AuxBuyEntry_OnClick(entry_index) 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 express_mode = IsAltKeyDown()
local buyout_mode = arg1 == "LeftButton" local buyout_mode = arg1 == "LeftButton"
@@ -261,8 +264,10 @@ function AuxBuyEntry_OnClick(entry_index)
} }
end end
function AuxBuyEntry_OnEnter(entry_index) function Aux.buy.icon_on_enter()
local entry = entries[entry_index] local scroll_frame = getglobal(this:GetParent():GetParent():GetName().."ScrollFrame")
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)
@@ -279,11 +284,12 @@ function process_auction(auction_item, current_page)
local stack_size = auction_item.charges or auction_item.count local stack_size = auction_item.charges or auction_item.count
local bid = auction_item.current_bid > 0 and auction_item.current_bid or auction_item.min_bid + auction_item.min_increment local bid = auction_item.current_bid > 0 and auction_item.current_bid or auction_item.min_bid + auction_item.min_increment
local buyout_price = auction_item.buyout_price > 0 and auction_item.buyout_price or nil local buyout_price = 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) local buyout_price_per_unit = buyout_price and Aux_Round(auction_item.buyout_price/stack_size)
if auction_item.owner ~= UnitName("player") then if auction_item.owner ~= UnitName("player") then
tinsert(entries, { tinsert(entries, {
name = auction_item.name, name = auction_item.name,
texture = auction_item.texture,
tooltip = auction_item.tooltip, tooltip = auction_item.tooltip,
stack_size = stack_size, stack_size = stack_size,
buyout_price = buyout_price, buyout_price = buyout_price,
@@ -293,7 +299,7 @@ function process_auction(auction_item, current_page)
itemstring = auction_item.itemstring, itemstring = auction_item.itemstring,
page = current_page, page = current_page,
bid = bid, bid = bid,
bid_per_unit = Aux_Round(bid / stack_size), bid_per_unit = Aux_Round(bid/stack_size),
owner = auction_item.owner, owner = auction_item.owner,
duration = auction_item.duration, duration = auction_item.duration,
}) })
@@ -335,7 +341,7 @@ function AuxBuyCategoryDropDown_Initialize(arg1)
if level == 1 then if level == 1 then
local value = {} local value = {}
UIDropDownMenu_AddButton({ UIDropDownMenu_AddButton({
text= 'All', text = ALL,
value = value, value = value,
func = AuxBuyCategoryDropDown_OnClick, func = AuxBuyCategoryDropDown_OnClick,
}, 1) }, 1)
@@ -394,25 +400,24 @@ function AuxBuyCategoryDropDown_OnClick()
CloseDropDownMenus(1) CloseDropDownMenus(1)
end end
function AuxBuySlotDropDown_Initialize() function AuxBuyQualityDropDown_Initialize()
UIDropDownMenu_AddButton{ UIDropDownMenu_AddButton{
text= 'All', text = ALL,
value = value, value = -1,
func = AuxBuySlotDropDown_OnClick('All', value), func = AuxBuyQualityDropDown_OnClick,
} }
for i=0,getn(ITEM_QUALITY_COLORS)-2 do
-- for i, type in pairs({ GetAuctionInvTypes() }) do UIDropDownMenu_AddButton{
-- UIDropDownMenu_AddButton{ text = getglobal("ITEM_QUALITY"..i.."_DESC"),
-- text = class, value = i,
-- value = i, func = AuxBuyQualityDropDown_OnClick,
-- func = AuxBuySlotDropDown_OnClick(), }
-- } end
-- end
end end
function AuxBuySlotDropDown_OnClick() function AuxBuyQualityDropDown_OnClick()
UIDropDownMenu_SetSelectedValue(AuxBuySlotDropDown, this.value) UIDropDownMenu_SetSelectedValue(AuxBuyQualityDropDown, this.value)
end end
function AuxBuyTooltipButton_OnClick() function AuxBuyTooltipButton_OnClick()
+24 -47
View File
@@ -17,11 +17,6 @@
<OnLoad> <OnLoad>
this:RegisterForClicks("LeftButtonUp", "RightButtonUp") this:RegisterForClicks("LeftButtonUp", "RightButtonUp")
</OnLoad> </OnLoad>
<OnEnter>
scrollFrame = getglobal(this:GetParent():GetName().."ScrollFrame")
index = this:GetID() + FauxScrollFrame_GetOffset(scrollFrame)
AuxBuyEntry_OnEnter(index)
</OnEnter>
<OnLeave> <OnLeave>
GameTooltip:Hide() GameTooltip:Hide()
ResetCursor() ResetCursor()
@@ -65,8 +60,8 @@
</Layers> </Layers>
<Frames> <Frames>
<Frame name="AuxBuyList" inherits="ListTemplate"> <Frame name="AuxBuyList" inherits="ListTemplate">
<Size><AbsDimension x="781" y="334"/></Size> <Size><AbsDimension x="615" y="334"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="18" y="-74"/></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="187" y="-77"/></Offset></Anchor></Anchors>
<Scripts> <Scripts>
<OnLoad> <OnLoad>
Aux.list.on_load(this) Aux.list.on_load(this)
@@ -212,10 +207,10 @@
<Frame name="AuxBuyFilters"> <Frame name="AuxBuyFilters">
<Size><AbsDimension x="1" y="1"/></Size> <Size><AbsDimension x="1" y="1"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="80" y="-46"/></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="28" y="-112"/></Offset></Anchor></Anchors>
<Frames> <Frames>
<EditBox name="AuxBuyNameInputBox" autoFocus="false" inherits="InputBoxTemplate"> <EditBox name="AuxBuyNameInputBox" autoFocus="false" inherits="InputBoxTemplate">
<Size><AbsDimension x="180" y="22"/></Size> <Size><AbsDimension x="120" y="22"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
<Layers> <Layers>
<Layer level="OVERLAY"> <Layer level="OVERLAY">
@@ -250,7 +245,7 @@
<CheckButton name="AuxBuyExactCheckButton" inherits="UICheckButtonTemplate" checked="true"> <CheckButton name="AuxBuyExactCheckButton" inherits="UICheckButtonTemplate" checked="true">
<Size><AbsDimension x="22" y="22"/></Size> <Size><AbsDimension x="22" y="22"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="200" y="0" /></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="123" y="0" /></Offset></Anchor></Anchors>
<Layers> <Layers>
<Layer level="OVERLAY"> <Layer level="OVERLAY">
<FontString inherits="GameFontHighlightSmall" text="Exact"> <FontString inherits="GameFontHighlightSmall" text="Exact">
@@ -267,7 +262,7 @@
</CheckButton> </CheckButton>
<Frame name="AuxBuyCategoryDropDown" inherits="UIDropDownMenuTemplate"> <Frame name="AuxBuyCategoryDropDown" inherits="UIDropDownMenuTemplate">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="235" y="3" /></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-23" y="-30" /></Offset></Anchor></Anchors>
<Layers> <Layers>
<Layer level="OVERLAY"> <Layer level="OVERLAY">
<FontString inherits="GameFontHighlightSmall" text="Category"> <FontString inherits="GameFontHighlightSmall" text="Category">
@@ -284,7 +279,7 @@
<Scripts> <Scripts>
<OnLoad> <OnLoad>
UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize) UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize)
UIDropDownMenu_SetWidth(200) UIDropDownMenu_SetWidth(140)
</OnLoad> </OnLoad>
<OnShow> <OnShow>
UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize) UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize)
@@ -294,7 +289,7 @@
<CheckButton name="AuxBuyUsableCheckButton" inherits="UICheckButtonTemplate"> <CheckButton name="AuxBuyUsableCheckButton" inherits="UICheckButtonTemplate">
<Size><AbsDimension x="22" y="22"/></Size> <Size><AbsDimension x="22" y="22"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="500" y="0" /></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="-65" /></Offset></Anchor></Anchors>
<Layers> <Layers>
<Layer level="OVERLAY"> <Layer level="OVERLAY">
<FontString inherits="GameFontHighlightSmall" text="Usable"> <FontString inherits="GameFontHighlightSmall" text="Usable">
@@ -311,8 +306,8 @@
</CheckButton> </CheckButton>
<EditBox name="AuxBuyTooltipInputBox" autoFocus="false" inherits="InputBoxTemplate"> <EditBox name="AuxBuyTooltipInputBox" autoFocus="false" inherits="InputBoxTemplate">
<Size><AbsDimension x="145" y="22"/></Size> <Size><AbsDimension x="110" y="22"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="557" y="0"/></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="-94"/></Offset></Anchor></Anchors>
<Layers> <Layers>
<Layer level="OVERLAY"> <Layer level="OVERLAY">
<FontString inherits="GameFontHighlightSmall" text="Tooltip"> <FontString inherits="GameFontHighlightSmall" text="Tooltip">
@@ -334,7 +329,6 @@
</EditBox> </EditBox>
<Frame name="AuxBuyTooltipDropDown" inherits="UIDropDownMenuTemplate" hidden="true"> <Frame name="AuxBuyTooltipDropDown" inherits="UIDropDownMenuTemplate" hidden="true">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="555" y="0"/></Offset></Anchor></Anchors>
<Scripts> <Scripts>
<OnLoad> <OnLoad>
UIDropDownMenu_Initialize(this, AuxBuyTooltipDropDown_Initialize) UIDropDownMenu_Initialize(this, AuxBuyTooltipDropDown_Initialize)
@@ -351,59 +345,42 @@
</OnClick> </OnClick>
</Scripts> </Scripts>
<NormalTexture name="$parentNormalTexture" file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Up"> <NormalTexture name="$parentNormalTexture" file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Up">
<Size> <Size><AbsDimension x="24" y="24"/></Size>
<AbsDimension x="24" y="24"/> <Anchors><Anchor point="RIGHT"/></Anchors>
</Size>
<Anchors>
<Anchor point="RIGHT"/>
</Anchors>
</NormalTexture> </NormalTexture>
<PushedTexture name="$parentPushedTexture" file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Down"> <PushedTexture name="$parentPushedTexture" file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Down">
<Size> <Size><AbsDimension x="24" y="24"/></Size>
<AbsDimension x="24" y="24"/> <Anchors><Anchor point="RIGHT"/></Anchors>
</Size>
<Anchors>
<Anchor point="RIGHT"/>
</Anchors>
</PushedTexture> </PushedTexture>
<DisabledTexture name="$parentDisabledTexture" file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Disabled"> <DisabledTexture name="$parentDisabledTexture" file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Disabled">
<Size> <Size><AbsDimension x="24" y="24"/></Size>
<AbsDimension x="24" y="24"/> <Anchors><Anchor point="RIGHT"/></Anchors>
</Size>
<Anchors>
<Anchor point="RIGHT"/>
</Anchors>
</DisabledTexture> </DisabledTexture>
<HighlightTexture name="$parentHighlightTexture" file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"> <HighlightTexture name="$parentHighlightTexture" file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD">
<Size> <Size><AbsDimension x="24" y="24"/></Size>
<AbsDimension x="24" y="24"/> <Anchors><Anchor point="RIGHT"/></Anchors>
</Size>
<Anchors>
<Anchor point="RIGHT"/>
</Anchors>
</HighlightTexture> </HighlightTexture>
</Button> </Button>
<Button name="AuxBuyTooltipButton" inherits="UIPanelButtonTemplate" text="+"> <Button name="AuxBuyTooltipButton" inherits="UIPanelButtonTemplate" text="+">
<Size><AbsDimension x="22" y="22"/></Size> <Size><AbsDimension x="22" y="22"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="720" y="0"/></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="127" y="-94"/></Offset></Anchor></Anchors>
<Scripts> <Scripts>
<OnClick> <OnClick>
AuxBuyTooltipButton_OnClick(this) AuxBuyTooltipButton_OnClick(this)
</OnClick> </OnClick>
</Scripts> </Scripts>
</Button> </Button>
<Frame name="AuxBuyQualityDropDown" inherits="UIDropDownMenuTemplate">
<!-- <Frame name="AuxBuySlotDropDown" inherits="UIDropDownMenuTemplate"> <Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="-124" /></Offset></Anchor></Anchors>
<Anchors><Anchor point="LEFT"><Offset><AbsDimension x="500" y="1" /></Offset></Anchor></Anchors>
<Scripts> <Scripts>
<OnLoad> <OnLoad>
UIDropDownMenu_Initialize(this, AuxBuySlotDropDown_Initialize) UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize)
</OnLoad> </OnLoad>
<OnShow> <OnShow>
UIDropDownMenu_Initialize(this, AuxBuySlotDropDown_Initialize) UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize)
</OnShow> </OnShow>
</Scripts> </Scripts>
</Frame> --> </Frame>
</Frames> </Frames>
</Frame> </Frame>
+2 -23
View File
@@ -73,30 +73,9 @@ function Aux_OnAddonLoaded()
AuctionsBidSort, AuctionsBidSort,
AuctionsCancelAuctionButton AuctionsCancelAuctionButton
} }
Aux.tabs.buy.hiddenElements = { Aux.tabs.buy.hiddenElements = {
AuctionFrameBrowse, AuctionFrameBrowse,
BidTitle,
BidScrollFrame,
BidButton1,
BidButton2,
BidButton3,
BidButton4,
BidButton5,
BidButton6,
BidButton7,
BidButton8,
BidButton9,
BidQualitySort,
BidLevelSort,
BidDurationSort,
BidBuyoutSort,
BidStatusSort,
BidBidSort,
BidBidButton,
BidBuyoutButton,
BidBidPrice,
BidBidText
} }
Aux.tabs.sell.recommendationElements = { Aux.tabs.sell.recommendationElements = {
@@ -246,7 +225,7 @@ function Aux_AuctionFrameTab_OnClick(index)
AuctionFrame:EnableMouse(false) AuctionFrame:EnableMouse(false)
elseif index == Aux.tabs.buy.index then elseif index == Aux.tabs.buy.index then
AuctionFrameTab_OnClick(2) Aux.orig.AuctionFrameTab_OnClick(1)
PanelTemplates_SetTab(AuctionFrame, Aux.tabs.buy.index) PanelTemplates_SetTab(AuctionFrame, Aux.tabs.buy.index)
+79 -37
View File
@@ -2,7 +2,7 @@ Aux.list = {}
local MAX_COLUMNS = 6 local MAX_COLUMNS = 6
local NAME, OWNER, BID, BID_UNIT, BUYOUT, BUYOUT_UNIT, QUANTITY = 1, 2, 3, 4, 5, 6, 7, 8 local NAME, OWNER, BID, BID_UNIT, BUYOUT, BUYOUT_UNIT, QUANTITY, TIME_LEFT = 1, 2, 3, 4, 5, 6, 7, 8
MoneyTypeInfo["AUX_LIST"] = { MoneyTypeInfo["AUX_LIST"] = {
UpdateFunc = function() UpdateFunc = function()
@@ -15,10 +15,11 @@ MoneyTypeInfo["AUX_LIST"] = {
local logical_columns = { local logical_columns = {
{ {
type = 'STRING', type = 'ITEM',
title = 'Name', title = 'Auction Item',
comparator = function(row1, row2) return Aux.util.compare(row1.name, row2.name, Aux.util.GT) end, texture = function(row) return row.texture end,
getter = function(row) return row.name 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, color = function(row) return ITEM_QUALITY_COLORS[row.quality] end,
}, },
{ {
@@ -53,38 +54,61 @@ local logical_columns = {
}, },
{ {
type = 'NUMBER', type = 'NUMBER',
title = 'Quantity', title = '#',
comparator = function(row1, row2) return Aux.util.compare(row1.stack_size, row2.stack_size, Aux.util.LT) end, 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, getter = function(row) return row.stack_size end,
}, },
{ {
type = 'STRING', type = 'STRING',
title = 'Time Left', title = 'Left',
comparator = function(row1, row2) return Aux.util.compare(row1.duration, row2.duration, Aux.util.GT) end, comparator = function(row1, row2) return Aux.util.compare(row1.duration, row2.duration, Aux.util.GT) end,
getter = function(row) getter = function(row)
if row.duration == 1 then if row.duration == 1 then
return 'Short' return '30m'
elseif row.duration == 2 then elseif row.duration == 2 then
return 'Medium' return '2h'
elseif row.duration == 3 then elseif row.duration == 3 then
return 'Long' return '8h'
elseif row.duration == 4 then elseif row.duration == 4 then
return 'Very Long' return '12h'
end end
end, end,
}, },
} }
local physical_columns = { local physical_columns = {
{ logical_column = logical_columns[NAME], width = 156 }, {
{ logical_column = logical_columns[OWNER], width = 156 }, logical_columns = { logical_columns[QUANTITY] },
{ logical_column = logical_columns[BUYOUT_UNIT], width = 156 }, logical_column = logical_columns[QUANTITY],
{ logical_column = logical_columns[QUANTITY], width = 156 }, width = 30
{ logical_column = logical_columns[BUYOUT], width = 156 }, },
{
logical_columns = { logical_columns[NAME] },
logical_column = logical_columns[NAME],
width = 180
},
{
logical_columns = { logical_columns[TIME_LEFT] },
logical_column = logical_columns[TIME_LEFT],
width = 40
},
{
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 = 140
},
{
logical_columns = { logical_columns[BID], logical_columns[BUYOUT] },
logical_column = logical_columns[BUYOUT],
width = 140
},
} }
function Aux.list.on_load() function Aux.list.on_load()
Aux.list.initialize(this, physical_columns, logical_columns) Aux.list.initialize(this, physical_columns, logical_columns)
end end
@@ -120,11 +144,12 @@ function Aux.list.initialize(frame, physical_columns, logical_columns)
frame.sort_order = {} frame.sort_order = {}
for i, logical_column in logical_columns do for i, logical_column in logical_columns do
if i ~= BUYOUT_UNIT then if i ~= BUYOUT_UNIT and i ~= NAME then
tinsert(frame.sort_order, { logical_column = logical_column, sort_ascending = true }) tinsert(frame.sort_order, { logical_column = logical_column, sort_ascending = true })
end end
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[BUYOUT_UNIT], sort_ascending = true })
tinsert(frame.sort_order, 1, { logical_column = logical_columns[NAME], sort_ascending = true })
for i = 1, MAX_COLUMNS do for i = 1, MAX_COLUMNS do
local button = getglobal(frame:GetName().."Column"..i.."Sort") local button = getglobal(frame:GetName().."Column"..i.."Sort")
@@ -136,7 +161,11 @@ function Aux.list.initialize(frame, physical_columns, logical_columns)
getglobal(button:GetName().."Arrow"):Hide() getglobal(button:GetName().."Arrow"):Hide()
getglobal(button:GetName().."Text"):SetText(logical_column.title) getglobal(button:GetName().."Text"):SetText(logical_column.title)
button:Show() button:Show()
dropdown: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); Aux.list.set_column_width(frame, i, physical_column.width);
else else
@@ -160,7 +189,7 @@ function Aux.list.set_column_width(frame, column_index, width)
for line = 1, frame.lines do for line = 1, frame.lines do
local text = getglobal(frame:GetName().."Item"..line.."Column"..column_index) local text = getglobal(frame:GetName().."Item"..line.."Column"..column_index)
if text then if text then
text:SetWidth(width - 20) text:SetWidth(width - 3)
end end
end end
end end
@@ -264,20 +293,29 @@ function Aux.list.scroll_frame_update(frame)
if row_index <= getn(content) then if row_index <= getn(content) then
for column_index = 1, MAX_COLUMNS do 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) local text = getglobal(parent:GetName().."Item"..line.."Column"..column_index)
-- text:Hide() TODO -- text:Hide() TODO
text:SetText() text:SetText()
local moneyFrame = getglobal(parent:GetName().."Item"..line.."Column"..column_index.."MoneyFrame") local moneyFrame = getglobal(parent:GetName().."Item"..line.."Column"..column_index.."MoneyFrame")
moneyFrame:Hide() moneyFrame:Hide()
if column_index <= table.getn(parent.physical_columns) then if column_index <= table.getn(parent.physical_columns) then
local physical_column = parent.physical_columns[column_index] local physical_column = parent.physical_columns[column_index]
local logical_column = physical_column.logical_column local logical_column = physical_column.logical_column
local value = logical_column.getter(content[row_index]) local value = logical_column.getter(content[row_index])
if value then if value then
if text and (logical_column.type == "DATE" or logical_column.type == "NUMBER" or logical_column.type == "STRING") 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) text:SetText(value)
if logical_column.color then if logical_column.color then
local color = logical_column.color(content[row_index]) local color = logical_column.color(content[row_index])
@@ -290,11 +328,11 @@ function Aux.list.scroll_frame_update(frame)
else else
text:SetAlpha(1.0) text:SetAlpha(1.0)
end end
if (logical_column.type == "NUMBER") then -- if (logical_column.type == "NUMBER") then
text:SetJustifyH("RIGHT") -- text:SetJustifyH("RIGHT")
else -- else
text:SetJustifyH("LEFT") -- text:SetJustifyH("LEFT")
end -- end
text:Show() text:Show()
elseif moneyFrame and logical_column.type == "MONEY" then elseif moneyFrame and logical_column.type == "MONEY" then
if value >= 0 then if value >= 0 then
@@ -341,13 +379,17 @@ end
function Aux.list.dropdown_initialize() function Aux.list.dropdown_initialize()
local dropdown = this:GetParent() local dropdown = this:GetParent()
local frame = dropdown:GetParent() local frame = dropdown:GetParent()
for _, logical_column in pairs(frame.logical_columns) do if frame.physical_columns then
UIDropDownMenu_AddButton({ local physical_column_index = dropdown:GetID()
text = logical_column.title, local physical_column = frame.physical_columns[physical_column_index]
owner = dropdown, for _, logical_column in pairs(physical_column.logical_columns) do
func = Aux.list.dropdown_item_onclick UIDropDownMenu_AddButton({
}) text = logical_column.title,
owner = dropdown,
func = Aux.list.dropdown_item_onclick,
})
end
end end
end end
@@ -358,9 +400,9 @@ function Aux.list.dropdown_item_onclick()
local physical_column_index = this.owner:GetID() local physical_column_index = this.owner:GetID()
local dropdown = this.owner local dropdown = this.owner
local frame = dropdown:GetParent() local frame = dropdown:GetParent()
if (frame.physical_columns[physical_column_index].logical_column ~= frame.logical_columns[logical_column_index]) then if frame.physical_columns[physical_column_index].logical_column ~= frame.logical_columns[logical_column_index] then
frame.physical_columns[physical_column_index].logical_column = frame.logical_columns[logical_column_index] 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) 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.content, Aux.list.row_comparator(frame))
+56 -16
View File
@@ -3,38 +3,78 @@
<Script file="list.lua"/> <Script file="list.lua"/>
<Button name="ListItemTemplate" hidden="false" virtual="true"> <Button name="ListItemTemplate" hidden="false" virtual="true">
<Size><AbsDimension x="776" y="16"/></Size> <Size><AbsDimension x="615" y="16"/></Size>
<Layers> <Layers>
<Layer level="BORDER"> <Layer level="BORDER">
<FontString name="$parentColumn1" inherits="GameFontHighlight" wraponspaces="false" justifyH="LEFT"> <FontString name="$parentColumn1" inherits="GameFontHighlight" wraponspaces="false" justifyH="RIGHT">
<Size><AbsDimension x="100" y="16"/></Size> <Size><AbsDimension x="100" y="16"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-2" y="0"/></Offset></Anchor></Anchors>
</FontString> </FontString>
<FontString name="$parentColumn2" inherits="GameFontHighlight" wraponspaces="false" justifyH="LEFT"> <FontString name="$parentColumn2" inherits="GameFontHighlight" wraponspaces="false" justifyH="LEFT">
<Size><AbsDimension x="100" y="16"/></Size> <Size><AbsDimension x="100" y="16"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn1" relativePoint="TOPRIGHT"><Offset><AbsDimension x="20" y="0"/></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn1" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
</FontString> </FontString>
<FontString name="$parentColumn3" inherits="GameFontHighlight" wraponspaces="false" justifyH="LEFT"> <FontString name="$parentColumn3" inherits="GameFontHighlight" wraponspaces="false" justifyH="CENTER">
<Size><AbsDimension x="100" y="16"/></Size> <Size><AbsDimension x="100" y="16"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn2" relativePoint="TOPRIGHT"><Offset><AbsDimension x="20" y="0"/></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn2" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
</FontString> </FontString>
<FontString name="$parentColumn4" inherits="GameFontHighlight" wraponspaces="false" justifyH="LEFT"> <FontString name="$parentColumn4" inherits="GameFontHighlight" wraponspaces="false" justifyH="LEFT">
<Size><AbsDimension x="100" y="16"/></Size> <Size><AbsDimension x="100" y="16"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn3" relativePoint="TOPRIGHT"><Offset><AbsDimension x="20" y="0"/></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn3" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
</FontString> </FontString>
<FontString name="$parentColumn5" inherits="GameFontHighlight" wraponspaces="false" justifyH="LEFT"> <FontString name="$parentColumn5" inherits="GameFontHighlight" wraponspaces="false" justifyH="LEFT">
<Size><AbsDimension x="100" y="16"/></Size> <Size><AbsDimension x="100" y="16"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn4" relativePoint="TOPRIGHT"><Offset><AbsDimension x="20" y="0"/></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn4" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
</FontString> </FontString>
<FontString name="$parentColumn6" inherits="GameFontHighlight" wraponspaces="false" justifyH="RIGHT"> <FontString name="$parentColumn6" inherits="GameFontHighlight" wraponspaces="false" justifyH="RIGHT">
<Size><AbsDimension x="100" y="16"/></Size> <Size><AbsDimension x="100" y="16"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn5" relativePoint="TOPRIGHT"><Offset><AbsDimension x="20" y="0"/></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn5" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
</FontString> </FontString>
</Layer> </Layer>
</Layers> </Layers>
<Frames> <Frames>
<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="$parentColumn1MoneyFrame" inherits="SmallMoneyFrameTemplate"> <Frame name="$parentColumn1MoneyFrame" inherits="SmallMoneyFrameTemplate">
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn1" relativePoint="TOPRIGHT"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn1" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
<Scripts> <Scripts>
<OnLoad> <OnLoad>
SmallMoneyFrame_OnLoad() SmallMoneyFrame_OnLoad()
@@ -43,7 +83,7 @@
</Scripts> </Scripts>
</Frame> </Frame>
<Frame name="$parentColumn2MoneyFrame" inherits="SmallMoneyFrameTemplate"> <Frame name="$parentColumn2MoneyFrame" inherits="SmallMoneyFrameTemplate">
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn2" relativePoint="TOPRIGHT"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn2" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
<Scripts> <Scripts>
<OnLoad> <OnLoad>
SmallMoneyFrame_OnLoad() SmallMoneyFrame_OnLoad()
@@ -52,7 +92,7 @@
</Scripts> </Scripts>
</Frame> </Frame>
<Frame name="$parentColumn3MoneyFrame" inherits="SmallMoneyFrameTemplate"> <Frame name="$parentColumn3MoneyFrame" inherits="SmallMoneyFrameTemplate">
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn3" relativePoint="TOPRIGHT"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn3" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
<Scripts> <Scripts>
<OnLoad> <OnLoad>
SmallMoneyFrame_OnLoad() SmallMoneyFrame_OnLoad()
@@ -61,7 +101,7 @@
</Scripts> </Scripts>
</Frame> </Frame>
<Frame name="$parentColumn4MoneyFrame" inherits="SmallMoneyFrameTemplate"> <Frame name="$parentColumn4MoneyFrame" inherits="SmallMoneyFrameTemplate">
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn4" relativePoint="TOPRIGHT"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn4" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
<Scripts> <Scripts>
<OnLoad> <OnLoad>
SmallMoneyFrame_OnLoad() SmallMoneyFrame_OnLoad()
@@ -70,7 +110,7 @@
</Scripts> </Scripts>
</Frame> </Frame>
<Frame name="$parentColumn5MoneyFrame" inherits="SmallMoneyFrameTemplate"> <Frame name="$parentColumn5MoneyFrame" inherits="SmallMoneyFrameTemplate">
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn5" relativePoint="TOPRIGHT"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn5" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
<Scripts> <Scripts>
<OnLoad> <OnLoad>
SmallMoneyFrame_OnLoad() SmallMoneyFrame_OnLoad()
@@ -79,7 +119,7 @@
</Scripts> </Scripts>
</Frame> </Frame>
<Frame name="$parentColumn6MoneyFrame" inherits="SmallMoneyFrameTemplate"> <Frame name="$parentColumn6MoneyFrame" inherits="SmallMoneyFrameTemplate">
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn6" relativePoint="TOPRIGHT"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn6" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
<Scripts> <Scripts>
<OnLoad> <OnLoad>
SmallMoneyFrame_OnLoad() SmallMoneyFrame_OnLoad()
@@ -318,7 +358,7 @@
<Anchors> <Anchors>
<Anchor point="TOPLEFT"> <Anchor point="TOPLEFT">
<Offset> <Offset>
<AbsDimension x="2" y="-28"/> <AbsDimension x="0" y="-28"/>
</Offset> </Offset>
</Anchor> </Anchor>
<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT"> <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT">