working on redesign and new features for buy
This commit is contained in:
@@ -154,6 +154,9 @@ 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"
|
||||
|
||||
@@ -261,8 +264,10 @@ function AuxBuyEntry_OnClick(entry_index)
|
||||
}
|
||||
end
|
||||
|
||||
function AuxBuyEntry_OnEnter(entry_index)
|
||||
local entry = entries[entry_index]
|
||||
function Aux.buy.icon_on_enter()
|
||||
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)
|
||||
|
||||
@@ -279,11 +284,12 @@ function process_auction(auction_item, current_page)
|
||||
local stack_size = auction_item.charges or auction_item.count
|
||||
local bid = auction_item.current_bid > 0 and auction_item.current_bid or auction_item.min_bid + auction_item.min_increment
|
||||
local buyout_price = auction_item.buyout_price > 0 and auction_item.buyout_price or nil
|
||||
local buyout_price_per_unit = buyout_price and Aux_Round(auction_item.buyout_price / stack_size)
|
||||
local buyout_price_per_unit = buyout_price and Aux_Round(auction_item.buyout_price/stack_size)
|
||||
|
||||
if auction_item.owner ~= UnitName("player") then
|
||||
tinsert(entries, {
|
||||
name = auction_item.name,
|
||||
texture = auction_item.texture,
|
||||
tooltip = auction_item.tooltip,
|
||||
stack_size = stack_size,
|
||||
buyout_price = buyout_price,
|
||||
@@ -293,7 +299,7 @@ function process_auction(auction_item, current_page)
|
||||
itemstring = auction_item.itemstring,
|
||||
page = current_page,
|
||||
bid = bid,
|
||||
bid_per_unit = Aux_Round(bid / stack_size),
|
||||
bid_per_unit = Aux_Round(bid/stack_size),
|
||||
owner = auction_item.owner,
|
||||
duration = auction_item.duration,
|
||||
})
|
||||
@@ -335,7 +341,7 @@ function AuxBuyCategoryDropDown_Initialize(arg1)
|
||||
if level == 1 then
|
||||
local value = {}
|
||||
UIDropDownMenu_AddButton({
|
||||
text= 'All',
|
||||
text = ALL,
|
||||
value = value,
|
||||
func = AuxBuyCategoryDropDown_OnClick,
|
||||
}, 1)
|
||||
@@ -394,25 +400,24 @@ function AuxBuyCategoryDropDown_OnClick()
|
||||
CloseDropDownMenus(1)
|
||||
end
|
||||
|
||||
function AuxBuySlotDropDown_Initialize()
|
||||
function AuxBuyQualityDropDown_Initialize()
|
||||
|
||||
UIDropDownMenu_AddButton{
|
||||
text= 'All',
|
||||
value = value,
|
||||
func = AuxBuySlotDropDown_OnClick('All', value),
|
||||
text = ALL,
|
||||
value = -1,
|
||||
func = AuxBuyQualityDropDown_OnClick,
|
||||
}
|
||||
|
||||
-- for i, type in pairs({ GetAuctionInvTypes() }) do
|
||||
-- UIDropDownMenu_AddButton{
|
||||
-- text = class,
|
||||
-- value = i,
|
||||
-- func = AuxBuySlotDropDown_OnClick(),
|
||||
-- }
|
||||
-- end
|
||||
for i=0,getn(ITEM_QUALITY_COLORS)-2 do
|
||||
UIDropDownMenu_AddButton{
|
||||
text = getglobal("ITEM_QUALITY"..i.."_DESC"),
|
||||
value = i,
|
||||
func = AuxBuyQualityDropDown_OnClick,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function AuxBuySlotDropDown_OnClick()
|
||||
UIDropDownMenu_SetSelectedValue(AuxBuySlotDropDown, this.value)
|
||||
function AuxBuyQualityDropDown_OnClick()
|
||||
UIDropDownMenu_SetSelectedValue(AuxBuyQualityDropDown, this.value)
|
||||
end
|
||||
|
||||
function AuxBuyTooltipButton_OnClick()
|
||||
|
||||
@@ -17,11 +17,6 @@
|
||||
<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()
|
||||
@@ -65,8 +60,8 @@
|
||||
</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>
|
||||
<Size><AbsDimension x="615" y="334"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="187" y="-77"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
Aux.list.on_load(this)
|
||||
@@ -212,10 +207,10 @@
|
||||
|
||||
<Frame name="AuxBuyFilters">
|
||||
<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>
|
||||
<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>
|
||||
<Layers>
|
||||
<Layer level="OVERLAY">
|
||||
@@ -250,7 +245,7 @@
|
||||
|
||||
<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>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="123" y="0" /></Offset></Anchor></Anchors>
|
||||
<Layers>
|
||||
<Layer level="OVERLAY">
|
||||
<FontString inherits="GameFontHighlightSmall" text="Exact">
|
||||
@@ -267,7 +262,7 @@
|
||||
</CheckButton>
|
||||
|
||||
<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>
|
||||
<Layer level="OVERLAY">
|
||||
<FontString inherits="GameFontHighlightSmall" text="Category">
|
||||
@@ -284,7 +279,7 @@
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize)
|
||||
UIDropDownMenu_SetWidth(200)
|
||||
UIDropDownMenu_SetWidth(140)
|
||||
</OnLoad>
|
||||
<OnShow>
|
||||
UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize)
|
||||
@@ -294,7 +289,7 @@
|
||||
|
||||
<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>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="-65" /></Offset></Anchor></Anchors>
|
||||
<Layers>
|
||||
<Layer level="OVERLAY">
|
||||
<FontString inherits="GameFontHighlightSmall" text="Usable">
|
||||
@@ -311,8 +306,8 @@
|
||||
</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>
|
||||
<Size><AbsDimension x="110" y="22"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="-94"/></Offset></Anchor></Anchors>
|
||||
<Layers>
|
||||
<Layer level="OVERLAY">
|
||||
<FontString inherits="GameFontHighlightSmall" text="Tooltip">
|
||||
@@ -334,7 +329,6 @@
|
||||
</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)
|
||||
@@ -351,59 +345,42 @@
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
<NormalTexture name="$parentNormalTexture" file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Up">
|
||||
<Size>
|
||||
<AbsDimension x="24" y="24"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="RIGHT"/>
|
||||
</Anchors>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="127" y="-94"/></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>
|
||||
<Frame name="AuxBuyQualityDropDown" inherits="UIDropDownMenuTemplate">
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="-124" /></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
UIDropDownMenu_Initialize(this, AuxBuySlotDropDown_Initialize)
|
||||
UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize)
|
||||
</OnLoad>
|
||||
<OnShow>
|
||||
UIDropDownMenu_Initialize(this, AuxBuySlotDropDown_Initialize)
|
||||
UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize)
|
||||
</OnShow>
|
||||
</Scripts>
|
||||
</Frame> -->
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
|
||||
|
||||
@@ -73,30 +73,9 @@ function Aux_OnAddonLoaded()
|
||||
AuctionsBidSort,
|
||||
AuctionsCancelAuctionButton
|
||||
}
|
||||
|
||||
|
||||
Aux.tabs.buy.hiddenElements = {
|
||||
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 = {
|
||||
@@ -246,7 +225,7 @@ function Aux_AuctionFrameTab_OnClick(index)
|
||||
AuctionFrame:EnableMouse(false)
|
||||
|
||||
elseif index == Aux.tabs.buy.index then
|
||||
AuctionFrameTab_OnClick(2)
|
||||
Aux.orig.AuctionFrameTab_OnClick(1)
|
||||
|
||||
PanelTemplates_SetTab(AuctionFrame, Aux.tabs.buy.index)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ Aux.list = {}
|
||||
|
||||
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"] = {
|
||||
UpdateFunc = function()
|
||||
@@ -15,10 +15,11 @@ MoneyTypeInfo["AUX_LIST"] = {
|
||||
|
||||
local logical_columns = {
|
||||
{
|
||||
type = 'STRING',
|
||||
title = 'Name',
|
||||
comparator = function(row1, row2) return Aux.util.compare(row1.name, row2.name, Aux.util.GT) end,
|
||||
getter = function(row) return row.name end,
|
||||
type = 'ITEM',
|
||||
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,
|
||||
},
|
||||
{
|
||||
@@ -53,38 +54,61 @@ local logical_columns = {
|
||||
},
|
||||
{
|
||||
type = 'NUMBER',
|
||||
title = 'Quantity',
|
||||
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,
|
||||
},
|
||||
{
|
||||
type = 'STRING',
|
||||
title = 'Time Left',
|
||||
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 'Short'
|
||||
return '30m'
|
||||
elseif row.duration == 2 then
|
||||
return 'Medium'
|
||||
return '2h'
|
||||
elseif row.duration == 3 then
|
||||
return 'Long'
|
||||
return '8h'
|
||||
elseif row.duration == 4 then
|
||||
return 'Very Long'
|
||||
return '12h'
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
local physical_columns = {
|
||||
{ logical_column = logical_columns[NAME], width = 156 },
|
||||
{ logical_column = logical_columns[OWNER], width = 156 },
|
||||
{ logical_column = logical_columns[BUYOUT_UNIT], width = 156 },
|
||||
{ logical_column = logical_columns[QUANTITY], width = 156 },
|
||||
{ logical_column = logical_columns[BUYOUT], width = 156 },
|
||||
{
|
||||
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[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()
|
||||
Aux.list.initialize(this, physical_columns, logical_columns)
|
||||
end
|
||||
@@ -120,11 +144,12 @@ function Aux.list.initialize(frame, physical_columns, logical_columns)
|
||||
|
||||
frame.sort_order = {}
|
||||
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 })
|
||||
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")
|
||||
@@ -136,7 +161,11 @@ function Aux.list.initialize(frame, physical_columns, logical_columns)
|
||||
getglobal(button:GetName().."Arrow"):Hide()
|
||||
getglobal(button:GetName().."Text"):SetText(logical_column.title)
|
||||
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);
|
||||
else
|
||||
@@ -160,7 +189,7 @@ function Aux.list.set_column_width(frame, column_index, width)
|
||||
for line = 1, frame.lines do
|
||||
local text = getglobal(frame:GetName().."Item"..line.."Column"..column_index)
|
||||
if text then
|
||||
text:SetWidth(width - 20)
|
||||
text:SetWidth(width - 3)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -264,20 +293,29 @@ function Aux.list.scroll_frame_update(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()
|
||||
|
||||
local moneyFrame = getglobal(parent:GetName().."Item"..line.."Column"..column_index.."MoneyFrame")
|
||||
moneyFrame:Hide()
|
||||
|
||||
|
||||
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 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)
|
||||
if logical_column.color then
|
||||
local color = logical_column.color(content[row_index])
|
||||
@@ -290,11 +328,11 @@ function Aux.list.scroll_frame_update(frame)
|
||||
else
|
||||
text:SetAlpha(1.0)
|
||||
end
|
||||
if (logical_column.type == "NUMBER") then
|
||||
text:SetJustifyH("RIGHT")
|
||||
else
|
||||
text:SetJustifyH("LEFT")
|
||||
end
|
||||
-- if (logical_column.type == "NUMBER") then
|
||||
-- text:SetJustifyH("RIGHT")
|
||||
-- else
|
||||
-- text:SetJustifyH("LEFT")
|
||||
-- end
|
||||
text:Show()
|
||||
elseif moneyFrame and logical_column.type == "MONEY" then
|
||||
if value >= 0 then
|
||||
@@ -341,13 +379,17 @@ end
|
||||
function Aux.list.dropdown_initialize()
|
||||
local dropdown = this:GetParent()
|
||||
local frame = dropdown:GetParent()
|
||||
|
||||
for _, logical_column in pairs(frame.logical_columns) do
|
||||
UIDropDownMenu_AddButton({
|
||||
text = logical_column.title,
|
||||
owner = dropdown,
|
||||
func = Aux.list.dropdown_item_onclick
|
||||
})
|
||||
|
||||
if frame.physical_columns then
|
||||
local physical_column_index = dropdown:GetID()
|
||||
local physical_column = frame.physical_columns[physical_column_index]
|
||||
for _, logical_column in pairs(physical_column.logical_columns) do
|
||||
UIDropDownMenu_AddButton({
|
||||
text = logical_column.title,
|
||||
owner = dropdown,
|
||||
func = Aux.list.dropdown_item_onclick,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -358,9 +400,9 @@ function Aux.list.dropdown_item_onclick()
|
||||
local physical_column_index = this.owner:GetID()
|
||||
local dropdown = this.owner
|
||||
local frame = dropdown:GetParent()
|
||||
if (frame.physical_columns[physical_column_index].logical_column ~= frame.logical_columns[logical_column_index]) then
|
||||
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)
|
||||
|
||||
Aux.util.merge_sort(frame.content, Aux.list.row_comparator(frame))
|
||||
|
||||
@@ -3,38 +3,78 @@
|
||||
<Script file="list.lua"/>
|
||||
|
||||
<Button name="ListItemTemplate" hidden="false" virtual="true">
|
||||
<Size><AbsDimension x="776" y="16"/></Size>
|
||||
<Size><AbsDimension x="615" y="16"/></Size>
|
||||
<Layers>
|
||||
<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>
|
||||
<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 name="$parentColumn2" inherits="GameFontHighlight" wraponspaces="false" justifyH="LEFT">
|
||||
<Size><AbsDimension x="100" y="16"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn1" relativePoint="TOPRIGHT"><Offset><AbsDimension x="20" y="0"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn1" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
|
||||
</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>
|
||||
<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 name="$parentColumn4" inherits="GameFontHighlight" wraponspaces="false" justifyH="LEFT">
|
||||
<Size><AbsDimension x="100" y="16"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn3" relativePoint="TOPRIGHT"><Offset><AbsDimension x="20" y="0"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn3" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
<FontString name="$parentColumn5" inherits="GameFontHighlight" wraponspaces="false" justifyH="LEFT">
|
||||
<Size><AbsDimension x="100" y="16"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn4" relativePoint="TOPRIGHT"><Offset><AbsDimension x="20" y="0"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn4" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
<FontString name="$parentColumn6" inherits="GameFontHighlight" wraponspaces="false" justifyH="RIGHT">
|
||||
<Size><AbsDimension x="100" y="16"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn5" relativePoint="TOPRIGHT"><Offset><AbsDimension x="20" y="0"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn5" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
</Layer>
|
||||
</Layers>
|
||||
<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">
|
||||
<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>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
@@ -43,7 +83,7 @@
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<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>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
@@ -52,7 +92,7 @@
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<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>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
@@ -61,7 +101,7 @@
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentColumn4MoneyFrame" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn4" relativePoint="TOPRIGHT"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn4" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
@@ -70,7 +110,7 @@
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentColumn5MoneyFrame" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn5" relativePoint="TOPRIGHT"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn5" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
@@ -79,7 +119,7 @@
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentColumn6MoneyFrame" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn6" relativePoint="TOPRIGHT"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn6" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
@@ -318,7 +358,7 @@
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT">
|
||||
<Offset>
|
||||
<AbsDimension x="2" y="-28"/>
|
||||
<AbsDimension x="0" y="-28"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT">
|
||||
|
||||
Reference in New Issue
Block a user