big progress on the item search and manage tabs
This commit is contained in:
+108
-9
@@ -68,9 +68,7 @@ function Aux.completion.completor(edit_box)
|
||||
value = suggestion.value,
|
||||
notCheckable = true,
|
||||
func = function()
|
||||
-- self.set_quietly(text)
|
||||
Aux.item_search_frame.set_item(this.value)
|
||||
AuxItemSearchFrameItemItemInputBox:ClearFocus()
|
||||
self.set_quietly(text)
|
||||
end,
|
||||
}
|
||||
end
|
||||
@@ -140,10 +138,9 @@ function Aux.completion.completor(edit_box)
|
||||
index = index > 0 and math.mod(index + 1, getn(suggestions) + 1) or 1
|
||||
update_highlighting()
|
||||
if index == 0 then
|
||||
-- self.set_quietly(input)
|
||||
self.set_quietly(input)
|
||||
else
|
||||
-- self.set_quietly(suggestions[index].text)
|
||||
Aux.item_search_frame.set_item(suggestions[index].value)
|
||||
self.set_quietly(suggestions[index].text)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -154,13 +151,115 @@ function Aux.completion.completor(edit_box)
|
||||
index = index > 0 and index - 1 or getn(suggestions)
|
||||
update_highlighting()
|
||||
if index == 0 then
|
||||
-- self.set_quietly(input)
|
||||
self.set_quietly(input)
|
||||
else
|
||||
-- self.set_quietly(suggestions[index].text)
|
||||
Aux.item_search_frame.set_item(suggestions[index].value)
|
||||
self.set_quietly(suggestions[index].text)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
function Aux.completion.selector(edit_box)
|
||||
local self = {}
|
||||
|
||||
local suggestions = {}
|
||||
local index = 0
|
||||
local input
|
||||
|
||||
local fill_dropdown, update_dropdown, update_highlighting
|
||||
|
||||
function fill_dropdown()
|
||||
for i, suggestion in ipairs(suggestions) do
|
||||
local text = suggestion.text
|
||||
UIDropDownMenu_AddButton{
|
||||
text = suggestion.display_text,
|
||||
value = i,
|
||||
notCheckable = true,
|
||||
func = function()
|
||||
index = this.value
|
||||
AuxItemSearchFrameItemItemInputBox:ClearFocus()
|
||||
end,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function update_dropdown()
|
||||
function toggle()
|
||||
ToggleDropDownMenu(1, nil, AuxCompletionDropDown, edit_box, -12, 4)
|
||||
end
|
||||
|
||||
if DropDownList1:IsVisible() then
|
||||
toggle()
|
||||
end
|
||||
toggle()
|
||||
end
|
||||
|
||||
function update_highlighting()
|
||||
for i=1,32 do
|
||||
local highlight = getglobal('DropDownList1Button' .. i .. 'Highlight')
|
||||
if i == index then
|
||||
highlight:Show()
|
||||
else
|
||||
highlight:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function self.close()
|
||||
CloseDropDownMenus(1)
|
||||
end
|
||||
|
||||
function self.open()
|
||||
local _, owner = DropDownList1:GetPoint()
|
||||
return DropDownList1:IsVisible() and owner == edit_box
|
||||
end
|
||||
|
||||
function self.suggest()
|
||||
local new_input = edit_box:GetText()
|
||||
|
||||
input = new_input
|
||||
|
||||
if input == '' then
|
||||
suggestions = {}
|
||||
else
|
||||
suggestions = generate_suggestions(input)
|
||||
UIDropDownMenu_Initialize(AuxCompletionDropDown, function() fill_dropdown() end)
|
||||
end
|
||||
|
||||
index = 1
|
||||
update_highlighting()
|
||||
|
||||
update_dropdown()
|
||||
end
|
||||
|
||||
function self.next()
|
||||
update_dropdown()
|
||||
if getn(suggestions) > 0 then
|
||||
index = math.mod(index, getn(suggestions)) + 1
|
||||
update_highlighting()
|
||||
Aux.item_search_frame.set_item(suggestions[index].value)
|
||||
end
|
||||
end
|
||||
|
||||
function self.previous()
|
||||
update_dropdown()
|
||||
if getn(suggestions) > 0 then
|
||||
index = index > 1 and index - 1 or getn(suggestions)
|
||||
update_highlighting()
|
||||
Aux.item_search_frame.set_item(suggestions[index].value)
|
||||
end
|
||||
end
|
||||
|
||||
function self.selected_value()
|
||||
return suggestions[index] and suggestions[index].value
|
||||
end
|
||||
|
||||
function self.clear()
|
||||
index = 1
|
||||
suggestions = {}
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -4,5 +4,9 @@
|
||||
|
||||
<Frame name="AuxCompletionDropDown" inherits="UIDropDownMenuTemplate" hidden="true">
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="555" y="0"/></Offset></Anchor></Anchors>
|
||||
<OnUpdate>
|
||||
this.isCounting = false
|
||||
UIDropDownMenu_OnUpdate(arg1)
|
||||
</OnUpdate>
|
||||
</Frame>
|
||||
</Ui>
|
||||
@@ -32,20 +32,21 @@ function Aux_OnLoad()
|
||||
end
|
||||
|
||||
function Aux_OnEvent()
|
||||
if event == "VARIABLES_LOADED" then
|
||||
if event == 'VARIABLES_LOADED' then
|
||||
Aux_OnLoad()
|
||||
elseif event == "ADDON_LOADED" then
|
||||
elseif event == 'ADDON_LOADED' then
|
||||
Aux_OnAddonLoaded()
|
||||
elseif event == "AUCTION_HOUSE_SHOW" then
|
||||
elseif event == 'AUCTION_HOUSE_SHOW' then
|
||||
Aux_OnAuctionHouseShow()
|
||||
elseif event == "AUCTION_HOUSE_CLOSED" then
|
||||
elseif event == 'AUCTION_HOUSE_CLOSED' then
|
||||
Aux_OnAuctionHouseClosed()
|
||||
end
|
||||
elseif event == 'AUCTION_OWNED_LIST_UPDATE' then
|
||||
Aux.current_owner_page = Aux.last_owner_page_requested
|
||||
end
|
||||
end
|
||||
|
||||
function Aux_OnAddonLoaded()
|
||||
if string.lower(arg1) == "blizzard_auctionui" then
|
||||
AuctionFrame:SetScript('OnHide', nil)
|
||||
Aux_SetupHookFunctions()
|
||||
end
|
||||
end
|
||||
@@ -102,15 +103,23 @@ end
|
||||
|
||||
function Aux_SetupHookFunctions()
|
||||
|
||||
local blizzard_ui_on_hide = function()
|
||||
Aux.blizzard_ui_shown = false
|
||||
end
|
||||
AuctionFrame:SetScript('OnHide', blizzard_ui_on_hide)
|
||||
|
||||
Aux.orig.AuctionFrame_OnShow = AuctionFrame_OnShow
|
||||
-- TODO for some reason this breaks the auction house functionality
|
||||
-- AuctionFrame_OnShow = function()
|
||||
-- if not Aux.blizzard_ui_shown then
|
||||
-- HideUIPanel(AuctionFrame)
|
||||
-- else
|
||||
-- return Aux.orig.AuctionFrame_OnShow()
|
||||
-- end
|
||||
-- end
|
||||
AuctionFrame_OnShow = function()
|
||||
if not Aux.blizzard_ui_shown then
|
||||
Aux.control.as_soon_as(function() return AuctionFrame:GetScript('OnHide') == blizzard_ui_on_hide end, function()
|
||||
HideUIPanel(AuctionFrame)
|
||||
end)
|
||||
end
|
||||
return Aux.orig.AuctionFrame_OnShow()
|
||||
end
|
||||
|
||||
Aux.orig.GetOwnerAuctionItems = GetOwnerAuctionItems
|
||||
GetOwnerAuctionItems = Aux.GetOwnerAuctionItems
|
||||
|
||||
Aux.orig.PickupContainerItem = PickupContainerItem
|
||||
PickupContainerItem = Aux.PickupContainerItem
|
||||
@@ -123,6 +132,11 @@ function Aux_SetupHookFunctions()
|
||||
|
||||
end
|
||||
|
||||
function Aux.GetOwnerAuctionItems(page)
|
||||
Aux.last_owner_page_requested = page
|
||||
return Aux.orig.GetOwnerAuctionItems(page)
|
||||
end
|
||||
|
||||
function Aux.AuctionFrameAuctions_OnEvent()
|
||||
if AuctionFrameAuctions:IsVisible() then
|
||||
Aux.orig.AuctionFrameAuctions_OnEvent()
|
||||
@@ -147,7 +161,7 @@ function Aux_OnAuctionHouseClosed()
|
||||
Aux.stack.stop()
|
||||
Aux.scan.abort()
|
||||
|
||||
Aux.buy.on_close()
|
||||
Aux.filter_search_frame.on_close()
|
||||
Aux.sell.on_close()
|
||||
|
||||
AuxFrame:Hide()
|
||||
@@ -158,7 +172,7 @@ function Aux.on_tab_click(index)
|
||||
Aux.stack.stop()
|
||||
Aux.scan.abort(function()
|
||||
Aux.item_search_frame.on_close()
|
||||
Aux.buy.on_close()
|
||||
Aux.filter_search_frame.on_close()
|
||||
Aux.sell.on_close()
|
||||
Aux.manage_frame.on_close()
|
||||
Aux.history.on_close()
|
||||
@@ -168,7 +182,7 @@ function Aux.on_tab_click(index)
|
||||
end
|
||||
|
||||
AuxItemSearchFrame:Hide()
|
||||
AuxBuyFrame:Hide()
|
||||
AuxFilterSearchFrame:Hide()
|
||||
AuxSellFrame:Hide()
|
||||
AuxManageFrame:Hide()
|
||||
AuxHistoryFrame:Hide()
|
||||
@@ -177,7 +191,7 @@ function Aux.on_tab_click(index)
|
||||
AuxItemSearchFrame:Show()
|
||||
Aux.item_search_frame.on_open()
|
||||
elseif index == 2 then
|
||||
AuxBuyFrame:Show()
|
||||
AuxFilterSearchFrame:Show()
|
||||
Aux.filter_search_frame.on_open()
|
||||
elseif index == 3 then
|
||||
AuxSellFrame:Show()
|
||||
@@ -221,23 +235,23 @@ function Aux_ContainerFrameItemButton_OnClick(button)
|
||||
local bag, slot = this:GetParent():GetID(), this:GetID()
|
||||
local container_item = Aux.info.container_item(bag, slot)
|
||||
|
||||
if AuctionFrame:IsVisible() and button == "LeftButton" and container_item then
|
||||
|
||||
if IsShiftKeyDown()
|
||||
and not ChatFrameEditBox:IsVisible()
|
||||
and AuxBuyFrame:IsVisible()
|
||||
then
|
||||
AuxBuyNameInputBox.completor.set_quietly(container_item.name)
|
||||
return
|
||||
elseif AUX_BUY_SHORTCUT and IsAltKeyDown() then
|
||||
if not AuxBuyFrame:IsVisible() then
|
||||
Aux.on_tab_click(1)
|
||||
end
|
||||
AuxBuyNameInputBox.completor.set_quietly(container_item.name)
|
||||
Aux.buy.SearchButton_onclick()
|
||||
return
|
||||
end
|
||||
end
|
||||
-- if AuctionFrame:IsVisible() and button == "LeftButton" and container_item then
|
||||
--
|
||||
-- if IsShiftKeyDown()
|
||||
-- and not ChatFrameEditBox:IsVisible()
|
||||
-- and AuxBuyFrame:IsVisible()
|
||||
-- then
|
||||
-- AuxBuyNameInputBox.completor.set_quietly(container_item.name)
|
||||
-- return
|
||||
-- elseif AUX_BUY_SHORTCUT and IsAltKeyDown() then
|
||||
-- if not AuxBuyFrame:IsVisible() then
|
||||
-- Aux.on_tab_click(1)
|
||||
-- end
|
||||
-- AuxBuyNameInputBox.completor.set_quietly(container_item.name)
|
||||
-- Aux.filter_search_frame.start_search()
|
||||
-- return
|
||||
-- end
|
||||
-- end
|
||||
return Aux.orig.ContainerFrameItemButton_OnClick(button)
|
||||
end
|
||||
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
<Frame>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
this:RegisterEvent("VARIABLES_LOADED")
|
||||
this:RegisterEvent("ADDON_LOADED")
|
||||
this:RegisterEvent("AUCTION_HOUSE_SHOW")
|
||||
this:RegisterEvent("AUCTION_HOUSE_CLOSED")
|
||||
this:RegisterEvent('VARIABLES_LOADED')
|
||||
this:RegisterEvent('ADDON_LOADED')
|
||||
this:RegisterEvent('AUCTION_HOUSE_SHOW')
|
||||
this:RegisterEvent('AUCTION_HOUSE_CLOSED')
|
||||
this:RegisterEvent('AUCTION_OWNED_LIST_UPDATE')
|
||||
</OnLoad>
|
||||
<OnEvent>
|
||||
Aux_OnEvent()
|
||||
@@ -18,7 +19,7 @@
|
||||
|
||||
<Button name="AuxTopTabTemplate" virtual="true">
|
||||
<Size>
|
||||
<AbsDimension x="64" y="32"/>
|
||||
<AbsDimension x="100" y="32"/>
|
||||
</Size>
|
||||
<Layers>
|
||||
<Layer level="BACKGROUND">
|
||||
@@ -59,7 +60,7 @@
|
||||
</Scripts>
|
||||
<NormalText name="$parentText" inherits="GameFontHighlight">
|
||||
<Size>
|
||||
<AbsDimension x="50" y="8"/>
|
||||
<AbsDimension x="100" y="8"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="CENTER">
|
||||
@@ -89,7 +90,7 @@
|
||||
</Button>
|
||||
<Button name="AuxBottomTabTemplate" virtual="true">
|
||||
<Size>
|
||||
<AbsDimension x="64" y="32"/>
|
||||
<AbsDimension x="100" y="32"/>
|
||||
</Size>
|
||||
<Layers>
|
||||
<Layer level="BACKGROUND">
|
||||
@@ -131,9 +132,9 @@
|
||||
Aux.on_tab_click(this:GetID())
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
<NormalText name="$parentText" inherits="GameFontNormalSmall">
|
||||
<NormalText name="$parentText" inherits="GameFontNormal">
|
||||
<Size>
|
||||
<AbsDimension x="50" y="8"/>
|
||||
<AbsDimension x="100" y="8"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="CENTER">
|
||||
@@ -372,7 +373,7 @@
|
||||
</EdgeSize>
|
||||
</Backdrop>
|
||||
<Frames>
|
||||
<Button name="AuxCloseButtonTop" inherits="UIPanelCloseButton">
|
||||
<Button name="AuxCloseButton" inherits="UIPanelCloseButton">
|
||||
<Anchors>
|
||||
<Anchor point="TOPRIGHT">
|
||||
<Offset>
|
||||
@@ -381,25 +382,16 @@
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="AuxCloseButtonBottom" inherits="UIPanelButtonTemplate" text="Close">
|
||||
<Size><AbsDimension x="90" y="26"/></Size>
|
||||
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-10" y="10"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
HideUIPanel(this:GetParent())
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
<Button name="AuxAuctionFrameButton" inherits="UIPanelButtonTemplate" text="Default UI">
|
||||
<Size><AbsDimension x="120" y="26"/></Size>
|
||||
<Anchors><Anchor point="RIGHT" relativePoint="LEFT" relativeTo="AuxCloseButtonBottom"><Offset><AbsDimension x="-5" y="0"/></Offset></Anchor></Anchors>
|
||||
<Size><AbsDimension x="60" y="15"/></Size>
|
||||
<Anchors><Anchor point="RIGHT" relativePoint="LEFT" relativeTo="AuxCloseButton"><Offset><AbsDimension x="-5" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
if AuctionFrame:IsVisible() then
|
||||
Aux.blizzard_ui_shown = false
|
||||
HideUIPanel(AuctionFrame)
|
||||
else
|
||||
Aux.blizzard_ui_shown = true
|
||||
Aux.blizzard_ui_shown = true
|
||||
ShowUIPanel(AuctionFrame)
|
||||
end
|
||||
</OnClick>
|
||||
@@ -415,7 +407,7 @@
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
getglobal(this:GetName().."Text"):SetText('Browse')
|
||||
getglobal(this:GetName().."Text"):SetText('Item Search')
|
||||
</OnLoad>
|
||||
<OnClick>
|
||||
Aux.on_tab_click(this:GetID())
|
||||
@@ -432,7 +424,7 @@
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
getglobal(this:GetName().."Text"):SetText('Post')
|
||||
getglobal(this:GetName().."Text"):SetText('Filter Search')
|
||||
</OnLoad>
|
||||
<OnClick>
|
||||
Aux.on_tab_click(this:GetID())
|
||||
@@ -449,7 +441,7 @@
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
getglobal(this:GetName().."Text"):SetText('Manage')
|
||||
getglobal(this:GetName().."Text"):SetText('Post')
|
||||
</OnLoad>
|
||||
<OnClick>
|
||||
Aux.on_tab_click(this:GetID())
|
||||
@@ -466,7 +458,7 @@
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
getglobal(this:GetName().."Text"):SetText('Scan')
|
||||
getglobal(this:GetName().."Text"):SetText('Manage')
|
||||
</OnLoad>
|
||||
<OnClick>
|
||||
Aux.on_tab_click(this:GetID())
|
||||
@@ -481,6 +473,11 @@
|
||||
<AbsDimension x="5" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
<Anchor point="RIGHT">
|
||||
<Offset>
|
||||
<AbsDimension x="-5" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
<Anchor point="BOTTOM">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="10"/>
|
||||
|
||||
+89
-86
@@ -1,7 +1,7 @@
|
||||
Aux.buy = {}
|
||||
|
||||
local private, public = {}, {}
|
||||
Aux.browse_frame = public
|
||||
Aux.filter_search_frame = public
|
||||
|
||||
local create_auction_record, show_dialog, find_auction, hide_sheet, update_sheet, auction_alpha_setter, group_alpha_setter, create_auction_record
|
||||
local auctions
|
||||
@@ -20,12 +20,12 @@ end
|
||||
|
||||
local BUYOUT, BID, FULL = 1, 2, 3
|
||||
|
||||
Aux.buy.modes = {
|
||||
public.views = {
|
||||
[BUYOUT] = {
|
||||
name = 'Buyout',
|
||||
on_row_click = function (sheet, row_index)
|
||||
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||
AuxBuyEntry_OnClick(Aux.util.filter(sheet.data[data_index], function(auction) return not auction.gone end)[1] or sheet.data[data_index][1])
|
||||
private.on_row_click(Aux.util.filter(sheet.data[data_index], function(auction) return not auction.gone end)[1] or sheet.data[data_index][1])
|
||||
end,
|
||||
on_row_enter = function (sheet, row_index)
|
||||
sheet.rows[row_index].highlight:SetAlpha(.5)
|
||||
@@ -80,8 +80,6 @@ Aux.buy.modes = {
|
||||
cell.icon = icon
|
||||
end,
|
||||
cell_setter = function(cell, group)
|
||||
cell.tooltip = group[1].tooltip
|
||||
cell.EnhTooltip_info = group[1].EnhTooltip_info
|
||||
cell.icon.icon_texture:SetTexture(group[1].texture)
|
||||
if not group[1].usable then
|
||||
cell.icon.icon_texture:SetVertexColor(1.0, 0.1, 0.1)
|
||||
@@ -131,7 +129,7 @@ Aux.buy.modes = {
|
||||
name = 'Bid',
|
||||
on_row_click = function (sheet, row_index)
|
||||
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||
AuxBuyEntry_OnClick(sheet.data[data_index])
|
||||
private.on_row_click(sheet.data[data_index])
|
||||
end,
|
||||
on_row_enter = function (sheet, row_index)
|
||||
sheet.rows[row_index].highlight:SetAlpha(.5)
|
||||
@@ -186,8 +184,6 @@ Aux.buy.modes = {
|
||||
cell.icon = icon
|
||||
end,
|
||||
cell_setter = function(cell, datum)
|
||||
cell.tooltip = datum.tooltip
|
||||
cell.EnhTooltip_info = datum.EnhTooltip_info
|
||||
cell.icon.icon_texture:SetTexture(datum.texture)
|
||||
if not datum.usable then
|
||||
cell.icon.icon_texture:SetVertexColor(1.0, 0.1, 0.1)
|
||||
@@ -267,7 +263,7 @@ Aux.buy.modes = {
|
||||
name = 'Full',
|
||||
on_row_click = function (sheet, row_index)
|
||||
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||
AuxBuyEntry_OnClick(sheet.data[data_index])
|
||||
private.on_row_click(sheet.data[data_index])
|
||||
end,
|
||||
on_row_enter = function (sheet, row_index)
|
||||
sheet.rows[row_index].highlight:SetAlpha(.5)
|
||||
@@ -324,8 +320,6 @@ Aux.buy.modes = {
|
||||
cell.icon = icon
|
||||
end,
|
||||
cell_setter = function(cell, datum)
|
||||
cell.tooltip = datum.tooltip
|
||||
cell.EnhTooltip_info = datum.EnhTooltip_info
|
||||
cell.icon.icon_texture:SetTexture(datum.texture)
|
||||
if not datum.usable then
|
||||
cell.icon.icon_texture:SetVertexColor(1.0, 0.1, 0.1)
|
||||
@@ -430,56 +424,65 @@ Aux.buy.modes = {
|
||||
},
|
||||
}
|
||||
|
||||
function Aux.buy.on_close()
|
||||
if AuxBuyConfirmation:IsVisible() then
|
||||
function public.on_close()
|
||||
if AuxFilterSearchFrameResultsConfirmation:IsVisible() then
|
||||
Aux.buy.dialog_cancel()
|
||||
end
|
||||
current_page = nil
|
||||
end
|
||||
|
||||
function Aux.buy.on_open()
|
||||
function public.on_open()
|
||||
public.set_view(1)
|
||||
update_sheet()
|
||||
end
|
||||
|
||||
function Aux.buy.dialog_cancel()
|
||||
function public.dialog_cancel()
|
||||
Aux.log('Canceled.')
|
||||
Aux.scan.abort()
|
||||
AuxBuyConfirmation:Hide()
|
||||
AuxFilterSearchFrameResultsConfirmation:Hide()
|
||||
update_sheet()
|
||||
AuxBuySearchButton:Enable()
|
||||
AuxFilterSearchFrameFiltersSearchButton:Enable()
|
||||
end
|
||||
|
||||
function Aux.buy.StopButton_onclick()
|
||||
function public.stop_search()
|
||||
Aux.scan.abort()
|
||||
end
|
||||
|
||||
function update_sheet()
|
||||
AuxBuyBuyList:Hide()
|
||||
AuxBuyBidList:Hide()
|
||||
AuxBuyFullList:Hide()
|
||||
AuxFilterSearchFrameResultsBuyListing:Hide()
|
||||
AuxFilterSearchFrameResultsBidListing:Hide()
|
||||
AuxFilterSearchFrameResultsFullListing:Hide()
|
||||
|
||||
if private.view == BUYOUT then
|
||||
AuxBuyBuyList:Show()
|
||||
AuxFilterSearchFrameResultsBuyListing:Show()
|
||||
local buyout_auctions = auctions and Aux.util.filter(auctions, function(auction) return auction.owner ~= UnitName('player') and auction.buyout_price end) or {}
|
||||
Aux.list.populate(AuxBuyBuyList.sheet, auctions and Aux.util.group_by(buyout_auctions, function(a1, a2) return a1.hyperlink == a2.hyperlink and a1.stack_size == a2.stack_size and a1.buyout_price == a2.buyout_price end) or {})
|
||||
Aux.list.populate(AuxFilterSearchFrameResultsBuyListing.sheet, auctions and Aux.util.group_by(buyout_auctions, function(a1, a2) return a1.hyperlink == a2.hyperlink and a1.stack_size == a2.stack_size and a1.buyout_price == a2.buyout_price end) or {})
|
||||
AuxFilterSearchFrameResults:SetWidth(AuxFilterSearchFrameResultsBuyListing:GetWidth() + 40)
|
||||
AuxFrame:SetWidth(AuxFilterSearchFrameFilters:GetWidth() + AuxFilterSearchFrameResults:GetWidth() + 20)
|
||||
elseif private.view == BID then
|
||||
AuxBuyBidList:Show()
|
||||
AuxFilterSearchFrameResultsBidListing:Show()
|
||||
local bid_auctions = auctions and Aux.util.filter(auctions, function(auction) return auction.owner ~= UnitName('player') end) or {}
|
||||
Aux.list.populate(AuxBuyBidList.sheet, bid_auctions)
|
||||
Aux.list.populate(AuxFilterSearchFrameResultsBidListing.sheet, bid_auctions)
|
||||
AuxFilterSearchFrameResults:SetWidth(AuxFilterSearchFrameResultsBidListing:GetWidth() + 40)
|
||||
AuxFrame:SetWidth(AuxFilterSearchFrameFilters:GetWidth() + AuxFilterSearchFrameResults:GetWidth() + 20)
|
||||
elseif private.view == FULL then
|
||||
AuxBuyFullList:Show()
|
||||
Aux.list.populate(AuxBuyFullList.sheet, auctions or {})
|
||||
AuxFilterSearchFrameResultsFullListing:Show()
|
||||
Aux.list.populate(AuxFilterSearchFrameResultsFullListing.sheet, auctions or {})
|
||||
AuxFilterSearchFrameResults:SetWidth(AuxFilterSearchFrameResultsFullListing:GetWidth() + 40)
|
||||
AuxFrame:SetWidth(AuxFilterSearchFrameFilters:GetWidth() + AuxFilterSearchFrameResults:GetWidth() + 20)
|
||||
end
|
||||
end
|
||||
|
||||
function hide_sheet()
|
||||
AuxBuyBuyList:Hide()
|
||||
AuxBuyBidList:Hide()
|
||||
AuxBuyFullList:Hide()
|
||||
AuxFilterSearchFrameResultsBuyListing:Hide()
|
||||
AuxFilterSearchFrameResultsBidListing:Hide()
|
||||
AuxFilterSearchFrameResultsFullListing:Hide()
|
||||
end
|
||||
|
||||
function public.set_view(view)
|
||||
for i=1,3 do
|
||||
getglobal('AuxFilterSearchFrameResultsTab'..i):SetAlpha(i == view and 1 or 0.5)
|
||||
end
|
||||
private.view = view
|
||||
update_sheet()
|
||||
end
|
||||
@@ -488,43 +491,43 @@ function public.set_item(item_id)
|
||||
private.item_id = item_id
|
||||
end
|
||||
|
||||
function Aux.buy.SearchButton_onclick()
|
||||
function public.start_search()
|
||||
|
||||
if not AuxBuySearchButton:IsVisible() then
|
||||
if not AuxFilterSearchFrameFiltersSearchButton:IsVisible() then
|
||||
return
|
||||
end
|
||||
|
||||
AuxBuySearchButton:Hide()
|
||||
AuxBuyStopButton:Show()
|
||||
|
||||
AuxFilterSearchFrameFiltersSearchButton:Hide()
|
||||
AuxFilterSearchFrameFiltersStopButton:Show()
|
||||
|
||||
auctions = nil
|
||||
|
||||
refresh = true
|
||||
|
||||
local category = UIDropDownMenu_GetSelectedValue(AuxBuyCategoryDropDown)
|
||||
local category = UIDropDownMenu_GetSelectedValue(AuxFilterSearchFrameFiltersCategoryDropDown)
|
||||
local tooltip_patterns = {}
|
||||
for i=1,4 do
|
||||
local tooltip_pattern = getglobal('AuxBuyFiltersTooltipInputBox'..i):GetText()
|
||||
local tooltip_pattern = getglobal('AuxFilterSearchFrameFiltersTooltipInputBox'..i):GetText()
|
||||
if tooltip_pattern ~= '' then
|
||||
tinsert(tooltip_patterns, tooltip_pattern)
|
||||
end
|
||||
end
|
||||
|
||||
search_query = {
|
||||
name = AuxBuyNameInputBox:GetText(),
|
||||
min_level = AuxBuyMinLevel:GetText(),
|
||||
max_level = AuxBuyMaxLevel:GetText(),
|
||||
name = AuxFilterSearchFrameFiltersNameInputBox:GetText(),
|
||||
min_level = AuxFilterSearchFrameFiltersMinLevel:GetText(),
|
||||
max_level = AuxFilterSearchFrameFiltersMaxLevel:GetText(),
|
||||
slot = category and category.slot,
|
||||
class = category and category.class,
|
||||
subclass = category and category.subclass,
|
||||
quality = UIDropDownMenu_GetSelectedValue(AuxBuyQualityDropDown),
|
||||
usable = AuxBuyUsableCheckButton:GetChecked()
|
||||
quality = UIDropDownMenu_GetSelectedValue(AuxFilterSearchFrameFiltersQualityDropDown),
|
||||
usable = AuxFilterSearchFrameFiltersUsableCheckButton:GetChecked()
|
||||
}
|
||||
|
||||
Aux.log('Scanning auctions ...')
|
||||
Aux.scan.start{
|
||||
query = search_query,
|
||||
page = AuxBuyAllPagesCheckButton:GetChecked() and 0 or AuxBuyPageEditBox:GetNumber(),
|
||||
page = AuxFilterSearchFrameFiltersAllPagesCheckButton:GetChecked() and 0 or AuxFilterSearchFrameFiltersPageEditBox:GetNumber(),
|
||||
on_submit_query = function()
|
||||
current_page = nil
|
||||
end,
|
||||
@@ -535,7 +538,7 @@ function Aux.buy.SearchButton_onclick()
|
||||
on_read_auction = function(i)
|
||||
local auction_item = Aux.info.auction_item(i)
|
||||
if auction_item then
|
||||
if (auction_item.name == search_query.name or search_query.name == '' or not (private.filter == ITEM)) and Aux.info.tooltip_match(tooltip_patterns, auction_item.tooltip) then
|
||||
if Aux.info.tooltip_match(tooltip_patterns, auction_item.tooltip) then
|
||||
auctions = auctions or {}
|
||||
tinsert(auctions, create_auction_record(auction_item, current_page))
|
||||
end
|
||||
@@ -545,19 +548,19 @@ function Aux.buy.SearchButton_onclick()
|
||||
auctions = auctions or {}
|
||||
Aux.log('Scan complete: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' found.')
|
||||
|
||||
AuxBuyStopButton:Hide()
|
||||
AuxBuySearchButton:Show()
|
||||
AuxFilterSearchFrameFiltersStopButton:Hide()
|
||||
AuxFilterSearchFrameFiltersSearchButton:Show()
|
||||
refresh = true
|
||||
end,
|
||||
on_abort = function()
|
||||
auctions = auctions or {}
|
||||
Aux.log('Scan aborted: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' found.')
|
||||
AuxBuyStopButton:Hide()
|
||||
AuxBuySearchButton:Show()
|
||||
AuxFilterSearchFrameFiltersStopButton:Hide()
|
||||
AuxFilterSearchFrameFiltersSearchButton:Show()
|
||||
refresh = true
|
||||
end,
|
||||
next_page = function(page, total_pages)
|
||||
if AuxBuyAllPagesCheckButton:GetChecked() then
|
||||
if AuxFilterSearchFrameFiltersAllPagesCheckButton:GetChecked() then
|
||||
local last_page = max(total_pages - 1, 0)
|
||||
if page < last_page then
|
||||
return page + 1
|
||||
@@ -568,33 +571,33 @@ function Aux.buy.SearchButton_onclick()
|
||||
end
|
||||
|
||||
function show_dialog(buyout_mode, entry, amount)
|
||||
AuxBuyConfirmationContentItem.tooltip = entry.tooltip
|
||||
AuxBuyConfirmationContentItem.EnhTooltip_info = entry.EnhTooltip_info
|
||||
|
||||
AuxBuyConfirmationContentActionButton:Disable()
|
||||
AuxBuyConfirmationContentItemIconTexture:SetTexture(entry.texture)
|
||||
AuxBuyConfirmationContentItemName:SetText(entry.tooltip[1][1].text)
|
||||
AuxFilterSearchFrameResultsConfirmationContentItem.tooltip = entry.tooltip
|
||||
AuxFilterSearchFrameResultsConfirmationContentItem.EnhTooltip_info = entry.EnhTooltip_info
|
||||
|
||||
AuxFilterSearchFrameResultsConfirmationContentActionButton:Disable()
|
||||
AuxFilterSearchFrameResultsConfirmationContentItemIconTexture:SetTexture(entry.texture)
|
||||
AuxFilterSearchFrameResultsConfirmationContentItemName:SetText(entry.tooltip[1][1].text)
|
||||
local color = ITEM_QUALITY_COLORS[entry.quality]
|
||||
AuxBuyConfirmationContentItemName:SetTextColor(color.r, color.g, color.b)
|
||||
AuxFilterSearchFrameResultsConfirmationContentItemName:SetTextColor(color.r, color.g, color.b)
|
||||
|
||||
if entry.stack_size > 1 then
|
||||
AuxBuyConfirmationContentItemCount:SetText(entry.stack_size);
|
||||
AuxBuyConfirmationContentItemCount:Show()
|
||||
AuxFilterSearchFrameResultsConfirmationContentItemCount:SetText(entry.stack_size);
|
||||
AuxFilterSearchFrameResultsConfirmationContentItemCount:Show()
|
||||
else
|
||||
AuxBuyConfirmationContentItemCount:Hide()
|
||||
AuxFilterSearchFrameResultsConfirmationContentItemCount:Hide()
|
||||
end
|
||||
if buyout_mode then
|
||||
AuxBuyConfirmationContentActionButton:SetText('Buy')
|
||||
MoneyFrame_Update('AuxBuyConfirmationContentBuyoutPrice', amount)
|
||||
AuxBuyConfirmationContentBid:Hide()
|
||||
AuxBuyConfirmationContentBuyoutPrice:Show()
|
||||
AuxFilterSearchFrameResultsConfirmationContentActionButton:SetText('Buy')
|
||||
MoneyFrame_Update('AuxFilterSearchFrameResultsConfirmationContentBuyoutPrice', amount)
|
||||
AuxFilterSearchFrameResultsConfirmationContentBid:Hide()
|
||||
AuxFilterSearchFrameResultsConfirmationContentBuyoutPrice:Show()
|
||||
else
|
||||
AuxBuyConfirmationContentActionButton:SetText('Bid')
|
||||
MoneyInputFrame_SetCopper(AuxBuyConfirmationContentBid, amount)
|
||||
AuxBuyConfirmationContentBuyoutPrice:Hide()
|
||||
AuxBuyConfirmationContentBid:Show()
|
||||
AuxFilterSearchFrameResultsConfirmationContentActionButton:SetText('Bid')
|
||||
MoneyInputFrame_SetCopper(AuxFilterSearchFrameResultsConfirmationContentBid, amount)
|
||||
AuxFilterSearchFrameResultsConfirmationContentBuyoutPrice:Hide()
|
||||
AuxFilterSearchFrameResultsConfirmationContentBid:Show()
|
||||
end
|
||||
AuxBuyConfirmation:Show()
|
||||
AuxFilterSearchFrameResultsConfirmation:Show()
|
||||
end
|
||||
|
||||
function find_auction(entry, buyout_mode, express_mode)
|
||||
@@ -617,7 +620,7 @@ function find_auction(entry, buyout_mode, express_mode)
|
||||
end
|
||||
|
||||
Aux.log('Processing '..(buyout_mode and 'buyout' or 'bid')..' request for '..entry.hyperlink..' x '..entry.stack_size..' at '..Aux.util.money_string(amount)..' ...')
|
||||
AuxBuySearchButton:Disable()
|
||||
AuxFilterSearchFrameFiltersSearchButton:Disable()
|
||||
|
||||
if not express_mode then
|
||||
show_dialog(buyout_mode, entry, amount)
|
||||
@@ -674,11 +677,11 @@ function find_auction(entry, buyout_mode, express_mode)
|
||||
Aux.log('Not enough money.')
|
||||
end
|
||||
Aux.scan.abort()
|
||||
AuxBuySearchButton:Enable()
|
||||
AuxBuyConfirmation:Hide()
|
||||
AuxFilterSearchFrameFiltersSearchButton:Enable()
|
||||
AuxFilterSearchFrameResultsConfirmation:Hide()
|
||||
update_sheet()
|
||||
end
|
||||
AuxBuyConfirmationContentActionButton:Enable()
|
||||
AuxFilterSearchFrameResultsConfirmationContentActionButton:Enable()
|
||||
end
|
||||
end
|
||||
end,
|
||||
@@ -690,12 +693,12 @@ function find_auction(entry, buyout_mode, express_mode)
|
||||
Aux.buy.dialog_cancel()
|
||||
end
|
||||
if express_mode then
|
||||
AuxBuySearchButton:Enable()
|
||||
AuxFilterSearchFrameFiltersSearchButton:Enable()
|
||||
end
|
||||
end,
|
||||
on_abort = function()
|
||||
if express_mode then
|
||||
AuxBuySearchButton:Enable()
|
||||
AuxFilterSearchFrameFiltersSearchButton:Enable()
|
||||
end
|
||||
end,
|
||||
next_page = function(page, total_pages)
|
||||
@@ -706,7 +709,7 @@ function find_auction(entry, buyout_mode, express_mode)
|
||||
}
|
||||
end
|
||||
|
||||
function AuxBuyEntry_OnClick(entry)
|
||||
function private.on_row_click(entry)
|
||||
|
||||
local express_mode = IsAltKeyDown()
|
||||
local buyout_mode = arg1 == 'LeftButton'
|
||||
@@ -730,7 +733,7 @@ function create_auction_record(auction_item, current_page)
|
||||
elseif auction_item.high_bidder then
|
||||
status = GREEN_FONT_COLOR_CODE..'Your Bid'..FONT_COLOR_CODE_CLOSE
|
||||
else
|
||||
status = RED_FONT_COLOR_CODE..'Other Bidder'..FONT_COLOR_CODE_CLOSE
|
||||
status = 'Other Bidder'
|
||||
end
|
||||
|
||||
return {
|
||||
@@ -767,7 +770,7 @@ function Aux.buy.onupdate()
|
||||
end
|
||||
end
|
||||
|
||||
function AuxBuyCategoryDropDown_Initialize(arg1)
|
||||
function AuxFilterSearchFrameFiltersCategoryDropDown_Initialize(arg1)
|
||||
local level = arg1 or 1
|
||||
|
||||
if level == 1 then
|
||||
@@ -775,7 +778,7 @@ function AuxBuyCategoryDropDown_Initialize(arg1)
|
||||
UIDropDownMenu_AddButton({
|
||||
text = ALL,
|
||||
value = value,
|
||||
func = AuxBuyCategoryDropDown_OnClick,
|
||||
func = AuxFilterSearchFrameFiltersCategoryDropDown_OnClick,
|
||||
}, 1)
|
||||
|
||||
for i, class in pairs({ GetAuctionItemClasses() }) do
|
||||
@@ -784,7 +787,7 @@ function AuxBuyCategoryDropDown_Initialize(arg1)
|
||||
hasArrow = GetAuctionItemSubClasses(value.class),
|
||||
text = class,
|
||||
value = value,
|
||||
func = AuxBuyCategoryDropDown_OnClick,
|
||||
func = AuxFilterSearchFrameFiltersCategoryDropDown_OnClick,
|
||||
}, 1)
|
||||
end
|
||||
end
|
||||
@@ -797,7 +800,7 @@ function AuxBuyCategoryDropDown_Initialize(arg1)
|
||||
hasArrow = GetAuctionInvTypes(value.class, value.subclass),
|
||||
text = subclass,
|
||||
value = value,
|
||||
func = AuxBuyCategoryDropDown_OnClick,
|
||||
func = AuxFilterSearchFrameFiltersCategoryDropDown_OnClick,
|
||||
}, 2)
|
||||
end
|
||||
end
|
||||
@@ -810,13 +813,13 @@ function AuxBuyCategoryDropDown_Initialize(arg1)
|
||||
UIDropDownMenu_AddButton({
|
||||
text = slot_name,
|
||||
value = value,
|
||||
func = AuxBuyCategoryDropDown_OnClick,
|
||||
func = AuxFilterSearchFrameFiltersCategoryDropDown_OnClick,
|
||||
}, 3)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function AuxBuyCategoryDropDown_OnClick()
|
||||
function AuxFilterSearchFrameFiltersCategoryDropDown_OnClick()
|
||||
local qualified_name = ({ GetAuctionItemClasses() })[this.value.class] or 'All'
|
||||
if this.value.subclass then
|
||||
local subclass_name = ({ GetAuctionItemSubClasses(this.value.class) })[this.value.subclass]
|
||||
@@ -827,15 +830,15 @@ function AuxBuyCategoryDropDown_OnClick()
|
||||
end
|
||||
end
|
||||
|
||||
UIDropDownMenu_SetSelectedValue(AuxBuyCategoryDropDown, this.value)
|
||||
UIDropDownMenu_SetText(qualified_name, AuxBuyCategoryDropDown)
|
||||
UIDropDownMenu_SetSelectedValue(AuxFilterSearchFrameFiltersCategoryDropDown, this.value)
|
||||
UIDropDownMenu_SetText(qualified_name, AuxFilterSearchFrameFiltersCategoryDropDown)
|
||||
CloseDropDownMenus(1)
|
||||
end
|
||||
|
||||
function AuxBuyQualityDropDown_Initialize()
|
||||
function AuxFilterSearchFrameFiltersQualityDropDown_Initialize()
|
||||
|
||||
local function on_click()
|
||||
UIDropDownMenu_SetSelectedValue(AuxBuyQualityDropDown, this.value)
|
||||
UIDropDownMenu_SetSelectedValue(AuxFilterSearchFrameFiltersQualityDropDown, this.value)
|
||||
end
|
||||
|
||||
UIDropDownMenu_AddButton{
|
||||
|
||||
+69
-112
@@ -1,6 +1,6 @@
|
||||
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
|
||||
|
||||
<Script file="search_frame.lua"/>
|
||||
<Script file="filter_search_frame.lua"/>
|
||||
|
||||
<Frame>
|
||||
<Scripts>
|
||||
@@ -10,10 +10,10 @@
|
||||
</Scripts>
|
||||
</Frame>
|
||||
|
||||
<Frame name="AuxBuyFrame" hidden="true" parent="AuxFrame" setAllPoints="true">
|
||||
<Frame name="AuxFilterSearchFrame" hidden="true" parent="AuxFrame" setAllPoints="true">
|
||||
<Frames>
|
||||
<Frame name="AuxBuyFilters" inherits="AuxFrameBoxTemplate">
|
||||
<Size><AbsDimension x="213" y="326"/></Size>
|
||||
<Frame name="$parentFilters" inherits="AuxFrameBoxTemplate">
|
||||
<Size><AbsDimension x="180" y="326"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="5" y="-35"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
@@ -23,50 +23,16 @@
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
<Frames>
|
||||
<Button name="$parentTab1" inherits="AuxTopTabTemplate" id="1">
|
||||
<Anchors>
|
||||
<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT">
|
||||
<Offset>
|
||||
<AbsDimension x="7" y="-2"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
getglobal(this:GetName().."Text"):SetText('Item')
|
||||
</OnLoad>
|
||||
<OnClick>
|
||||
Aux.browse_frame.set_filter(this:GetID())
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
<Button name="$parentTab2" inherits="AuxTopTabTemplate" id="2">
|
||||
<Anchors>
|
||||
<Anchor point="LEFT" relativeTo="$parentTab1" relativePoint="RIGHT">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
getglobal(this:GetName().."Text"):SetText('Filters')
|
||||
</OnLoad>
|
||||
<OnClick>
|
||||
Aux.browse_frame.set_filter(this:GetID())
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
|
||||
<EditBox name="AuxBuyNameInputBox" autoFocus="false" inherits="AuxInputBoxTemplate">
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="16" y="-71"/></Offset></Anchor></Anchors>
|
||||
<EditBox name="$parentNameInputBox" autoFocus="false" inherits="AuxInputBoxTemplate">
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="16" y="-20"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
getglobal(this:GetName()..'Label'):SetText('Name')
|
||||
this:SetWidth(150)
|
||||
</OnLoad>
|
||||
<OnEnterPressed>
|
||||
this:ClearFocus()
|
||||
Aux.buy.SearchButton_onclick()
|
||||
Aux.filter_search_frame.start_search()
|
||||
</OnEnterPressed>
|
||||
<OnEscapePressed>
|
||||
this:ClearFocus()
|
||||
@@ -74,8 +40,8 @@
|
||||
</Scripts>
|
||||
</EditBox>
|
||||
|
||||
<Frame name="AuxBuyCategoryDropDown" inherits="UIDropDownMenuTemplate">
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-8" y="-104" /></Offset></Anchor></Anchors>
|
||||
<Frame name="$parentCategoryDropDown" inherits="UIDropDownMenuTemplate">
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-8" y="-55" /></Offset></Anchor></Anchors>
|
||||
<Layers>
|
||||
<Layer level="BACKGROUND">
|
||||
<FontString name="$parentLabel" inherits="GameFontNormalSmall" text="Category">
|
||||
@@ -92,23 +58,23 @@
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
UIDropDownMenu_SetWidth(140)
|
||||
UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize)
|
||||
UIDropDownMenu_Initialize(this, AuxFilterSearchFrameFiltersCategoryDropDown_Initialize)
|
||||
</OnLoad>
|
||||
<OnShow>
|
||||
UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize)
|
||||
UIDropDownMenu_Initialize(this, AuxFilterSearchFrameFiltersCategoryDropDown_Initialize)
|
||||
</OnShow>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
|
||||
<Frame name="AuxBuyQualityDropDown" inherits="UIDropDownMenuTemplate">
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-8" y="-143" /></Offset></Anchor></Anchors>
|
||||
<Frame name="$parentQualityDropDown" inherits="UIDropDownMenuTemplate">
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-8" y="-95" /></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
UIDropDownMenu_SetWidth(140)
|
||||
UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize)
|
||||
UIDropDownMenu_Initialize(this, AuxFilterSearchFrameFiltersQualityDropDown_Initialize)
|
||||
</OnLoad>
|
||||
<OnShow>
|
||||
UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize)
|
||||
UIDropDownMenu_Initialize(this, AuxFilterSearchFrameFiltersQualityDropDown_Initialize)
|
||||
</OnShow>
|
||||
</Scripts>
|
||||
<Layers>
|
||||
@@ -126,9 +92,9 @@
|
||||
</Layers>
|
||||
</Frame>
|
||||
|
||||
<EditBox name="AuxBuyMinLevel" letters="2" numeric="true" autoFocus="false" inherits="AuxInputBoxTemplate">
|
||||
<EditBox name="$parentMinLevel" letters="2" numeric="true" autoFocus="false" inherits="AuxInputBoxTemplate">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="15" y="-182"/></Offset></Anchor>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="15" y="-135"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Layers>
|
||||
<Layer level="ARTWORK">
|
||||
@@ -147,9 +113,9 @@
|
||||
</OnEnterPressed>
|
||||
</Scripts>
|
||||
</EditBox>
|
||||
<EditBox name="AuxBuyMaxLevel" letters="2" numeric="true" autoFocus="false" inherits="AuxInputBoxTemplate">
|
||||
<EditBox name="$parentMaxLevel" letters="2" numeric="true" autoFocus="false" inherits="AuxInputBoxTemplate">
|
||||
<Anchors>
|
||||
<Anchor point="LEFT" relativeTo="AuxBuyMinLevel" relativePoint="RIGHT"><Offset><AbsDimension x="8" y="0"/></Offset></Anchor>
|
||||
<Anchor point="LEFT" relativeTo="$parentMinLevel" relativePoint="RIGHT"><Offset><AbsDimension x="8" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
@@ -160,9 +126,9 @@
|
||||
</OnEnterPressed>
|
||||
</Scripts>
|
||||
</EditBox>
|
||||
<CheckButton name="AuxBuyUsableCheckButton" inherits="UICheckButtonTemplate">
|
||||
<CheckButton name="$parentUsableCheckButton" inherits="UICheckButtonTemplate">
|
||||
<Size><AbsDimension x="22" y="22"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="87" y="-182" /></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="87" y="-135" /></Offset></Anchor></Anchors>
|
||||
<Layers>
|
||||
<Layer level="OVERLAY">
|
||||
<FontString inherits="GameFontNormalSmall" text="Usable" justifyH="LEFT">
|
||||
@@ -173,64 +139,61 @@
|
||||
</CheckButton>
|
||||
|
||||
<EditBox name="$parentTooltipInputBox1" autoFocus="false" inherits="AuxInputBoxTemplate">
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="15" y="-216"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="15" y="-170"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
getglobal(this:GetName()..'Label'):SetText('Tooltip')
|
||||
this:SetWidth(110)
|
||||
this:SetWidth(150)
|
||||
</OnLoad>
|
||||
<OnEnterPressed>
|
||||
AuxBuyTooltipButton_OnClick(this)
|
||||
</OnEnterPressed>
|
||||
</Scripts>
|
||||
</EditBox>
|
||||
|
||||
<EditBox name="$parentTooltipInputBox2" autoFocus="false" inherits="AuxInputBoxTemplate">
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="15" y="-246"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="15" y="-190"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
this:SetWidth(110)
|
||||
this:SetWidth(150)
|
||||
</OnLoad>
|
||||
<OnEnterPressed>
|
||||
AuxBuyTooltipButton_OnClick(this)
|
||||
</OnEnterPressed>
|
||||
</Scripts>
|
||||
</EditBox>
|
||||
|
||||
<EditBox name="$parentTooltipInputBox3" autoFocus="false" inherits="AuxInputBoxTemplate">
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="15" y="-276"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="15" y="-210"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
this:SetWidth(110)
|
||||
this:SetWidth(150)
|
||||
</OnLoad>
|
||||
<OnEnterPressed>
|
||||
AuxBuyTooltipButton_OnClick(this)
|
||||
</OnEnterPressed>
|
||||
</Scripts>
|
||||
</EditBox>
|
||||
|
||||
<EditBox name="$parentTooltipInputBox4" autoFocus="false" inherits="AuxInputBoxTemplate">
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="15" y="-306"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="15" y="-230"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
this:SetWidth(110)
|
||||
this:SetWidth(150)
|
||||
</OnLoad>
|
||||
<OnEnterPressed>
|
||||
AuxBuyTooltipButton_OnClick(this)
|
||||
</OnEnterPressed>
|
||||
</Scripts>
|
||||
</EditBox>
|
||||
|
||||
<Button name="AuxBuySearchButton" inherits="UIPanelButtonTemplate" text="Search">
|
||||
<Button name="$parentSearchButton" inherits="UIPanelButtonTemplate" text="Search">
|
||||
<Size><AbsDimension x="90" y="26"/></Size>
|
||||
<Anchors><Anchor point="BOTTOMLEFT" ><Offset><AbsDimension x="5" y="5"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Aux.buy.SearchButton_onclick()
|
||||
Aux.filter_search_frame.start_search()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
<EditBox name="AuxBuyPageEditBox" numeric="true" autoFocus="false" inherits="AuxInputBoxTemplate">
|
||||
<Button name="$parentStopButton" inherits="UIPanelButtonTemplate" text="Stop" hidden="true">
|
||||
<Size><AbsDimension x="90" y="26"/></Size>
|
||||
<Anchors><Anchor point="BOTTOMLEFT" ><Offset><AbsDimension x="5" y="5"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Aux.filter_search_frame.stop_search()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
<EditBox name="$parentPageEditBox" numeric="true" autoFocus="false" inherits="AuxInputBoxTemplate">
|
||||
<Anchors><Anchor point="BOTTOMLEFT" ><Offset><AbsDimension x="110" y="5"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
@@ -244,7 +207,7 @@
|
||||
</OnEnterPressed>
|
||||
</Scripts>
|
||||
</EditBox>
|
||||
<CheckButton name="AuxBuyAllPagesCheckButton" inherits="UICheckButtonTemplate" checked="true">
|
||||
<CheckButton name="$parentAllPagesCheckButton" inherits="UICheckButtonTemplate" checked="true">
|
||||
<Size><AbsDimension x="22" y="22"/></Size>
|
||||
<Anchors><Anchor point="BOTTOMLEFT" ><Offset><AbsDimension x="143" y="5"/></Offset></Anchor></Anchors>
|
||||
<Layers>
|
||||
@@ -256,19 +219,19 @@
|
||||
</Layers>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
AuxBuyPageEditBox:EnableMouse(not this:GetChecked())
|
||||
AuxBuyPageEditBox:SetAlpha(this:GetChecked() and 0.5 or 1)
|
||||
AuxBuyPageEditBox:ClearFocus()
|
||||
AuxFilterSearchFrameFiltersPageEditBox:EnableMouse(not this:GetChecked())
|
||||
AuxFilterSearchFrameFiltersPageEditBox:SetAlpha(this:GetChecked() and 0.5 or 1)
|
||||
AuxFilterSearchFrameFiltersPageEditBox:ClearFocus()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</CheckButton>
|
||||
</Frames>
|
||||
</Frame>
|
||||
<Frame name="AuxBuySheetFrame" inherits="AuxFrameBoxTemplate">
|
||||
<Frame name="$parentResults" inherits="AuxFrameBoxTemplate">
|
||||
<Size>
|
||||
<AbsDimension x="655" y="326"/>
|
||||
</Size>
|
||||
<Anchors><Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="AuxBuyFilters"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$parentFilters"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
this:SetBackdropBorderColor(0.4, 0.4, 0.4)
|
||||
@@ -290,7 +253,7 @@
|
||||
getglobal(this:GetName().."Text"):SetText('Buy')
|
||||
</OnLoad>
|
||||
<OnClick>
|
||||
Aux.browse_frame.set_view(this:GetID())
|
||||
Aux.filter_search_frame.set_view(this:GetID())
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
@@ -307,7 +270,7 @@
|
||||
getglobal(this:GetName().."Text"):SetText('Bid')
|
||||
</OnLoad>
|
||||
<OnClick>
|
||||
Aux.browse_frame.set_view(this:GetID())
|
||||
Aux.filter_search_frame.set_view(this:GetID())
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
@@ -324,47 +287,50 @@
|
||||
getglobal(this:GetName().."Text"):SetText('Full')
|
||||
</OnLoad>
|
||||
<OnClick>
|
||||
Aux.browse_frame.set_view(this:GetID())
|
||||
Aux.filter_search_frame.set_view(this:GetID())
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
<Frame name="AuxBuyBuyList" hidden="true">
|
||||
<Frame name="$parentBuyListing" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-40" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOM"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
local sort_order = Aux.util.map(Aux.buy.modes[1].sort_order, function(column_order) return { column = Aux.buy.modes[1].columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
||||
this.sheet = Aux.sheet.create(this, Aux.buy.modes[1].columns, sort_order, Aux.buy.modes[1].row_setter, Aux.buy.modes[1].on_row_click, Aux.buy.modes[1].on_row_enter, Aux.buy.modes[1].on_row_leave)
|
||||
local config = Aux.filter_search_frame.views[1]
|
||||
local sort_order = Aux.util.map(config.sort_order, function(column_order) return { column = config.columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave)
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="AuxBuyBidList" hidden="true">
|
||||
<Frame name="$parentBidListing" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-40" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOM"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
local sort_order = Aux.util.map(Aux.buy.modes[2].sort_order, function(column_order) return { column = Aux.buy.modes[2].columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
||||
this.sheet = Aux.sheet.create(this, Aux.buy.modes[2].columns, sort_order, Aux.buy.modes[2].row_setter, Aux.buy.modes[2].on_row_click, Aux.buy.modes[2].on_row_enter, Aux.buy.modes[2].on_row_leave)
|
||||
local config = Aux.filter_search_frame.views[2]
|
||||
local sort_order = Aux.util.map(config.sort_order, function(column_order) return { column = config.columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave)
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="AuxBuyFullList" hidden="true">
|
||||
<Frame name="$parentFullListing" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-40" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOM"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
local sort_order = Aux.util.map(Aux.buy.modes[3].sort_order, function(column_order) return { column = Aux.buy.modes[3].columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
||||
this.sheet = Aux.sheet.create(this, Aux.buy.modes[3].columns, sort_order, Aux.buy.modes[3].row_setter, Aux.buy.modes[3].on_row_click, Aux.buy.modes[3].on_row_enter, Aux.buy.modes[3].on_row_leave)
|
||||
local config = Aux.filter_search_frame.views[3]
|
||||
local sort_order = Aux.util.map(config.sort_order, function(column_order) return { column = config.columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave)
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="AuxBuyConfirmation" frameStrata="FULLSCREEN_DIALOG" inherits="OptionFrameBoxTemplate" enableMouse="true" enableMouseWheel="true" hidden="true">
|
||||
<Frame name="$parentConfirmation" frameStrata="FULLSCREEN_DIALOG" inherits="OptionFrameBoxTemplate" enableMouse="true" enableMouseWheel="true" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
@@ -411,7 +377,7 @@
|
||||
<Anchors><Anchor point="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Aux.buy.dialog_action()
|
||||
Aux.filter_search_frame.dialog_action()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
@@ -420,7 +386,7 @@
|
||||
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Aux.buy.dialog_cancel()
|
||||
Aux.filter_search_frame.dialog_cancel()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
@@ -430,15 +396,6 @@
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
<Button name="AuxBuyStopButton" inherits="UIPanelButtonTemplate" text="Stop" hidden="true">
|
||||
<Size><AbsDimension x="90" y="26"/></Size>
|
||||
<Anchors><Anchor point="RIGHT" relativePoint="LEFT" relativeTo="AuxAuctionFrameButton"><Offset><AbsDimension x="-25" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Aux.buy.StopButton_onclick()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
</Frames>
|
||||
</Frame>
|
||||
</Ui>
|
||||
|
||||
+113
-42
@@ -7,6 +7,7 @@ local search_query
|
||||
local tooltip_patterns = {}
|
||||
local current_page
|
||||
local refresh
|
||||
local recently_searched = {}
|
||||
|
||||
function auction_alpha_setter(cell, auction)
|
||||
cell:SetAlpha(auction.gone and 0.3 or 1)
|
||||
@@ -18,6 +19,60 @@ end
|
||||
|
||||
local BUYOUT, BID, FULL = 1, 2, 3
|
||||
|
||||
public.recently_searched_config = {
|
||||
on_row_click = function (sheet, row_index)
|
||||
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||
public.set_item(sheet.data[data_index].item_id)
|
||||
end,
|
||||
on_row_enter = function (sheet, row_index)
|
||||
sheet.rows[row_index].highlight:SetAlpha(.5)
|
||||
end,
|
||||
on_row_leave = function (sheet, row_index)
|
||||
sheet.rows[row_index].highlight:SetAlpha(0)
|
||||
end,
|
||||
columns = {
|
||||
{
|
||||
title = 'Item',
|
||||
width = 163,
|
||||
comparator = function(datum1, datum2)
|
||||
return Aux.util.compare(datum1.time, datum2.time, Aux.util.GT)
|
||||
end,
|
||||
cell_initializer = function(cell)
|
||||
local icon = CreateFrame('Button', nil, cell)
|
||||
icon:EnableMouse(false)
|
||||
local icon_texture = icon:CreateTexture(nil, 'BORDER')
|
||||
icon_texture:SetAllPoints(icon)
|
||||
icon.icon_texture = icon_texture
|
||||
local normal_texture = icon:CreateTexture(nil)
|
||||
normal_texture:SetPoint('CENTER', 0, 0)
|
||||
normal_texture:SetWidth(22)
|
||||
normal_texture:SetHeight(22)
|
||||
normal_texture:SetTexture('Interface\\Buttons\\UI-Quickslot2')
|
||||
icon:SetNormalTexture(normal_texture)
|
||||
icon:SetPoint('LEFT', cell)
|
||||
icon:SetWidth(12)
|
||||
icon:SetHeight(12)
|
||||
local text = cell:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
|
||||
text:SetPoint("LEFT", icon, "RIGHT", 1, 0)
|
||||
text:SetPoint('TOPRIGHT', cell)
|
||||
text:SetPoint('BOTTOMRIGHT', cell)
|
||||
text:SetJustifyV('TOP')
|
||||
text:SetJustifyH('LEFT')
|
||||
text:SetTextColor(0.8, 0.8, 0.8)
|
||||
cell.text = text
|
||||
cell.icon = icon
|
||||
end,
|
||||
cell_setter = function(cell, datum)
|
||||
local info = { GetItemInfo(datum.item_id) }
|
||||
cell.icon.icon_texture:SetTexture(info[9])
|
||||
cell.text:SetText('['..info[1]..']')
|
||||
local color = ITEM_QUALITY_COLORS[info[3]]
|
||||
cell.text:SetTextColor(color.r, color.g, color.b)
|
||||
end,
|
||||
},
|
||||
},
|
||||
sort_order = {},
|
||||
}
|
||||
public.views = {
|
||||
[BUYOUT] = {
|
||||
name = 'Buyout',
|
||||
@@ -38,16 +93,6 @@ public.views = {
|
||||
row.EnhTooltip_info = group[1].EnhTooltip_info
|
||||
end,
|
||||
columns = {
|
||||
{
|
||||
title = 'Avail',
|
||||
width = 40,
|
||||
comparator = function(group1, group2) return Aux.util.compare(getn(Aux.util.filter(group1, function(auction) return not auction.gone end)), getn(Aux.util.filter(group2, function(auction) return not auction.gone end)), Aux.util.LT) end,
|
||||
cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
|
||||
cell_setter = function(cell, group)
|
||||
cell.text:SetText(getn(Aux.util.filter(group, function(auction) return not auction.gone end)))
|
||||
group_alpha_setter(cell, group)
|
||||
end,
|
||||
},
|
||||
{
|
||||
title = 'Qty',
|
||||
width = 23,
|
||||
@@ -58,6 +103,16 @@ public.views = {
|
||||
group_alpha_setter(cell, group)
|
||||
end,
|
||||
},
|
||||
{
|
||||
title = 'Buy',
|
||||
width = 93,
|
||||
comparator = function(group1, group2) return Aux.util.compare(group1[1].buyout_price, group2[1].buyout_price, Aux.util.GT) end,
|
||||
cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
|
||||
cell_setter = function(cell, group)
|
||||
cell.text:SetText(Aux.util.money_string(group[1].buyout_price))
|
||||
group_alpha_setter(cell, group)
|
||||
end,
|
||||
},
|
||||
{
|
||||
title = 'Buy/ea',
|
||||
width = 93,
|
||||
@@ -69,17 +124,17 @@ public.views = {
|
||||
end,
|
||||
},
|
||||
{
|
||||
title = 'Buy',
|
||||
width = 93,
|
||||
comparator = function(group1, group2) return Aux.util.compare(group1[1].buyout_price, group2[1].buyout_price, Aux.util.GT) end,
|
||||
title = 'Avail',
|
||||
width = 40,
|
||||
comparator = function(group1, group2) return Aux.util.compare(getn(Aux.util.filter(group1, function(auction) return not auction.gone end)), getn(Aux.util.filter(group2, function(auction) return not auction.gone end)), Aux.util.LT) end,
|
||||
cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
|
||||
cell_setter = function(cell, group)
|
||||
cell.text:SetText(Aux.util.money_string(group[1].buyout_price))
|
||||
cell.text:SetText(getn(Aux.util.filter(group, function(auction) return not auction.gone end)))
|
||||
group_alpha_setter(cell, group)
|
||||
end,
|
||||
},
|
||||
},
|
||||
sort_order = {{column = 2, order = 'ascending' }, {column = 4, order = 'ascending'}},
|
||||
sort_order = {{column = 3, order = 'ascending' }},
|
||||
},
|
||||
[BID] = {
|
||||
name = 'Bid',
|
||||
@@ -295,7 +350,7 @@ public.views = {
|
||||
}
|
||||
|
||||
function public.on_close()
|
||||
if AuxBuyConfirmation:IsVisible() then
|
||||
if AuxItemSearchFrameAuctionsConfirmation:IsVisible() then
|
||||
public.dialog_cancel()
|
||||
end
|
||||
current_page = nil
|
||||
@@ -304,15 +359,16 @@ end
|
||||
function public.on_open()
|
||||
public.set_view(1)
|
||||
public.update_item()
|
||||
private.update_recently_searched()
|
||||
update_listing()
|
||||
end
|
||||
|
||||
function public.dialog_cancel()
|
||||
Aux.log('Canceled.')
|
||||
Aux.scan.abort()
|
||||
AuxBuyConfirmation:Hide()
|
||||
AuxItemSearchFrameAuctionsConfirmation:Hide()
|
||||
update_listing()
|
||||
AuxBuySearchButton:Enable()
|
||||
AuxItemSearchFrameItemSearchButton:Enable()
|
||||
end
|
||||
|
||||
function public.stop_search()
|
||||
@@ -328,13 +384,19 @@ function update_listing()
|
||||
AuxItemSearchFrameAuctionsBuyListing:Show()
|
||||
local buy_records = auctions and Aux.util.filter(auctions, function(auction) return auction.owner ~= UnitName('player') and auction.buyout_price end) or {}
|
||||
Aux.list.populate(AuxItemSearchFrameAuctionsBuyListing.sheet, auctions and Aux.util.group_by(buy_records, function(a1, a2) return a1.hyperlink == a2.hyperlink and a1.stack_size == a2.stack_size and a1.buyout_price == a2.buyout_price end) or {})
|
||||
AuxItemSearchFrameAuctions:SetWidth(AuxItemSearchFrameAuctionsBuyListing:GetWidth() + 40)
|
||||
AuxFrame:SetWidth(AuxItemSearchFrameItem:GetWidth() + AuxItemSearchFrameAuctions:GetWidth() + 20)
|
||||
elseif private.view == BID then
|
||||
AuxItemSearchFrameAuctionsBidListing:Show()
|
||||
local bid_records = auctions and Aux.util.filter(auctions, function(auction) return auction.owner ~= UnitName('player') end) or {}
|
||||
Aux.list.populate(AuxItemSearchFrameAuctionsBidListing.sheet, bid_records)
|
||||
AuxItemSearchFrameAuctions:SetWidth(AuxItemSearchFrameAuctionsBidListing:GetWidth() + 40)
|
||||
AuxFrame:SetWidth(AuxItemSearchFrameItem:GetWidth() + AuxItemSearchFrameAuctions:GetWidth() + 20)
|
||||
elseif private.view == FULL then
|
||||
AuxItemSearchFrameAuctionsFullListing:Show()
|
||||
Aux.list.populate(AuxItemSearchFrameAuctionsFullListing.sheet, auctions or {})
|
||||
AuxItemSearchFrameAuctions:SetWidth(AuxItemSearchFrameAuctionsFullListing:GetWidth() + 40)
|
||||
AuxFrame:SetWidth(AuxItemSearchFrameItem:GetWidth() + AuxItemSearchFrameAuctions:GetWidth() + 20)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -352,8 +414,18 @@ function public.set_view(view)
|
||||
update_listing()
|
||||
end
|
||||
|
||||
function private.update_recently_searched()
|
||||
Aux.list.populate(AuxItemSearchFrameRecentlySearchedListing.sheet, recently_searched)
|
||||
end
|
||||
|
||||
function public.set_item(item_id)
|
||||
private.item_id = item_id
|
||||
if item_id ~= private.item_id then
|
||||
private.item_id = item_id
|
||||
public.update_item()
|
||||
tinsert(recently_searched, 1, { item_id=item_id, time=time() })
|
||||
private.update_recently_searched()
|
||||
public.start_search()
|
||||
end
|
||||
end
|
||||
|
||||
function public.update_item()
|
||||
@@ -365,7 +437,6 @@ function public.update_item()
|
||||
AuxItemSearchFrameItemItemName:SetTextColor(color.r, color.g, color.b)
|
||||
AuxItemSearchFrameItemItem:Show()
|
||||
AuxItemSearchFrameItemItemInputBox:Hide()
|
||||
public.start_search()
|
||||
else
|
||||
AuxItemSearchFrameItemItem:Hide()
|
||||
end
|
||||
@@ -444,33 +515,33 @@ function public.start_search()
|
||||
end
|
||||
|
||||
function show_dialog(buyout_mode, entry, amount)
|
||||
AuxBuyConfirmationContentItem.tooltip = entry.tooltip
|
||||
AuxBuyConfirmationContentItem.EnhTooltip_info = entry.EnhTooltip_info
|
||||
|
||||
AuxBuyConfirmationContentActionButton:Disable()
|
||||
AuxBuyConfirmationContentItemIconTexture:SetTexture(entry.texture)
|
||||
AuxBuyConfirmationContentItemName:SetText(entry.tooltip[1][1].text)
|
||||
AuxItemSearchFrameAuctionsConfirmationContentItem.tooltip = entry.tooltip
|
||||
AuxItemSearchFrameAuctionsConfirmationContentItem.EnhTooltip_info = entry.EnhTooltip_info
|
||||
|
||||
AuxItemSearchFrameAuctionsConfirmationContentActionButton:Disable()
|
||||
AuxItemSearchFrameAuctionsConfirmationContentItemIconTexture:SetTexture(entry.texture)
|
||||
AuxItemSearchFrameAuctionsConfirmationContentItemName:SetText(entry.tooltip[1][1].text)
|
||||
local color = ITEM_QUALITY_COLORS[entry.quality]
|
||||
AuxBuyConfirmationContentItemName:SetTextColor(color.r, color.g, color.b)
|
||||
AuxItemSearchFrameAuctionsConfirmationContentItemName:SetTextColor(color.r, color.g, color.b)
|
||||
|
||||
if entry.stack_size > 1 then
|
||||
AuxBuyConfirmationContentItemCount:SetText(entry.stack_size);
|
||||
AuxBuyConfirmationContentItemCount:Show()
|
||||
AuxItemSearchFrameAuctionsConfirmationContentItemCount:SetText(entry.stack_size);
|
||||
AuxItemSearchFrameAuctionsConfirmationContentItemCount:Show()
|
||||
else
|
||||
AuxBuyConfirmationContentItemCount:Hide()
|
||||
AuxItemSearchFrameAuctionsConfirmationContentItemCount:Hide()
|
||||
end
|
||||
if buyout_mode then
|
||||
AuxBuyConfirmationContentActionButton:SetText('Buy')
|
||||
MoneyFrame_Update('AuxBuyConfirmationContentBuyoutPrice', amount)
|
||||
AuxBuyConfirmationContentBid:Hide()
|
||||
AuxBuyConfirmationContentBuyoutPrice:Show()
|
||||
AuxItemSearchFrameAuctionsConfirmationContentActionButton:SetText('Buy')
|
||||
MoneyFrame_Update('AuxItemSearchFrameAuctionsConfirmationContentBuyoutPrice', amount)
|
||||
AuxItemSearchFrameAuctionsConfirmationContentBid:Hide()
|
||||
AuxItemSearchFrameAuctionsConfirmationContentBuyoutPrice:Show()
|
||||
else
|
||||
AuxBuyConfirmationContentActionButton:SetText('Bid')
|
||||
MoneyInputFrame_SetCopper(AuxBuyConfirmationContentBid, amount)
|
||||
AuxBuyConfirmationContentBuyoutPrice:Hide()
|
||||
AuxBuyConfirmationContentBid:Show()
|
||||
AuxItemSearchFrameAuctionsConfirmationContentActionButton:SetText('Bid')
|
||||
MoneyInputFrame_SetCopper(AuxItemSearchFrameAuctionsConfirmationContentBid, amount)
|
||||
AuxItemSearchFrameAuctionsConfirmationContentBuyoutPrice:Hide()
|
||||
AuxItemSearchFrameAuctionsConfirmationContentBid:Show()
|
||||
end
|
||||
AuxBuyConfirmation:Show()
|
||||
AuxItemSearchFrameAuctionsConfirmation:Show()
|
||||
end
|
||||
|
||||
function find_auction(entry, buyout_mode, express_mode)
|
||||
@@ -551,10 +622,10 @@ function find_auction(entry, buyout_mode, express_mode)
|
||||
end
|
||||
Aux.scan.abort()
|
||||
AuxItemSearchFrameItemSearchButton:Enable()
|
||||
AuxItemSearchFrameConfirmation:Hide()
|
||||
AuxItemSearchFrameAuctionsConfirmation:Hide()
|
||||
update_listing()
|
||||
end
|
||||
AuxItemSearchFrameConfirmationContentActionButton:Enable()
|
||||
AuxItemSearchFrameAuctionsConfirmationContentActionButton:Enable()
|
||||
end
|
||||
end
|
||||
end,
|
||||
@@ -606,7 +677,7 @@ function create_auction_record(auction_item, current_page)
|
||||
elseif auction_item.high_bidder then
|
||||
status = GREEN_FONT_COLOR_CODE..'Your Bid'..FONT_COLOR_CODE_CLOSE
|
||||
else
|
||||
status = RED_FONT_COLOR_CODE..'Other Bidder'..FONT_COLOR_CODE_CLOSE
|
||||
status = 'Other Bidder'
|
||||
end
|
||||
|
||||
return {
|
||||
|
||||
+54
-24
@@ -13,7 +13,7 @@
|
||||
<Frame name="AuxItemSearchFrame" hidden="true" parent="AuxFrame" setAllPoints="true">
|
||||
<Frames>
|
||||
<Frame name="$parentItem" inherits="AuxFrameBoxTemplate">
|
||||
<Size><AbsDimension x="213" y="326"/></Size>
|
||||
<Size><AbsDimension x="213" y="120"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="5" y="-35"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
@@ -39,45 +39,46 @@
|
||||
</Button>
|
||||
|
||||
<EditBox name="$parentItemInputBox" autoFocus="false" inherits="AuxInputBoxTemplate">
|
||||
<Anchors><Anchor point="TOP"><Offset><AbsDimension x="0" y="-28"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="TOP"><Offset><AbsDimension x="2" y="-28"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
getglobal(this:GetName()..'Label'):SetText('Item')
|
||||
this.completor = Aux.completion.completor(this)
|
||||
this:SetWidth(165)
|
||||
this.selector = Aux.completion.selector(this)
|
||||
this:SetWidth(185)
|
||||
</OnLoad>
|
||||
<OnTextChanged>
|
||||
this.completor.suggest()
|
||||
this.selector.suggest()
|
||||
</OnTextChanged>
|
||||
<OnTabPressed>
|
||||
if IsShiftKeyDown() then
|
||||
this.completor.previous()
|
||||
this.selector.previous()
|
||||
else
|
||||
this.completor.next()
|
||||
this.selector.next()
|
||||
end
|
||||
</OnTabPressed>
|
||||
<OnEnterPressed>
|
||||
this.completor.close()
|
||||
this:ClearFocus()
|
||||
</OnEnterPressed>
|
||||
<OnEditFocusLost>
|
||||
this:Hide()
|
||||
Aux.item_search_frame.update_item()
|
||||
Aux.item_search_frame.start_search()
|
||||
</OnEditFocusLost>
|
||||
<OnEscapePressed>
|
||||
if this.completor.open() then
|
||||
this.completor.close()
|
||||
else
|
||||
if this.selector.selected_value() then
|
||||
this:ClearFocus()
|
||||
end
|
||||
</OnEnterPressed>
|
||||
<OnEditFocusLost>
|
||||
this.selector.close()
|
||||
if this.selector.selected_value() then
|
||||
Aux.item_search_frame.set_item(this.selector.selected_value())
|
||||
end
|
||||
this:Hide()
|
||||
this.selector.clear()
|
||||
Aux.item_search_frame.update_item()
|
||||
</OnEditFocusLost>
|
||||
<OnEscapePressed>
|
||||
this.selector.clear()
|
||||
this:ClearFocus()
|
||||
</OnEscapePressed>
|
||||
</Scripts>
|
||||
</EditBox>
|
||||
|
||||
<Button name="$parentSearchButton" inherits="UIPanelButtonTemplate" text="Refresh">
|
||||
<Size><AbsDimension x="90" y="26"/></Size>
|
||||
<Anchors><Anchor point="BOTTOMLEFT" ><Offset><AbsDimension x="5" y="5"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="BOTTOMLEFT" ><Offset><AbsDimension x="8" y="15"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Aux.item_search_frame.start_search()
|
||||
@@ -86,7 +87,7 @@
|
||||
</Button>
|
||||
<Button name="$parentStopButton" inherits="UIPanelButtonTemplate" text="Stop" hidden="true">
|
||||
<Size><AbsDimension x="90" y="26"/></Size>
|
||||
<Anchors><Anchor point="BOTTOMLEFT" ><Offset><AbsDimension x="5" y="5"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="BOTTOMLEFT" ><Offset><AbsDimension x="8" y="15"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Aux.item_search_frame.stop_search()
|
||||
@@ -94,7 +95,7 @@
|
||||
</Scripts>
|
||||
</Button>
|
||||
<EditBox name="$parentPageEditBox" numeric="true" autoFocus="false" inherits="AuxInputBoxTemplate">
|
||||
<Anchors><Anchor point="BOTTOMLEFT" ><Offset><AbsDimension x="110" y="5"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="BOTTOMLEFT" ><Offset><AbsDimension x="111" y="15"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
getglobal(this:GetName()..'Label'):SetText('Page')
|
||||
@@ -109,7 +110,7 @@
|
||||
</EditBox>
|
||||
<CheckButton name="$parentAllPagesCheckButton" inherits="UICheckButtonTemplate" checked="true">
|
||||
<Size><AbsDimension x="22" y="22"/></Size>
|
||||
<Anchors><Anchor point="BOTTOMLEFT" ><Offset><AbsDimension x="143" y="5"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="BOTTOMLEFT" ><Offset><AbsDimension x="144" y="15"/></Offset></Anchor></Anchors>
|
||||
<Layers>
|
||||
<Layer level="OVERLAY">
|
||||
<FontString inherits="GameFontNormalSmall" text="All" justifyH="LEFT">
|
||||
@@ -127,6 +128,35 @@
|
||||
</CheckButton>
|
||||
</Frames>
|
||||
</Frame>
|
||||
<Frame name="$parentRecentlySearched" inherits="AuxFrameBoxTemplate">
|
||||
<Size>
|
||||
<AbsDimension x="213" y="186"/>
|
||||
</Size>
|
||||
<Anchors><Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentItem"><Offset><AbsDimension x="0" y="-20"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="BOTTOM" relativePoint="BOTTOM" relativeTo="$parentAuctions"><Offset><AbsDimension x="0" y="-20"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
this:SetBackdropBorderColor(0.4, 0.4, 0.4)
|
||||
this:SetBackdropColor(0.15, 0.15, 0.15)
|
||||
getglobal(this:GetName().."Title"):SetText('Recently Searched')
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
<Frames>
|
||||
<Frame name="$parentListing">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOM"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
local config = Aux.item_search_frame.recently_searched_config
|
||||
local sort_order = Aux.util.map(config.sort_order, function(column_order) return { column = config.columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave)
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
<Frame name="$parentAuctions" inherits="AuxFrameBoxTemplate">
|
||||
<Size>
|
||||
<AbsDimension x="620" y="326"/>
|
||||
|
||||
+58
-139
@@ -1,22 +1,23 @@
|
||||
local private, public = {}, {}
|
||||
Aux.manage_frame = public
|
||||
|
||||
local on_open, on_close
|
||||
local update_bid_records, update_auction_records, wait_for_bids, wait_for_auctions
|
||||
|
||||
local bid_records, auction_records, create_bid_record, create_auction_record, update_bid_records, update_auction_records, wait_for_bids, wait_for_auctions, create_record
|
||||
local bid_records, auction_records
|
||||
|
||||
local position
|
||||
local BIDS, AUCTIONS = 1, 2
|
||||
|
||||
local bid_listing_config = {
|
||||
on_cell_click = function(sheet, row_index, column_index)
|
||||
public.bid_listing_config = {
|
||||
on_row_click = function(sheet, row_index, column_index)
|
||||
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||
AuxBuyEntry_OnClick(sheet.data[data_index])
|
||||
end,
|
||||
|
||||
on_cell_enter = function(sheet, row_index, column_index)
|
||||
on_row_enter = function(sheet, row_index, column_index)
|
||||
sheet.rows[row_index].highlight:SetAlpha(.5)
|
||||
end,
|
||||
|
||||
on_cell_leave = function(sheet, row_index, column_index)
|
||||
on_row_leave = function(sheet, row_index, column_index)
|
||||
sheet.rows[row_index].highlight:SetAlpha(0)
|
||||
end,
|
||||
columns = {
|
||||
@@ -36,6 +37,7 @@ local bid_listing_config = {
|
||||
comparator = function(row1, row2) return Aux.util.compare(row1.tooltip[1][1].text, row2.tooltip[1][1].text, Aux.util.GT) end,
|
||||
cell_initializer = function(cell)
|
||||
local icon = CreateFrame('Button', nil, cell)
|
||||
icon:EnableMouse(false)
|
||||
local icon_texture = icon:CreateTexture(nil, 'BORDER')
|
||||
icon_texture:SetAllPoints(icon)
|
||||
icon.icon_texture = icon_texture
|
||||
@@ -48,10 +50,7 @@ local bid_listing_config = {
|
||||
icon:SetPoint('LEFT', cell)
|
||||
icon:SetWidth(12)
|
||||
icon:SetHeight(12)
|
||||
icon:SetNormalTexture('Interface\\Buttons\\UI-Quickslot2')
|
||||
icon:SetPushedTexture('Interface\\Buttons\\UI-Quickslot-Depress')
|
||||
icon:SetHighlightTexture('Interface\\Buttons\\ButtonHilight-Square')
|
||||
icon:SetScript('OnEnter', function() Aux.info.set_game_tooltip(this, cell.tooltip, 'ANCHOR_RIGHT', cell.EnhTooltip_info) end)
|
||||
icon:SetScript('OnEnter', function() Aux.info.set_game_tooltip(this, cell.tooltip, 'ANCHOR_CURSOR', cell.EnhTooltip_info) end)
|
||||
icon:SetScript('OnLeave', function() GameTooltip:Hide() end)
|
||||
local text = cell:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
|
||||
text:SetPoint("LEFT", icon, "RIGHT", 1, 0)
|
||||
@@ -78,23 +77,6 @@ local bid_listing_config = {
|
||||
private.auction_alpha_setter(cell, datum)
|
||||
end,
|
||||
},
|
||||
{
|
||||
title = 'Lvl',
|
||||
width = 23,
|
||||
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)
|
||||
local level = max(1, datum.level)
|
||||
local text
|
||||
if level > UnitLevel('player') then
|
||||
text = RED_FONT_COLOR_CODE..level..FONT_COLOR_CODE_CLOSE
|
||||
else
|
||||
text = level
|
||||
end
|
||||
cell.text:SetText(text)
|
||||
private.auction_alpha_setter(cell, datum)
|
||||
end,
|
||||
},
|
||||
{
|
||||
title = 'Left',
|
||||
width = 30,
|
||||
@@ -125,26 +107,6 @@ local bid_listing_config = {
|
||||
private.auction_alpha_setter(cell, datum)
|
||||
end,
|
||||
},
|
||||
{
|
||||
title = 'Bid/ea',
|
||||
width = 70,
|
||||
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))
|
||||
private.auction_alpha_setter(cell, datum)
|
||||
end,
|
||||
},
|
||||
{
|
||||
title = 'Buy/ea',
|
||||
width = 70,
|
||||
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))
|
||||
private.auction_alpha_setter(cell, datum)
|
||||
end,
|
||||
},
|
||||
{
|
||||
title = 'Bid',
|
||||
width = 70,
|
||||
@@ -169,17 +131,17 @@ local bid_listing_config = {
|
||||
sort_order = {},
|
||||
}
|
||||
|
||||
local auction_listing_config = {
|
||||
on_cell_click = function (sheet, row_index, column_index)
|
||||
public.auction_listing_config = {
|
||||
on_row_click = function (sheet, row_index)
|
||||
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||
AuxBuyEntry_OnClick(sheet.data[data_index])
|
||||
end,
|
||||
|
||||
on_cell_enter = function (sheet, row_index, column_index)
|
||||
on_row_enter = function (sheet, row_index)
|
||||
sheet.rows[row_index].highlight:SetAlpha(.5)
|
||||
end,
|
||||
|
||||
on_cell_leave = function (sheet, row_index, column_index)
|
||||
on_row_leave = function (sheet, row_index)
|
||||
sheet.rows[row_index].highlight:SetAlpha(0)
|
||||
end,
|
||||
columns = {
|
||||
@@ -199,6 +161,7 @@ local auction_listing_config = {
|
||||
comparator = function(row1, row2) return Aux.util.compare(row1.tooltip[1][1].text, row2.tooltip[1][1].text, Aux.util.GT) end,
|
||||
cell_initializer = function(cell)
|
||||
local icon = CreateFrame('Button', nil, cell)
|
||||
icon:EnableMouse(false)
|
||||
local icon_texture = icon:CreateTexture(nil, 'BORDER')
|
||||
icon_texture:SetAllPoints(icon)
|
||||
icon.icon_texture = icon_texture
|
||||
@@ -211,10 +174,7 @@ local auction_listing_config = {
|
||||
icon:SetPoint('LEFT', cell)
|
||||
icon:SetWidth(12)
|
||||
icon:SetHeight(12)
|
||||
icon:SetNormalTexture('Interface\\Buttons\\UI-Quickslot2')
|
||||
icon:SetPushedTexture('Interface\\Buttons\\UI-Quickslot-Depress')
|
||||
icon:SetHighlightTexture('Interface\\Buttons\\ButtonHilight-Square')
|
||||
icon:SetScript('OnEnter', function() Aux.info.set_game_tooltip(this, cell.tooltip, 'ANCHOR_RIGHT', cell.EnhTooltip_info) end)
|
||||
icon:SetScript('OnEnter', function() Aux.info.set_game_tooltip(this, cell.tooltip, 'ANCHOR_CURSOR', cell.EnhTooltip_info) end)
|
||||
icon:SetScript('OnLeave', function() GameTooltip:Hide() end)
|
||||
local text = cell:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
|
||||
text:SetPoint("LEFT", icon, "RIGHT", 1, 0)
|
||||
@@ -241,23 +201,6 @@ local auction_listing_config = {
|
||||
private.auction_alpha_setter(cell, datum)
|
||||
end,
|
||||
},
|
||||
{
|
||||
title = 'Lvl',
|
||||
width = 23,
|
||||
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)
|
||||
local level = max(1, datum.level)
|
||||
local text
|
||||
if level > UnitLevel('player') then
|
||||
text = RED_FONT_COLOR_CODE..level..FONT_COLOR_CODE_CLOSE
|
||||
else
|
||||
text = level
|
||||
end
|
||||
cell.text:SetText(text)
|
||||
private.auction_alpha_setter(cell, datum)
|
||||
end,
|
||||
},
|
||||
{
|
||||
title = 'Left',
|
||||
width = 30,
|
||||
@@ -278,36 +221,6 @@ local auction_listing_config = {
|
||||
private.auction_alpha_setter(cell, datum)
|
||||
end,
|
||||
},
|
||||
{
|
||||
title = 'Owner',
|
||||
width = 70,
|
||||
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)
|
||||
private.auction_alpha_setter(cell, datum)
|
||||
end,
|
||||
},
|
||||
{
|
||||
title = 'Bid/ea',
|
||||
width = 70,
|
||||
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))
|
||||
private.auction_alpha_setter(cell, datum)
|
||||
end,
|
||||
},
|
||||
{
|
||||
title = 'Buy/ea',
|
||||
width = 70,
|
||||
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))
|
||||
private.auction_alpha_setter(cell, datum)
|
||||
end,
|
||||
},
|
||||
{
|
||||
title = 'Bid',
|
||||
width = 70,
|
||||
@@ -332,41 +245,39 @@ local auction_listing_config = {
|
||||
sort_order = {},
|
||||
}
|
||||
|
||||
function on_open()
|
||||
Aux.list.populate(AuxManageBidsListing.sheet, {})
|
||||
Aux.list.populate(AuxManageAuctionsListing.sheet, {})
|
||||
function public.on_open()
|
||||
public.listing = public.listing or BIDS
|
||||
|
||||
update_bid_records(function()
|
||||
update_auction_records(function()
|
||||
end)
|
||||
end)
|
||||
if public.listing == BIDS then
|
||||
public.update_bid_records()
|
||||
elseif public.listing == AUCTIONS then
|
||||
public.update_auction_records()
|
||||
end
|
||||
|
||||
public.update_listing()
|
||||
end
|
||||
|
||||
function on_close()
|
||||
function public.on_close()
|
||||
end
|
||||
|
||||
function private.auction_alpha_setter(cell, auction)
|
||||
cell:SetAlpha(auction.gone and 0.3 or 1)
|
||||
end
|
||||
|
||||
function update_bid_records(k)
|
||||
function public.update_bid_records()
|
||||
bid_records = {}
|
||||
Aux.scan.start{
|
||||
type = 'bidder',
|
||||
page = 0,
|
||||
on_submit_query = function()
|
||||
position = nil
|
||||
end,
|
||||
on_page_loaded = function(page, total_pages)
|
||||
Aux.log('Scanning bid page '..(page+1)..' out of '..total_pages..' ...')
|
||||
position = 'bids#'..page
|
||||
end,
|
||||
on_read_auction = function(i)
|
||||
create_bid_record(i)
|
||||
private.create_bid_record(i)
|
||||
end,
|
||||
on_complete = function()
|
||||
Aux.list.populate(AuxManageBidsListing.sheet, bid_records)
|
||||
return k()
|
||||
Aux.log('Scan complete: '..getn(bid_records)..' bids found')
|
||||
public.update_listing()
|
||||
end,
|
||||
on_abort = function()
|
||||
end,
|
||||
@@ -379,24 +290,20 @@ function update_bid_records(k)
|
||||
}
|
||||
end
|
||||
|
||||
function update_auction_records(k)
|
||||
function public.update_auction_records()
|
||||
auction_records = {}
|
||||
Aux.scan.start{
|
||||
type = 'owner',
|
||||
page = 0,
|
||||
on_submit_query = function()
|
||||
position = nil
|
||||
end,
|
||||
on_page_loaded = function(page, total_pages)
|
||||
Aux.log('Scanning auction page '..(page+1)..' out of '..total_pages..' ...')
|
||||
position = 'auctions#'..page
|
||||
end,
|
||||
on_read_auction = function(i)
|
||||
create_auction_record(i)
|
||||
private.create_auction_record(i)
|
||||
end,
|
||||
on_complete = function()
|
||||
Aux.list.populate(AuxManageAuctionsListing.sheet, auction_records)
|
||||
return k()
|
||||
Aux.log('Scan complete: '..getn(auction_records)..' auctions found')
|
||||
public.update_listing()
|
||||
end,
|
||||
on_abort = function()
|
||||
end,
|
||||
@@ -409,7 +316,26 @@ function update_auction_records(k)
|
||||
}
|
||||
end
|
||||
|
||||
function create_record(auction_item)
|
||||
function public.update_listing()
|
||||
AuxManageFrameListingBidListing:Hide()
|
||||
AuxManageFrameListingAuctionListing:Hide()
|
||||
|
||||
for i=1,2 do
|
||||
getglobal('AuxManageFrameListingTab'..i):SetAlpha(i == public.listing and 1 or 0.5)
|
||||
end
|
||||
|
||||
if public.listing == BIDS then
|
||||
AuxManageFrameListingBidListing:Show()
|
||||
Aux.list.populate(AuxManageFrameListingBidListing.sheet, bid_records)
|
||||
AuxManageFrameListing:SetWidth(AuxManageFrameListingBidListing:GetWidth() + 40)
|
||||
elseif public.listing == AUCTIONS then
|
||||
AuxManageFrameListingAuctionListing:Show()
|
||||
Aux.list.populate(AuxManageFrameListingAuctionListing.sheet, auction_records)
|
||||
AuxManageFrameListing:SetWidth(AuxManageFrameListingAuctionListing:GetWidth() + 40)
|
||||
end
|
||||
end
|
||||
|
||||
function private.create_record(auction_item)
|
||||
|
||||
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
|
||||
@@ -450,25 +376,18 @@ function create_record(auction_item)
|
||||
}
|
||||
end
|
||||
|
||||
function create_auction_record(index)
|
||||
function private.create_auction_record(index)
|
||||
local auction_item = Aux.info.auction_item(index, 'owner')
|
||||
if auction_item then
|
||||
tinsert(auction_records, create_record(auction_item))
|
||||
tinsert(auction_records, private.create_record(auction_item))
|
||||
end
|
||||
end
|
||||
|
||||
function create_bid_record(index)
|
||||
function private.create_bid_record(index)
|
||||
local auction_item = Aux.info.auction_item(index, 'bidder')
|
||||
if auction_item then
|
||||
tinsert(auction_records, create_record(auction_item))
|
||||
tinsert(bid_records, private.create_record(auction_item))
|
||||
end
|
||||
end
|
||||
|
||||
Aux.manage_frame = {
|
||||
on_open = on_open,
|
||||
on_close = on_close,
|
||||
bid_listing_config = bid_listing_config,
|
||||
auction_listing_config = auction_listing_config,
|
||||
}
|
||||
|
||||
|
||||
|
||||
+122
-92
@@ -1,18 +1,10 @@
|
||||
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
|
||||
|
||||
<Script file="manage_frame.lua"/>
|
||||
|
||||
<Frame>
|
||||
<Scripts>
|
||||
<OnUpdate>
|
||||
Aux.buy.onupdate()
|
||||
</OnUpdate>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Script file="manage_frame.lua"/>
|
||||
|
||||
<Frame name="AuxManageFrame" hidden="true" parent="AuxFrame" setAllPoints="true">
|
||||
<Frames>
|
||||
<Frame name="AuxManageBids" inherits="AuxFrameBoxTemplate">
|
||||
<Frame name="$parentListing" inherits="AuxFrameBoxTemplate">
|
||||
<Size>
|
||||
<AbsDimension x="400" y="326"/>
|
||||
</Size>
|
||||
@@ -21,24 +13,61 @@
|
||||
<OnLoad>
|
||||
this:SetBackdropBorderColor(0.4, 0.4, 0.4)
|
||||
this:SetBackdropColor(0.15, 0.15, 0.15)
|
||||
getglobal(this:GetName().."Title"):SetText('Bids')
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
<Frames>
|
||||
<Frame name="$parentListing">
|
||||
<Button name="$parentTab1" inherits="AuxTopTabTemplate" id="1">
|
||||
<Anchors>
|
||||
<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT">
|
||||
<Offset>
|
||||
<AbsDimension x="7" y="-2"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
getglobal(this:GetName().."Text"):SetText('Bids')
|
||||
</OnLoad>
|
||||
<OnClick>
|
||||
Aux.manage_frame.listing = this:GetID()
|
||||
Aux.manage_frame.update_bid_records()
|
||||
Aux.manage_frame.update_listing()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
<Button name="$parentTab2" inherits="AuxTopTabTemplate" id="2">
|
||||
<Anchors>
|
||||
<Anchor point="LEFT" relativeTo="$parentTab1" relativePoint="RIGHT">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
getglobal(this:GetName().."Text"):SetText('Auctions')
|
||||
</OnLoad>
|
||||
<OnClick>
|
||||
Aux.manage_frame.listing = this:GetID()
|
||||
Aux.manage_frame.update_auction_records()
|
||||
Aux.manage_frame.update_listing()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
<Frame name="$parentBidListing">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-40" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOM"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
local config = Aux.manage_frame.bid_listing_config
|
||||
local sort_order = Aux.util.map(config.sort_order, function(column_order) return { column = config.columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_cell_click, config.on_cell_enter, config.on_cell_leave)
|
||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave)
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentConfirmation" frameStrata="FULLSCREEN_DIALOG" inherits="OptionFrameBoxTemplate" enableMouse="true" enableMouseWheel="true" hidden="true">
|
||||
<Frame name="$parentBidConfirmation" frameStrata="FULLSCREEN_DIALOG" inherits="OptionFrameBoxTemplate" enableMouse="true" enableMouseWheel="true" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
@@ -102,6 +131,83 @@
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
<Frame name="$parentAuctionListing">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOM"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
local config = Aux.manage_frame.auction_listing_config
|
||||
local sort_order = Aux.util.map(config.sort_order, function(column_order) return { column = config.columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave)
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentAuctionConfirmation" frameStrata="FULLSCREEN_DIALOG" inherits="OptionFrameBoxTemplate" enableMouse="true" enableMouseWheel="true" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnMouseWheel></OnMouseWheel>
|
||||
</Scripts>
|
||||
<Frames>
|
||||
<Frame name="$parentContent">
|
||||
<Anchors><Anchor point="CENTER"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
<Size><AbsDimension x="193" y="300"/></Size>
|
||||
<Frames>
|
||||
<Frame name="$parentItem" inherits="AuxItemTemplate">
|
||||
<Anchors><Anchor point="TOP"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Frame>
|
||||
<Frame name="$parentBid" inherits="MoneyInputFrameTemplate">
|
||||
<Anchors><Anchor point="BOTTOM"><Offset><AbsDimension x="30" y="148"/></Offset></Anchor></Anchors>
|
||||
<Layers>
|
||||
<Layer level="OVERLAY">
|
||||
<FontString inherits="GameFontNormal" text="Price:" justifyH="RIGHT">
|
||||
<Anchors><Anchor point="RIGHT" relativePoint="LEFT"><Offset><AbsDimension x="-10" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
</Layer>
|
||||
</Layers>
|
||||
</Frame>
|
||||
<Frame name="$parentBuyoutPrice" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors><Anchor point="BOTTOM"><Offset><AbsDimension x="30" y="150"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
MoneyFrame_SetType("STATIC")
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
<Layers>
|
||||
<Layer level="OVERLAY">
|
||||
<FontString inherits="GameFontNormal" text="Price:" justifyH="RIGHT">
|
||||
<Anchors><Anchor point="RIGHT" relativePoint="LEFT"><Offset><AbsDimension x="-5" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
</Layer>
|
||||
</Layers>
|
||||
</Frame>
|
||||
<Button name="$parentActionButton" inherits="UIPanelButtonTemplate" text="Buy" disabled="true">
|
||||
<Size><AbsDimension x="90" y="26"/> </Size>
|
||||
<Anchors><Anchor point="BOTTOMLEFT"><Offset><AbsDimension x="229" y="110"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Aux.buy.dialog_action()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
<Button name="$parentCancelButton" inherits="UIPanelButtonTemplate" text="Cancel">
|
||||
<Size><AbsDimension x="90" y="26"/></Size>
|
||||
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-229" y="110"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Aux.buy.dialog_cancel()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
</Frames>
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
<Frame name="AuxManageAuctions" inherits="AuxFrameBoxTemplate">
|
||||
@@ -117,83 +223,7 @@
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
<Frames>
|
||||
<Frame name="$parentListing">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-40" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
local config = Aux.manage_frame.auction_listing_config
|
||||
local sort_order = Aux.util.map(config.sort_order, function(column_order) return { column = config.columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_cell_click, config.on_cell_enter, config.on_cell_leave)
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentConfirmation" frameStrata="FULLSCREEN_DIALOG" inherits="OptionFrameBoxTemplate" enableMouse="true" enableMouseWheel="true" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnMouseWheel></OnMouseWheel>
|
||||
</Scripts>
|
||||
<Frames>
|
||||
<Frame name="$parentContent">
|
||||
<Anchors><Anchor point="CENTER"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
<Size><AbsDimension x="193" y="300"/></Size>
|
||||
<Frames>
|
||||
<Frame name="$parentItem" inherits="AuxItemTemplate">
|
||||
<Anchors><Anchor point="TOP"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
</Frame>
|
||||
<Frame name="$parentBid" inherits="MoneyInputFrameTemplate">
|
||||
<Anchors><Anchor point="BOTTOM"><Offset><AbsDimension x="30" y="148"/></Offset></Anchor></Anchors>
|
||||
<Layers>
|
||||
<Layer level="OVERLAY">
|
||||
<FontString inherits="GameFontNormal" text="Price:" justifyH="RIGHT">
|
||||
<Anchors><Anchor point="RIGHT" relativePoint="LEFT"><Offset><AbsDimension x="-10" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
</Layer>
|
||||
</Layers>
|
||||
</Frame>
|
||||
<Frame name="$parentBuyoutPrice" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors><Anchor point="BOTTOM"><Offset><AbsDimension x="30" y="150"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
MoneyFrame_SetType("STATIC")
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
<Layers>
|
||||
<Layer level="OVERLAY">
|
||||
<FontString inherits="GameFontNormal" text="Price:" justifyH="RIGHT">
|
||||
<Anchors><Anchor point="RIGHT" relativePoint="LEFT"><Offset><AbsDimension x="-5" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
</Layer>
|
||||
</Layers>
|
||||
</Frame>
|
||||
<Button name="$parentActionButton" inherits="UIPanelButtonTemplate" text="Buy" disabled="true">
|
||||
<Size><AbsDimension x="90" y="26"/> </Size>
|
||||
<Anchors><Anchor point="BOTTOMLEFT"><Offset><AbsDimension x="229" y="110"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Aux.buy.dialog_action()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
<Button name="$parentCancelButton" inherits="UIPanelButtonTemplate" text="Cancel">
|
||||
<Size><AbsDimension x="90" y="26"/></Size>
|
||||
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-229" y="110"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Aux.buy.dialog_cancel()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
</Frames>
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
|
||||
</Frames>
|
||||
</Frame>
|
||||
</Frames>
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@
|
||||
<Frame name="$parentListing">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-40" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOM"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
@@ -251,7 +251,7 @@
|
||||
<Frame name="$parentListing">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-40" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOM"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
|
||||
@@ -21,7 +21,8 @@ function Aux.scan.start(job)
|
||||
state = {
|
||||
job = job,
|
||||
page = job.page
|
||||
}
|
||||
}
|
||||
|
||||
return scan()
|
||||
end)
|
||||
end
|
||||
@@ -49,9 +50,13 @@ function wait_for_results(k)
|
||||
if state.job.type == 'bidder' then
|
||||
ok = true
|
||||
elseif state.job.type == 'owner' then
|
||||
Aux.control.on_next_event('AUCTION_OWNED_LIST_UPDATE', function()
|
||||
if state.page == Aux.current_owner_page then
|
||||
ok = true
|
||||
end)
|
||||
else
|
||||
Aux.control.on_next_event('AUCTION_OWNED_LIST_UPDATE', function()
|
||||
ok = true
|
||||
end)
|
||||
end
|
||||
else
|
||||
Aux.control.on_next_event('AUCTION_ITEM_LIST_UPDATE', function()
|
||||
ok = true
|
||||
@@ -137,7 +142,7 @@ end
|
||||
function submit_query(k)
|
||||
if state.page then
|
||||
controller().wait(function() return state.job.type ~= 'list' or CanSendAuctionQuery() end, function()
|
||||
snipe.log('kek')
|
||||
|
||||
if state.job.on_submit_query then
|
||||
state.job.on_submit_query()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user