almost completed new UI

This commit is contained in:
Manuel Simon Hirsig
2015-10-25 01:58:26 +02:00
parent 091958ed10
commit 569d2ca8c4
9 changed files with 434 additions and 723 deletions
+86 -80
View File
@@ -6,10 +6,7 @@
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/buy.xml" afterPath="$PROJECT_DIR$/buy.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/core.lua" afterPath="$PROJECT_DIR$/core.lua" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/core.xml" afterPath="$PROJECT_DIR$/core.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/info.lua" afterPath="$PROJECT_DIR$/info.lua" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/list.lua" afterPath="$PROJECT_DIR$/list.lua" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/misc.xml" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/options.xml" afterPath="$PROJECT_DIR$/options.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/scan.lua" afterPath="$PROJECT_DIR$/scan.lua" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/sell.lua" afterPath="$PROJECT_DIR$/sell.lua" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/sell.xml" afterPath="$PROJECT_DIR$/sell.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/util.lua" afterPath="$PROJECT_DIR$/util.lua" />
@@ -76,21 +73,11 @@
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="sell.lua" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/sell.lua">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.8290503" vertical-offset="12399" max-vertical-offset="13294">
<caret line="773" column="29" selection-start-line="773" selection-start-column="29" selection-end-line="773" selection-end-column="29" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="util.lua" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/util.lua">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="4658">
<caret line="13" column="44" selection-start-line="13" selection-start-column="44" selection-end-line="13" selection-end-column="44" />
<state vertical-scroll-proportion="0.0" vertical-offset="121" max-vertical-offset="5032">
<caret line="32" column="0" selection-start-line="32" selection-start-column="0" selection-end-line="32" selection-end-column="0" />
<folding />
</state>
</provider>
@@ -109,8 +96,18 @@
<file leaf-file-name="sell.xml" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/sell.xml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="4647" max-vertical-offset="5542">
<caret line="317" column="0" selection-start-line="317" selection-start-column="0" selection-end-line="317" selection-end-column="0" />
<state vertical-scroll-proportion="0.0" vertical-offset="3339" max-vertical-offset="5627">
<caret line="209" column="111" selection-start-line="209" selection-start-column="111" selection-end-line="209" selection-end-column="111" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="sell.lua" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/sell.lua">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.8817204" vertical-offset="6274" max-vertical-offset="12206">
<caret line="398" column="81" selection-start-line="398" selection-start-column="81" selection-end-line="398" selection-end-column="81" />
<folding />
</state>
</provider>
@@ -120,7 +117,7 @@
<entry file="file://$PROJECT_DIR$/options.xml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="6647">
<caret line="25" column="27" selection-start-line="25" selection-start-column="27" selection-end-line="25" selection-end-column="27" />
<caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="30" selection-end-column="12" />
<folding />
</state>
</provider>
@@ -129,28 +126,8 @@
<file leaf-file-name="buy.lua" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/buy.lua">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="7028" max-vertical-offset="15249">
<caret line="434" column="19" selection-start-line="434" selection-start-column="19" selection-end-line="434" selection-end-column="19" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="core.lua" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/core.lua">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="3929" max-vertical-offset="9163">
<caret line="275" column="7" selection-start-line="275" selection-start-column="7" selection-end-line="275" selection-end-column="7" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="info.lua" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/info.lua">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-42.964287" vertical-offset="1483" max-vertical-offset="3332">
<caret line="158" column="10" selection-start-line="158" selection-start-column="10" selection-end-line="158" selection-end-column="10" />
<state vertical-scroll-proportion="0.0" vertical-offset="7742" max-vertical-offset="15147">
<caret line="468" column="151" selection-start-line="468" selection-start-column="151" selection-end-line="468" selection-end-column="151" />
<folding />
</state>
</provider>
@@ -159,8 +136,8 @@
<file leaf-file-name="buy.xml" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/buy.xml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="8925">
<caret line="44" column="0" selection-start-line="44" selection-start-column="0" selection-end-line="44" selection-end-column="0" />
<state vertical-scroll-proportion="0.0" vertical-offset="4529" max-vertical-offset="8602">
<caret line="299" column="68" selection-start-line="299" selection-start-column="68" selection-end-line="299" selection-end-column="68" />
<folding />
</state>
</provider>
@@ -169,8 +146,28 @@
<file leaf-file-name="core.xml" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/core.xml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="4855" max-vertical-offset="5882">
<caret line="298" column="11" selection-start-line="298" selection-start-column="11" selection-end-line="298" selection-end-column="11" />
<state vertical-scroll-proportion="0.0" vertical-offset="3226" max-vertical-offset="6817">
<caret line="202" column="13" selection-start-line="202" selection-start-column="13" selection-end-line="202" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="core.lua" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/core.lua">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-11.607142" vertical-offset="3381" max-vertical-offset="4267">
<caret line="218" column="15" selection-start-line="218" selection-start-column="15" selection-end-line="218" selection-end-column="15" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="scan.lua" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/scan.lua">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="870" max-vertical-offset="2737">
<caret line="70" column="30" selection-start-line="70" selection-start-column="30" selection-end-line="70" selection-end-column="30" />
<folding />
</state>
</provider>
@@ -191,12 +188,13 @@
<list>
<option value="$PROJECT_DIR$/info.lua" />
<option value="$PROJECT_DIR$/list.lua" />
<option value="$PROJECT_DIR$/util.lua" />
<option value="$PROJECT_DIR$/buy.lua" />
<option value="$PROJECT_DIR$/core.lua" />
<option value="$PROJECT_DIR$/options.xml" />
<option value="$PROJECT_DIR$/buy.xml" />
<option value="$PROJECT_DIR$/util.lua" />
<option value="$PROJECT_DIR$/core.xml" />
<option value="$PROJECT_DIR$/core.lua" />
<option value="$PROJECT_DIR$/scan.lua" />
<option value="$PROJECT_DIR$/buy.lua" />
<option value="$PROJECT_DIR$/sell.xml" />
<option value="$PROJECT_DIR$/sell.lua" />
</list>
@@ -432,6 +430,7 @@
<window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32941177" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
@@ -447,7 +446,6 @@
<window_info id="LuaJ" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
</layout>
@@ -480,22 +478,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/list.lua">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="3784" max-vertical-offset="4692">
<caret line="253" column="14" selection-start-line="253" selection-start-column="14" selection-end-line="253" selection-end-column="14" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/util.lua">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="4658">
<caret line="13" column="44" selection-start-line="13" selection-start-column="44" selection-end-line="13" selection-end-column="44" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Aux-Addon.toc">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="908">
@@ -512,18 +494,18 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/buy.lua">
<entry file="file://$PROJECT_DIR$/list.lua">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="7028" max-vertical-offset="15249">
<caret line="434" column="19" selection-start-line="434" selection-start-column="19" selection-end-line="434" selection-end-column="19" />
<state vertical-scroll-proportion="0.0" vertical-offset="3784" max-vertical-offset="4692">
<caret line="253" column="14" selection-start-line="253" selection-start-column="14" selection-end-line="253" selection-end-column="14" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/core.lua">
<entry file="file://$PROJECT_DIR$/util.lua">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="3929" max-vertical-offset="9163">
<caret line="275" column="7" selection-start-line="275" selection-start-column="7" selection-end-line="275" selection-end-column="7" />
<state vertical-scroll-proportion="0.0" vertical-offset="121" max-vertical-offset="5032">
<caret line="32" column="0" selection-start-line="32" selection-start-column="0" selection-end-line="32" selection-end-column="0" />
<folding />
</state>
</provider>
@@ -531,39 +513,63 @@
<entry file="file://$PROJECT_DIR$/options.xml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="6647">
<caret line="25" column="27" selection-start-line="25" selection-start-column="27" selection-end-line="25" selection-end-column="27" />
<caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="30" selection-end-column="12" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/buy.xml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="8925">
<caret line="44" column="0" selection-start-line="44" selection-start-column="0" selection-end-line="44" selection-end-column="0" />
<state vertical-scroll-proportion="0.0" vertical-offset="4529" max-vertical-offset="8602">
<caret line="299" column="68" selection-start-line="299" selection-start-column="68" selection-end-line="299" selection-end-column="68" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/core.xml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="4855" max-vertical-offset="5882">
<caret line="298" column="11" selection-start-line="298" selection-start-column="11" selection-end-line="298" selection-end-column="11" />
<state vertical-scroll-proportion="0.0" vertical-offset="3226" max-vertical-offset="6817">
<caret line="202" column="13" selection-start-line="202" selection-start-column="13" selection-end-line="202" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/core.lua">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-11.607142" vertical-offset="3381" max-vertical-offset="4267">
<caret line="218" column="15" selection-start-line="218" selection-start-column="15" selection-end-line="218" selection-end-column="15" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/scan.lua">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="870" max-vertical-offset="2737">
<caret line="70" column="30" selection-start-line="70" selection-start-column="30" selection-end-line="70" selection-end-column="30" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/buy.lua">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="7742" max-vertical-offset="15147">
<caret line="468" column="151" selection-start-line="468" selection-start-column="151" selection-end-line="468" selection-end-column="151" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/sell.xml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="4647" max-vertical-offset="5542">
<caret line="317" column="0" selection-start-line="317" selection-start-column="0" selection-end-line="317" selection-end-column="0" />
<state vertical-scroll-proportion="0.0" vertical-offset="3339" max-vertical-offset="5627">
<caret line="209" column="111" selection-start-line="209" selection-start-column="111" selection-end-line="209" selection-end-column="111" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/sell.lua">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.8290503" vertical-offset="12399" max-vertical-offset="13294">
<caret line="773" column="29" selection-start-line="773" selection-start-column="29" selection-end-line="773" selection-end-column="29" />
<state vertical-scroll-proportion="0.8817204" vertical-offset="6274" max-vertical-offset="12206">
<caret line="398" column="81" selection-start-line="398" selection-start-column="81" selection-end-line="398" selection-end-column="81" />
<folding />
</state>
</provider>
+28 -34
View File
@@ -2,7 +2,6 @@ Aux.buy = {}
local create_auction_record, show_dialog, find_auction, hide_sheet, update_sheet, auction_alpha_setter, group_alpha_setter
local auctions
local selectedAuctions = {}
local search_query
local tooltip_patterns = {}
local current_page
@@ -426,8 +425,10 @@ Aux.buy.modes = {
},
}
function Aux.buy.exit()
Aux.buy.dialog_cancel()
function Aux.buy.on_close()
if AuxBuyConfirmation:IsVisible() then
Aux.buy.dialog_cancel()
end
current_page = nil
end
@@ -437,14 +438,8 @@ function Aux.buy.on_open()
update_sheet()
end
function Aux_AuctionFrameBid_Update()
Aux.orig.AuctionFrameBid_Update()
if PanelTemplates_GetSelectedTab(AuctionFrame) == Aux.tabs.buy.index and AuctionFrame:IsShown() then
Aux_HideElems(Aux.tabs.buy.hiddenElements)
end
end
function Aux.buy.dialog_cancel()
Aux.log('Canceled.')
Aux.scan.abort()
AuxBuyConfirmation:Hide()
update_sheet()
@@ -497,7 +492,6 @@ function Aux.buy.SearchButton_onclick()
AuxBuyStopButton:Show()
auctions = nil
selectedAuctions = {}
refresh = true
@@ -515,18 +509,16 @@ function Aux.buy.SearchButton_onclick()
usable = AuxBuyUsableCheckButton:GetChecked()
}
Aux.log('Starting scan')
Aux.log('Scanning auctions ...')
Aux.scan.start{
query = search_query,
page = AuxBuyAllPagesCheckButton:GetChecked() and 0 or AuxBuyPageEditBox:GetNumber(),
on_submit_query = function()
current_page = nil
end,
on_page_loaded = function(page)
current_page = page
end,
on_start_page = function(page, total_pages)
Aux.log('Scanning page ' .. page + 1 .. (total_pages > 0 and ' out of ' .. total_pages or ''))
on_page_loaded = function(page, total_pages)
Aux.log('Scanning page '..(page+1)..' out of '..total_pages..' ...')
current_page = page
end,
on_read_auction = function(i)
local auction_item = Aux.info.auction_item(i)
@@ -539,14 +531,15 @@ function Aux.buy.SearchButton_onclick()
end,
on_complete = function()
auctions = auctions or {}
Aux.log('Scan completed: '..getn(auctions)..' auctions found')
AuxBuyStopButton:Hide()
Aux.log('Scan complete: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' found.')
AuxBuyStopButton:Hide()
AuxBuySearchButton:Show()
refresh = true
end,
on_abort = function()
auctions = auctions or {}
Aux.log('Scan aborted: '..getn(auctions)..' auctions found')
Aux.log('Scan aborted: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' found.')
AuxBuyStopButton:Hide()
AuxBuySearchButton:Show()
refresh = true
@@ -604,16 +597,16 @@ function find_auction(entry, buyout_mode, express_mode)
return
end
Aux.log('Processing '..(buyout_mode and 'buyout' or 'bid')..' request')
local amount
if buyout_mode then
amount = entry.buyout_price
else
amount = entry.bid
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()
local amount
if buyout_mode then
amount = entry.buyout_price
else
amount = entry.bid
end
if not express_mode then
show_dialog(buyout_mode, entry, amount)
end
@@ -646,23 +639,23 @@ function find_auction(entry, buyout_mode, express_mode)
if entry.signature == signature then
ctrl.suspend()
found = true
Aux.log('Matching auction found')
Aux.log('Matching auction found.'..(express_mode and '' or ' Awaiting confirmation ...'))
if express_mode then
if GetMoney() >= amount then
PlaceAuctionBid("list", i, amount)
Aux.log((buyout_mode and 'Purchased ' or 'Bid on ')..entry.hyperlink..' x '..entry.stack_size)
Aux.log((buyout_mode and 'Purchased ' or 'Bid on ')..entry.hyperlink..' x '..entry.stack_size..' at '..Aux.util.money_string(amount)..'.')
entry.gone = true
refresh = true
else
Aux.log('Not enough money.')
Aux.log((buyout_mode and 'Purchase' or 'Bid')..' failed: Not enough money.')
end
Aux.scan.abort()
else
Aux.buy.dialog_action = function()
if GetMoney() >= amount then
PlaceAuctionBid("list", i, amount)
Aux.log((buyout_mode and 'Purchased ' or 'Bid on ')..entry.hyperlink..' x '..entry.stack_size)
Aux.log((buyout_mode and 'Purchased ' or 'Bid on ')..entry.hyperlink..' x '..entry.stack_size..' at '..Aux.util.money_string(amount)..'.')
entry.gone = true
refresh = true
else
@@ -679,6 +672,7 @@ function find_auction(entry, buyout_mode, express_mode)
end,
on_complete = function()
if not found then
Aux.log('No matching auction found. Removing entry from the cache.')
entry.gone = true
refresh = true
Aux.buy.dialog_cancel()
@@ -724,7 +718,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 = RED_FONT_COLOR_CODE..'Other Bidder'..FONT_COLOR_CODE_CLOSE
end
return {
@@ -832,7 +826,7 @@ function AuxBuyQualityDropDown_Initialize()
end
UIDropDownMenu_AddButton{
text = ALL,
text = 'All',
value = -1,
func = on_click,
}
+23 -42
View File
@@ -117,7 +117,7 @@
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="138" y="-71" /></Offset></Anchor></Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString inherits="GameFontHighlightSmall" text="Exact" justifyH="LEFT">
<FontString inherits="GameFontNormalSmall" text="Exact" justifyH="LEFT">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="9"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
@@ -176,10 +176,9 @@
</Layers>
</Frame>
<EditBox name="AuxBuyMinLevel" letters="2" numeric="true" autoFocus="false" inherits="InputBoxTemplate">
<Size><AbsDimension x="30" y="22"/></Size>
<EditBox name="AuxBuyMinLevel" letters="2" numeric="true" autoFocus="false" inherits="AuxInputBoxTemplate">
<Anchors>
<Anchor point="TOPLEFT"><Offset><AbsDimension x="18" y="-182"/></Offset></Anchor>
<Anchor point="TOPLEFT"><Offset><AbsDimension x="15" y="-182"/></Offset></Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
@@ -187,24 +186,25 @@
<Anchors><Anchor point="LEFT" relativePoint="RIGHT"><Offset><AbsDimension x="-1" y="0"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
<Layer level="OVERLAY">
<FontString inherits="GameFontHighlightSmall" text="Level Range" justifyH="LEFT">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-3" y="9"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
getglobal(this:GetName()..'Label'):SetText('Level Range')
this:SetWidth(30)
</OnLoad>
<OnEnterPressed>
this:ClearFocus()
</OnEnterPressed>
</Scripts>
</EditBox>
<EditBox name="AuxBuyMaxLevel" letters="2" numeric="true" autoFocus="false" inherits="InputBoxTemplate">
<Size><AbsDimension x="30" y="22"/></Size>
<EditBox name="AuxBuyMaxLevel" letters="2" numeric="true" autoFocus="false" inherits="AuxInputBoxTemplate">
<Anchors>
<Anchor point="LEFT" relativeTo="AuxBuyMinLevel" relativePoint="RIGHT"><Offset><AbsDimension x="8" y="0"/></Offset></Anchor>
</Anchors>
<Scripts>
<OnLoad>
this:SetWidth(30)
</OnLoad>
<OnEnterPressed>
this:ClearFocus()
</OnEnterPressed>
@@ -215,7 +215,7 @@
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="87" y="-182" /></Offset></Anchor></Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString inherits="GameFontHighlightSmall" text="Usable" justifyH="LEFT">
<FontString inherits="GameFontNormalSmall" text="Usable" justifyH="LEFT">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="9"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
@@ -278,20 +278,12 @@
</Scripts>
</Button>
<EditBox name="AuxBuyPageEditBox" numeric="true" autoFocus="false" inherits="InputBoxTemplate">
<Size><AbsDimension x="30" y="22"/></Size>
<Anchors>
<Anchor point="TOPLEFT"><Offset><AbsDimension x="16" y="-250"/></Offset></Anchor>
</Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString inherits="GameFontHighlightSmall" text="Page" justifyH="LEFT">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-3" y="9"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
</Layers>
<EditBox name="AuxBuyPageEditBox" numeric="true" autoFocus="false" inherits="AuxInputBoxTemplate">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="16" y="-250"/></Offset></Anchor></Anchors>
<Scripts>
<OnLoad>
getglobal(this:GetName()..'Label'):SetText('Page')
this:SetWidth(30)
this:EnableMouse(false)
this:SetAlpha(0.5)
</OnLoad>
@@ -305,7 +297,7 @@
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="49" y="-250" /></Offset></Anchor></Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString inherits="GameFontHighlightSmall" text="All" justifyH="LEFT">
<FontString inherits="GameFontNormalSmall" text="All" justifyH="LEFT">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="9"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
@@ -368,12 +360,13 @@
</OnLoad>
</Scripts>
</Frame>
<Frame name="AuxBuyConfirmation" enableMouse="true" frameStrata="FULLSCREEN_DIALOG" inherits="OptionFrameBoxTemplate" hidden="true">
<Frame name="AuxBuyConfirmation" enableMouse="true" frameStrata="FULLSCREEN_DIALOG" inherits="OptionFrameBoxTemplate" hidden="true" enableMouseWheel="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="$parentItem">
@@ -461,7 +454,7 @@
</Frame>
<Button name="$parentActionButton" inherits="UIPanelButtonTemplate" text="Buy" disabled="true">
<Size><AbsDimension x="90" y="26"/> </Size>
<Anchors><Anchor point="BOTTOMLEFT"><Offset><AbsDimension x="230" y="110"/></Offset></Anchor></Anchors>
<Anchors><Anchor point="BOTTOMLEFT"><Offset><AbsDimension x="229" y="110"/></Offset></Anchor></Anchors>
<Scripts>
<OnClick>
Aux.buy.dialog_action()
@@ -470,7 +463,7 @@
</Button>
<Button name="$parentCancelButton" inherits="UIPanelButtonTemplate" text="Cancel">
<Size><AbsDimension x="90" y="26"/></Size>
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-230" y="110"/></Offset></Anchor></Anchors>
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-229" y="110"/></Offset></Anchor></Anchors>
<Scripts>
<OnClick>
Aux.buy.dialog_cancel()
@@ -485,13 +478,7 @@
</Frame>
<Button name="AuxBuySearchButton" inherits="UIPanelButtonTemplate" text="Search">
<Size><AbsDimension x="90" y="26"/></Size>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-10" y="10"/>
</Offset>
</Anchor>
</Anchors>
<Anchors><Anchor point="RIGHT" relativePoint="LEFT" relativeTo="AuxCloseButtonBottom"><Offset><AbsDimension x="-25" y="0"/></Offset></Anchor></Anchors>
<Scripts>
<OnClick>
Aux.buy.SearchButton_onclick()
@@ -501,13 +488,7 @@
<Button name="AuxBuyStopButton" inherits="UIPanelButtonTemplate" text="Stop" hidden="true">
<Size><AbsDimension x="90" y="26"/></Size>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-10" y="10"/>
</Offset>
</Anchor>
</Anchors>
<Anchors><Anchor point="RIGHT" relativePoint="LEFT" relativeTo="AuxCloseButtonBottom"><Offset><AbsDimension x="-25" y="0"/></Offset></Anchor></Anchors>
<Scripts>
<OnClick>
Aux.buy.StopButton_onclick()
+30 -318
View File
@@ -1,4 +1,4 @@
AuxVersion = "1.6.0"
AuxVersion = "2.0.0"
AuxAuthors = "shirsig; Zerf; Zirco (Auctionator); Nimeral (Auctionator backport)"
local lastRightClickAction = GetTime()
@@ -8,29 +8,21 @@ Aux = {
orig = {},
elements = {},
tabs = {
sell = {
index = 4
},
buy = {
browse = {
index = 1
}
},
post = {
index = 2
},
},
last_picked_up = {},
}
-----------------------------------------
local relevel
-----------------------------------------
function Aux_OnLoad()
Aux.log("Aux v"..AuxVersion.." loaded")
Aux.log('Aux v'..AuxVersion..' loaded.')
Aux.loaded = true
end
-----------------------------------------
function Aux_OnEvent()
if event == "VARIABLES_LOADED" then
Aux_OnLoad()
@@ -43,73 +35,12 @@ function Aux_OnEvent()
end
end
-----------------------------------------
function Aux_OnAddonLoaded()
if string.lower(arg1) == "blizzard_auctionui" then
Aux_AddTabs()
Aux_AddPanels()
AuxButton:SetParent("AuctionFrame")
AuxButton:SetPoint("TOPRIGHT", "AuctionFrame", "TOPRIGHT", -26, -12)
Aux_SetupHookFunctions()
Aux.tabs.sell.hiddenElements = {
AuctionsPriceText,
StartPrice,
AuctionsBuyoutText,
BuyoutPrice,
AuctionsDurationText,
AuctionsShortAuctionButton,
AuctionsMediumAuctionButton,
AuctionsLongAuctionButton,
AuctionsCreateAuctionButton,
AuctionsItemButton,
AuctionsTitle,
AuctionsScrollFrame,
AuctionsButton1,
AuctionsButton2,
AuctionsButton3,
AuctionsButton4,
AuctionsButton5,
AuctionsButton6,
AuctionsButton7,
AuctionsButton8,
AuctionsButton9,
AuctionsQualitySort,
AuctionsDurationSort,
AuctionsHighBidderSort,
AuctionsBidSort,
AuctionsCancelAuctionButton
}
Aux.tabs.buy.hiddenElements = {
-- AuctionFrameBrowse,
}
Aux.buy.elements = {
AuxBuyFilters,
AuxBuySheetFrame,
AuxBuySearchButton,
AuxBuyStopButton,
}
Aux.sell.elements = {
AuxSellInventory,
AuxSellParameters,
AuxSellAuctions,
AuxSellPostButton,
AuxSellRefreshButton,
}
Aux.tabs.sell.recommendationElements = {
AuxRecommendText,
AuxRecommendPerItemText,
AuxRecommendPerItemPrice,
AuxRecommendPerStackText,
AuxRecommendPerStackPrice,
AuxRecommendBasisText,
AuxRecommendItemTex,
}
end
end
@@ -124,7 +55,7 @@ function Aux.log_frame_update(elapsedSec)
return
end
local flash = getglobal(this:GetName().."BottomButtonFlash")
local flash = getglobal(this:GetName()..'BottomButtonFlash')
if not flash then
return
@@ -156,7 +87,7 @@ function Aux.log_frame_update(elapsedSec)
end
function Aux.log(msg)
local info = ChatTypeInfo["SYSTEM"]
local info = ChatTypeInfo['SYSTEM']
AuxLogFrameMessageFrame:AddMessage(msg, 1, 1, 0)
if not AuxLogFrameMessageFrame:IsVisible() and DEFAULT_CHAT_FRAME then
DEFAULT_CHAT_FRAME:AddMessage(msg, 1, 1, 0)
@@ -165,12 +96,6 @@ end
function Aux_SetupHookFunctions()
Aux.orig.AuctionFrameAuctions_OnShow = AuctionFrameAuctions_OnShow
AuctionFrameAuctions_OnShow = Aux_Sell_AuctionFrameAuctions_OnShow
Aux.orig.BrowseButton_OnClick = BrowseButton_OnClick
BrowseButton_OnClick = Aux_BrowseButton_OnClick
AuctionsButton1:RegisterForClicks("LeftButtonUp", "RightButtonDown")
AuctionsButton1:SetScript("OnMouseDown", Aux_AuctionsButton_OnMouseDown)
AuctionsButton2:RegisterForClicks("LeftButtonUp", "RightButtonDown")
@@ -189,76 +114,47 @@ function Aux_SetupHookFunctions()
AuctionsButton8:SetScript("OnMouseDown", Aux_AuctionsButton_OnMouseDown)
AuctionsButton9:RegisterForClicks("LeftButtonUp", "RightButtonDown")
AuctionsButton9:SetScript("OnMouseDown", Aux_AuctionsButton_OnMouseDown)
BrowseButton1:RegisterForClicks("LeftButtonUp", "RightButtonDown")
BrowseButton1:SetScript("OnMouseDown", Aux_BrowseButton_OnMouseDown)
BrowseButton2:RegisterForClicks("LeftButtonUp", "RightButtonDown")
BrowseButton2:SetScript("OnMouseDown", Aux_BrowseButton_OnMouseDown)
BrowseButton3:RegisterForClicks("LeftButtonUp", "RightButtonDown")
BrowseButton3:SetScript("OnMouseDown", Aux_BrowseButton_OnMouseDown)
BrowseButton4:RegisterForClicks("LeftButtonUp", "RightButtonDown")
BrowseButton4:SetScript("OnMouseDown", Aux_BrowseButton_OnMouseDown)
BrowseButton5:RegisterForClicks("LeftButtonUp", "RightButtonDown")
BrowseButton5:SetScript("OnMouseDown", Aux_BrowseButton_OnMouseDown)
BrowseButton6:RegisterForClicks("LeftButtonUp", "RightButtonDown")
BrowseButton6:SetScript("OnMouseDown", Aux_BrowseButton_OnMouseDown)
BrowseButton7:RegisterForClicks("LeftButtonUp", "RightButtonDown")
BrowseButton7:SetScript("OnMouseDown", Aux_BrowseButton_OnMouseDown)
BrowseButton8:RegisterForClicks("LeftButtonUp", "RightButtonDown")
BrowseButton8:SetScript("OnMouseDown", Aux_BrowseButton_OnMouseDown)
Aux.orig.PickupContainerItem = PickupContainerItem
PickupContainerItem = Aux.PickupContainerItem
Aux.orig.AuctionSellItemButton_OnEvent = AuctionSellItemButton_OnEvent
AuctionSellItemButton_OnEvent = Aux.sell.AuctionSellItemButton_OnEvent
Aux.orig.AuctionFrameTab_OnClick = AuctionFrameTab_OnClick
AuctionFrameTab_OnClick = Aux_AuctionFrameTab_OnClick
Aux.orig.ContainerFrameItemButton_OnClick = ContainerFrameItemButton_OnClick
ContainerFrameItemButton_OnClick = Aux_ContainerFrameItemButton_OnClick
Aux.orig.AuctionFrameBid_Update = AuctionFrameBid_Update
AuctionFrameBid_Update = Aux_AuctionFrameBid_Update
Aux.orig.AuctionFrameAuctions_Update = AuctionFrameAuctions_Update
AuctionFrameAuctions_Update = Aux_AuctionFrameAuctions_Update
end
-----------------------------------------
end
function Aux_OnAuctionHouseShow()
AuxOptionsButtonPanel:Show()
AuxButton:Show()
AuxFrame:Show()
Aux.on_tab_click(1)
if AUX_OPEN_SELL then
AuctionFrameTab_OnClick(Aux.tabs.sell.index)
Aux.on_tab_click(2)
elseif AUX_OPEN_BUY then
-- AuctionFrameTab_OnClick(Aux.tabs.buy.index)
end
end
-----------------------------------------
function Aux_OnAuctionHouseClosed()
Aux.post.stop()
Aux.stack.stop()
Aux.buy.exit()
Aux.scan.abort()
Aux.buy.on_close()
Aux.sell.on_close()
AuxOptionsButtonPanel:Hide()
AuxOptionsFrame:Hide()
AuxAboutFrame:Hide()
-- AuxSellPanel:Hide()
AuxFrame:Hide()
end
function Aux.on_tab_click(index)
Aux.post.stop()
Aux.stack.stop()
Aux.scan.abort()
Aux.buy.on_close()
Aux.sell.on_close()
for i=1,5 do
getglobal('AuxTab'..i):SetAlpha(i == index and 1 or 0.5)
@@ -277,184 +173,16 @@ function Aux.on_tab_click(index)
end
function Aux_AuctionFrameTab_OnClick(index)
if not index then
index = this:GetID()
end
Aux.post.stop()
Aux.stack.stop()
Aux.buy.exit()
Aux.scan.abort()
-- AuxSellPanel:Hide()
AuxFrame:Hide()
if index == 2 then
Aux_ShowElems(Aux.tabs.buy.hiddenElements)
end
if index == 3 then
Aux_ShowElems(Aux.tabs.sell.hiddenElements)
end
if index == Aux.tabs.sell.index then
AuctionFrameTab_OnClick(3)
PanelTemplates_SetTab(AuctionFrame, Aux.tabs.sell.index)
Aux_HideElems(Aux.tabs.sell.hiddenElements)
-- AuxSellPanel:Show()
AuctionFrame:EnableMouse(false)
elseif index == Aux.tabs.buy.index then
Aux.orig.AuctionFrameTab_OnClick(1)
PanelTemplates_SetTab(AuctionFrame, Aux.tabs.buy.index)
Aux_HideElems(Aux.tabs.buy.hiddenElements)
AuxFrame:Show()
AuctionFrame:EnableMouse(false)
else
Aux.orig.AuctionFrameTab_OnClick(index)
lastItemPosted = nil
end
end
function Aux_AddPanels()
-- local sellFrame = CreateFrame("Frame", "AuxSellPanel", AuctionFrame, "AuxSellTemplate")
-- sellFrame:SetParent("AuctionFrame")
-- sellFrame:SetPoint("TOPLEFT", "AuctionFrame", "TOPLEFT")
-- relevel(sellFrame)
-- sellFrame:Hide()
--local buyFrame = CreateFrame("Frame", "AuxBuyPanel", AuctionFrame, "AuxBuyTemplate")
--buyFrame:SetParent("AuctionFrame")
--buyFrame:SetPoint("TOPLEFT", "AuctionFrame", "TOPLEFT")
--AuxLogFrame:SetParent(buyFrame)
--AuxLogFrame:SetPoint('TOP', buyFrame, 100, -43)
--relevel(buyFrame)
--buyFrame:Hide()
local optionsFrame = CreateFrame("Frame", "AuxOptionsButtonPanel", AuctionFrame, "AuxOptionsButtonTemplate")
optionsFrame:SetParent("AuctionFrame")
optionsFrame:SetPoint("TOPLEFT", "AuctionFrame", "TOPLEFT")
relevel(optionsFrame)
optionsFrame:Hide()
end
-----------------------------------------
function Aux_AddTabs()
AuctionFrameTab1:SetText('Buy')
Aux.tabs.sell.index = AuctionFrame.numTabs + 1
local sellTabName = "AuctionFrameTab"..Aux.tabs.sell.index
local sellTab = CreateFrame("Button", sellTabName, AuctionFrame, "AuctionTabTemplate")
setglobal(sellTabName, sellTab)
sellTab:SetID(Aux.tabs.sell.index)
sellTab:SetText("Sell")
sellTab:SetPoint("LEFT", getglobal("AuctionFrameTab"..AuctionFrame.numTabs), "RIGHT", -8, 0)
PanelTemplates_SetNumTabs(AuctionFrame, Aux.tabs.sell.index)
PanelTemplates_EnableTab(AuctionFrame, Aux.tabs.sell.index)
end
-----------------------------------------
function Aux_HideElems(tt)
if not tt then
return;
end
for i,x in ipairs(tt) do
x:Hide()
end
end
-----------------------------------------
function Aux_ShowElems(tt)
for i,x in ipairs(tt) do
x:Show()
end
end
-----------------------------------------
function Aux_PluralizeIf(word, count)
if count and count == 1 then
return word
else
return word.."s"
end
end
-----------------------------------------
function Aux_Round(v)
return math.floor(v + 0.5)
end
-----------------------------------------
function relevel(frame)
local myLevel = frame:GetFrameLevel() + 1
local children = { frame:GetChildren() }
for _,child in pairs(children) do
child:SetFrameLevel(myLevel)
relevel(child)
end
end
-----------------------------------------
function Aux_BrowseButton_OnClick(button)
if arg1 == "LeftButton" then -- because we additionally registered right clicks we only let left ones pass here
Aux.orig.BrowseButton_OnClick(button)
end
end
-----------------------------------------
function Aux_AuctionsButton_OnClick(button)
if arg1 == "LeftButton" then -- because we additionally registered right clicks we only let left ones pass here
Aux.orig.BrowseButton_OnClick(button)
end
end
-----------------------------------------
function Aux_BrowseButton_OnMouseDown()
if arg1 == "RightButton" and AUX_INSTANT_BUYOUT and GetTime() - lastRightClickAction > 0.5 then
local index = this:GetID() + FauxScrollFrame_GetOffset(BrowseScrollFrame)
SetSelectedAuctionItem("list", index)
local auction_item = Aux.info.auction_item(index)
if auction_item.buyout_price > 0 then
PlaceAuctionBid("list", index, auction_item.buyout_price)
end
AuctionFrameBrowse_Update()
lastRightClickAction = GetTime()
end
end
-----------------------------------------
function Aux_AuctionsButton_OnMouseDown()
if arg1 == "RightButton" and GetTime() - lastRightClickAction > 0.5 then
local index = this:GetID() + FauxScrollFrame_GetOffset(AuctionsScrollFrame)
@@ -468,15 +196,11 @@ function Aux_AuctionsButton_OnMouseDown()
end
end
-----------------------------------------
function Aux.PickupContainerItem(bag, item)
Aux.last_picked_up = { bag=bag, slot=item }
return Aux.orig.PickupContainerItem(bag, item)
end
-----------------------------------------
function Aux_ContainerFrameItemButton_OnClick(button)
local bag, slot = this:GetParent():GetID(), this:GetID()
local container_item = Aux.info.container_item(bag, slot)
@@ -485,20 +209,12 @@ function Aux_ContainerFrameItemButton_OnClick(button)
if IsShiftKeyDown()
and not ChatFrameEditBox:IsVisible()
and (PanelTemplates_GetSelectedTab(AuctionFrame) == 1 or PanelTemplates_GetSelectedTab(AuctionFrame) == Aux.tabs.buy.index)
and AuxBuyFrame:IsVisible()
then
if PanelTemplates_GetSelectedTab(AuctionFrame) == Aux.tabs.buy.index then
AuxBuyNameInputBox.completor.set_quietly(container_item.name)
end
AuxBuyNameInputBox.completor.set_quietly(container_item.name)
return
elseif AUX_SELL_SHORTCUT and IsAltKeyDown()then
Aux.sell.set_auction(bag, slot)
if PanelTemplates_GetSelectedTab(AuctionFrame) ~= Aux.tabs.sell.index then
Aux.on_tab_click(2)
end
return
elseif AUX_BUY_SHORTCUT and IsControlKeyDown() then
if PanelTemplates_GetSelectedTab(AuctionFrame) ~= Aux.tabs.buy.index then
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)
@@ -509,8 +225,6 @@ function Aux_ContainerFrameItemButton_OnClick(button)
return Aux.orig.ContainerFrameItemButton_OnClick(button)
end
-----------------------------------------
function Aux_QualityColor(code)
if code == 0 then
return "ff9d9d9d" -- poor, gray
@@ -527,8 +241,6 @@ function Aux_QualityColor(code)
end
end
-----------------------------------------
function Aux.auction_signature(hyperlink, stack_size, amount)
return hyperlink .. (stack_size or '0') .. '_' .. (amount or '0')
end
+60 -5
View File
@@ -91,6 +91,39 @@
</HighlightTexture>
</Button>
<CheckButton name="AuxRadioButtonTemplate" virtual="true">
<Size>
<AbsDimension x="16" y="16"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentText" inherits="GameFontHighlightSmall">
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT">
<Offset>
<AbsDimension x="5" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnClick>
SendMailRadioButton_OnClick(this:GetID());
</OnClick>
</Scripts>
<NormalTexture file="Interface\Buttons\UI-RadioButton">
<TexCoords left="0" right="0.25" top="0" bottom="1"/>
</NormalTexture>
<HighlightTexture file="Interface\Buttons\UI-RadioButton" alphaMode="ADD">
<TexCoords left="0.5" right="0.75" top="0" bottom="1"/>
</HighlightTexture>
<CheckedTexture file="Interface\Buttons\UI-RadioButton">
<TexCoords left="0.25" right="0.5" top="0" bottom="1"/>
</CheckedTexture>
</CheckButton>
<Frame name="AuxFrameBoxTemplate" virtual="true">
<Layers>
<Layer level="BACKGROUND">
@@ -126,7 +159,6 @@
<EditBox name="AuxInputBoxTemplate" autoFocus="false" inherits="InputBoxTemplate" virtual="true">
<Size><AbsDimension x="119" y="22"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="16" y="-71"/></Offset></Anchor></Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString name="$parentLabel" inherits="GameFontNormalSmall" justifyH="LEFT">
@@ -138,7 +170,7 @@
<Slider name="AuxSliderTemplate" orientation="HORIZONTAL" enableMouse="true" virtual="true">
<Size>
<AbsDimension x="128" y="17"/>
<AbsDimension x="150" y="17"/>
</Size>
<HitRectInsets>
<AbsInset left="0" right="0" top="-10" bottom="-10"/>
@@ -156,7 +188,7 @@
</Backdrop>
<Layers>
<Layer level="ARTWORK">
<FontString name="$parentText" inherits="GameFontHighlightSmall">
<FontString name="$parentText" inherits="GameFontNormalSmall">
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT"/>
</Anchors>
@@ -170,9 +202,22 @@
</ThumbTexture>
</Slider>
<Button name="AuxButton" inherits="UIPanelButtonTemplate" text="Aux" hidden="true">
<Size><AbsDimension x="50" y="22"/></Size>
<Scripts>
<OnClick>
if AuxFrame:IsVisible() then
AuxFrame:Hide()
else
AuxFrame:Show()
end
</OnClick>
</Scripts>
</Button>
<Frame name="AuxFrame" toplevel="true" movable="true" enableMouse="true" hidden="true" parent="UIParent">
<Size>
<AbsDimension x="850" y="450"/>
<AbsDimension x="850" y="445"/>
</Size>
<Anchors>
<Anchor point="CENTER"/>
@@ -201,7 +246,7 @@
</EdgeSize>
</Backdrop>
<Frames>
<Button name="AuctionFrameCloseButton" inherits="UIPanelCloseButton">
<Button name="AuxCloseButtonTop" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
@@ -210,6 +255,15 @@
</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="AuxTab1" inherits="AuxTabTemplate" id="1">
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT">
@@ -296,6 +350,7 @@
</Anchors>
<Scripts>
<OnLoad>
this:SetWidth(floor(this:GetParent():GetWidth()/2))
this:SetBackdropBorderColor(0.4, 0.4, 0.4)
this:SetBackdropColor(0.15, 0.15, 0.15)
</OnLoad>
+12 -12
View File
@@ -65,9 +65,12 @@ function wait_for_complete_results(k)
end, k)
end
function wait_for_callback(f, args, k)
function wait_for_callback(args)
local ok = true
local f = tremove(args, 1)
local k = tremove(args)
if f then
tinsert(args, {
suspend = function() ok = false end,
@@ -87,12 +90,10 @@ function scan()
submit_query(function()
local count, total_count = GetNumAuctionItems("list")
local count, _ = GetNumAuctionItems('list')
scan_auctions(count, function()
state.total_pages = math.ceil(total_count / AUCTIONS_PER_PAGE)
state.page = state.job.next_page and state.job.next_page(state.page, state.total_pages)
if state.page then
@@ -112,7 +113,7 @@ function scan_auctions(count, k)
end
function scan_auctions_helper(i, n, k)
wait_for_callback(state.job.on_read_auction, {i}, function()
wait_for_callback{state.job.on_read_auction, i, function()
if i >= n then
return k()
@@ -120,23 +121,22 @@ function scan_auctions_helper(i, n, k)
return scan_auctions_helper(i + 1, n, k)
end
end)
end}
end
function submit_query(k)
if state.page then
wait_for_callback(state.job.on_start_page, {state.page, state.total_pages or 0}, function()
controller().wait(CanSendAuctionQuery, function()
if state.job.on_submit_query then
state.job.on_submit_query()
end
wait_for_results(function()
--wait_for_complete_results(function()
if state.job.on_page_loaded then
state.job.on_page_loaded(state.page)
end
local _, total_count = GetNumAuctionItems('list')
state.total_pages = math.ceil(total_count / AUCTIONS_PER_PAGE)
wait_for_callback{state.job.on_page_loaded, state.page, state.total_pages, function()
k()
end)--end)
end}end)-- end)
QueryAuctionItems(
state.job.query.name,
state.job.query.min_level,
@@ -148,7 +148,7 @@ function submit_query(k)
state.job.query.usable,
state.job.query.quality
)
end)end)
end)
else
return k()
end
+93 -157
View File
@@ -10,6 +10,8 @@ local current_auction
local set_auction, update_auction_listing, update_inventory_listing, record_auction, undercut, item_class_index, item_subclass_index, report, select_entry, update_recommendation, refresh_entries, auction_candidates, charge_classes, get_stack_size_slider_value
local LIVE, HISTORICAL = 1, 2
Aux.sell.inventory_listing_config = {
on_cell_click = function (sheet, row_index, column_index)
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
@@ -36,9 +38,18 @@ Aux.sell.inventory_listing_config = {
end,
columns = {
{
title = 'Qty',
width = 23,
comparator = function(datum1, datum2) return Aux.util.compare(datum1.aux_quantity, datum2.aux_quantity, Aux.util.LT) end,
cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
cell_setter = function(cell, datum)
cell.text:SetText(datum.aux_quantity)
end,
},
{
title = 'Item',
width = 175,
width = 186,
comparator = function(row1, row2) return Aux.util.compare(row1.name, row2.name, Aux.util.GT) end,
cell_initializer = function(cell)
local icon = CreateFrame('Button', nil, cell)
@@ -74,17 +85,8 @@ Aux.sell.inventory_listing_config = {
cell.text:SetTextColor(color.r, color.g, color.b)
end,
},
{
title = 'Qty',
width = 23,
comparator = function(datum1, datum2) return Aux.util.compare(datum1.aux_quantity, datum2.aux_quantity, Aux.util.LT) end,
cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
cell_setter = function(cell, datum)
cell.text:SetText(datum.aux_quantity)
end,
},
},
sort_order = {{column = 1, order = 'ascending' }},
sort_order = {{column = 2, order = 'ascending' }},
}
Aux.sell.auction_listing_config = {
@@ -99,13 +101,14 @@ Aux.sell.auction_listing_config = {
on_cell_leave = function (sheet, row_index, column_index)
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
if not (current_auction and auxSellEntries[current_auction.name] and sheet.data[data_index] == auxSellEntries[current_auction.name].selected) then
local datum = sheet.data[data_index]
if not (datum and current_auction and Aux.util.safe_index{auxSellEntries, current_auction.name, 'selected', 'key'} == datum.key) then
sheet.rows[row_index].highlight:SetAlpha(0)
end
end,
row_setter = function(row, datum)
if datum and current_auction and auxSellEntries[current_auction.name] and auxSellEntries[current_auction.name].selected == datum then
if datum and current_auction and Aux.util.safe_index{auxSellEntries, current_auction.name, 'selected', 'key'} == datum.key then
row.highlight:SetAlpha(.5)
else
row.highlight:SetAlpha(0)
@@ -178,7 +181,7 @@ Aux.sell.auction_listing_config = {
end,
},
},
sort_order = {{column = 2, order = 'ascending' }, {column = 4, order = 'ascending'}},
sort_order = {{column = 4, order = 'ascending' }, {column = 4, order = 'ascending'}},
}
function update_inventory_listing()
@@ -190,12 +193,23 @@ function update_auction_listing()
end
function Aux.sell.on_open()
UIDropDownMenu_SetSelectedValue(AuxSellParametersStrategyDropDown, LIVE)
Aux_Sell_SetAuctionDuration(AUX_AUCTION_DURATION)
AuxSellStackSizeSlider:SetValueStep(1)
AuxSellStackSizeSliderText:SetText('Stack Size')
AuxSellStackCountSlider:SetValueStep(1)
AuxSellStackCountSliderText:SetText('Stack Count')
-- so that it's initialized with zeroes, not sometimes zero, sometimes empty
MoneyInputFrame_SetCopper(AuxSellParametersBuyoutPrice, 100000)
MoneyInputFrame_SetCopper(AuxSellParametersStartPrice, 100000)
MoneyInputFrame_SetCopper(AuxSellParametersBuyoutPrice, 1000)
MoneyInputFrame_SetCopper(AuxSellParametersStartPrice, 1000)
MoneyInputFrame_SetCopper(AuxSellParametersBuyoutPrice, 1)
MoneyInputFrame_SetCopper(AuxSellParametersStartPrice, 1)
Aux.sell.validate_parameters()
inventory_data = auction_candidates()
@@ -204,6 +218,10 @@ function Aux.sell.on_open()
update_auction_listing()
end
function Aux.sell.on_close()
end
function Aux.sell.duration_radio_button_on_click(index)
AuxSellParametersShortDurationRadio:SetChecked(false)
AuxSellParametersMediumDurationRadio:SetChecked(false)
@@ -224,13 +242,6 @@ function Aux.sell.duration_radio_button_on_click(index)
update_recommendation()
end
function Aux_Sell_AuctionFrameAuctions_OnShow()
Aux.orig.AuctionFrameAuctions_OnShow()
Aux_Sell_SetAuctionDuration(AUX_AUCTION_DURATION)
end
-----------------------------------------
function Aux_Sell_SetAuctionDuration(duration)
if duration == 'short' then
Aux.sell.duration_radio_button_on_click(1)
@@ -241,17 +252,6 @@ function Aux_Sell_SetAuctionDuration(duration)
end
end
-----------------------------------------
function Aux_AuctionFrameAuctions_Update()
Aux.orig.AuctionFrameAuctions_Update()
if PanelTemplates_GetSelectedTab(AuctionFrame) == Aux.tabs.sell.index and AuctionFrame:IsShown() then
Aux_HideElems(Aux.tabs.sell.hiddenElements)
end
end
-----------------------------------------
function Aux.sell.post_auctions()
if current_auction then
local name, hyperlink, stack_size, buyout_price, stack_count = current_auction.name, current_auction.hyperlink, get_stack_size_slider_value(), MoneyInputFrame_GetCopper(AuxSellParametersBuyoutPrice), AuxSellStackCountSlider:GetValue()
@@ -283,33 +283,28 @@ function Aux.sell.post_auctions()
end
end
Aux.sell.clear_auction()
inventory_data = auction_candidates()
update_inventory_listing()
report(hyperlink, stack_size, buyout_price, posted)
end
)
end
end
-----------------------------------------
function Aux.sell.AuctionSellItemButton_OnEvent()
Aux.orig.AuctionSellItemButton_OnEvent()
end
function select_entry()
if current_auction and auxSellEntries[current_auction.name] and not auxSellEntries[current_auction.name].selected then
local bestPrice = {} -- a table with one entry per stacksize that is the cheapest auction for that particular stacksize
local bestPrice = {} -- a table with one entry per stack_size that is the cheapest auction for that particular stack_size
local absoluteBest -- the overall cheapest auction
----- find the best price per stacksize and overall -----
for _,auxEntry in ipairs(auxSellEntries[current_auction.name]) do
if not bestPrice[auxEntry.stack_size] or bestPrice[auxEntry.stack_size].unit_buyout_price >= auxEntry.unit_buyout_price then
bestPrice[auxEntry.stack_size] = auxEntry
for _, auction_datum in ipairs(auxSellEntries[current_auction.name]) do
if not bestPrice[auction_datum.stack_size] or bestPrice[auction_datum.stack_size].unit_buyout_price >= auction_datum.unit_buyout_price then
bestPrice[auction_datum.stack_size] = auction_datum
end
if not absoluteBest or absoluteBest.unit_buyout_price > auxEntry.unit_buyout_price then
absoluteBest = auxEntry
if not absoluteBest or absoluteBest.unit_buyout_price > auction_datum.unit_buyout_price then
absoluteBest = auction_datum
end
end
@@ -322,8 +317,6 @@ function select_entry()
end
end
-----------------------------------------
function get_stack_size_slider_value()
if current_auction.charges then
return AuxSellStackSizeSlider.charge_classes[AuxSellStackSizeSlider:GetValue()]
@@ -353,7 +346,7 @@ function Aux.sell.validate_parameters()
end
function update_recommendation()
AuxRecommendStaleText:Hide()
AuxSellParametersStrategyDropDownStaleWarning:SetText()
if not current_auction then
AuxSellRefreshButton:Disable()
@@ -377,21 +370,19 @@ function update_recommendation()
AuxSellParametersItemName:SetText(current_auction.name)
local color = ITEM_QUALITY_COLORS[current_auction.quality]
AuxSellParametersItemName:SetTextColor(color.r, color.g, color.b)
if get_stack_size_slider_value() > 1 then
AuxSellParametersItemCount:SetText(get_stack_size_slider_value())
AuxSellParametersItemCount:Show()
if current_auction.aux_quantity > 1 then
AuxSellParametersItemCount:SetText(current_auction.aux_quantity)
else
AuxSellParametersItemCount:Hide()
AuxSellParametersItemCount:SetText()
end
AuxSellRefreshButton:Enable()
MoneyFrame_Update("AuctionsDepositMoneyFrame", floor(current_auction.vendor_price_per_unit * current_auction.deposit_factor * (current_auction.charges and 1 or get_stack_size_slider_value())) * AuxSellStackCountSlider:GetValue() * AuctionFrameAuctions.duration / 120)
MoneyFrame_Update("AuxSellParametersDepositMoneyFrame", floor(current_auction.vendor_price_per_unit * current_auction.deposit_factor * (current_auction.charges and 1 or get_stack_size_slider_value())) * AuxSellStackCountSlider:GetValue() * AuctionFrameAuctions.duration / 120)
if auxSellEntries[current_auction.name] and auxSellEntries[current_auction.name].selected then
if not auxSellEntries[current_auction.name].created or GetTime() - auxSellEntries[current_auction.name].created > 1800 then
AuxRecommendStaleText:SetText("STALE DATA") -- data older than half an hour marked as stale
AuxRecommendStaleText:Show()
AuxSellParametersStrategyDropDownStaleWarning:SetText("Stale data!") -- data older than half an hour marked as stale
end
local newBuyoutPrice = auxSellEntries[current_auction.name].selected.unit_buyout_price * get_stack_size_slider_value()
@@ -402,7 +393,7 @@ function update_recommendation()
local newStartPrice = newBuyoutPrice * 0.95
Aux_ShowElems(Aux.tabs.sell.recommendationElements)
-- Aux_ShowElems(Aux.tabs.sell.recommendationElements)
-- AuxRecommendText:SetText("Recommended Buyout Price")
-- AuxRecommendPerStackText:SetText("for a stack of "..get_stack_size_slider_value())
@@ -429,15 +420,11 @@ function update_recommendation()
-- else
-- AuxRecommendBasisText:SetText("(based on auction selected below)")
-- end
elseif auxSellEntries[current_auction.name] then
Aux.log("No auctions were found for "..current_auction.name)
auxSellEntries[current_auction.name] = nil
else
-- Aux_HideElems(Aux.tabs.sell.shownElements)
end
else
MoneyInputFrame_SetCopper(AuxSellParametersBuyoutPrice, 0)
MoneyInputFrame_SetCopper(AuxSellParametersStartPrice, 0)
end
end
Aux.sell.scrollbar_update()
end
function Aux.sell.quantity_update()
@@ -459,10 +446,13 @@ end
-----------------------------------------
function set_auction(auction_candidate)
PlaySound("igMainMenuOptionCheckBoxOn")
Aux.scan.abort(function()
current_auction = auction_candidate
update_inventory_listing()
local charge_classes = charge_classes(current_auction.availability)
AuxSellStackSizeSlider.charge_classes = charge_classes
@@ -470,9 +460,8 @@ function set_auction(auction_candidate)
AuxSellStackSizeSlider:SetMinMaxValues(1, stack_size_slider_max)
AuxSellStackSizeSlider:SetValue(stack_size_slider_max)
AuxSellStackCountSlider:SetValue(1)
Aux.sell.quantity_update()
AuxSellStackCountSlider:SetValue(current_auction.aux_quantity) -- reduced to max possible
if not auxSellEntries[current_auction.name] then
refresh_entries()
@@ -481,7 +470,6 @@ function set_auction(auction_candidate)
select_entry()
update_recommendation()
update_auction_listing()
update_inventory_listing()
end)
@@ -569,7 +557,7 @@ function refresh_entries()
-- local class_index = item_class_index(current_auction.class)
-- local subclass_index = item_subclass_index(class_index, current_auction.subclass)
Aux.log('Scanning auctions ...')
Aux.log('Starting scan.')
Aux.scan.start{
query = {
name = name,
@@ -577,24 +565,27 @@ function refresh_entries()
subclass = subclass_index,
},
page = 0,
on_start_page = function(page, total_pages)
Aux.log('Scanning page ' .. page + 1 .. (total_pages > 0 and ' out of ' .. total_pages or '') .. ' ...')
on_page_loaded = function(page, total_pages)
Aux.log('Scanning page '..(page + 1)..' out of '..total_pages..' ...')
end,
on_read_auction = function(i)
local auction_item = Aux.info.auction_item(i)
if auction_item and auction_item.name == name then
local stack_size = auction_item.charges or auction_item.count
record_auction(auction_item.name, stack_size, auction_item.buyout_price, auction_item.duration, auction_item.owner)
local aux_quantity = auction_item.charges or auction_item.count
record_auction(auction_item.name, aux_quantity, auction_item.buyout_price, auction_item.duration, auction_item.owner)
end
end,
on_abort = function()
auxSellEntries[name] = nil
Aux.log('Scan aborted.')
end,
on_complete = function()
auxSellEntries[name] = auxSellEntries[name] or { created = GetTime() }
select_entry()
update_recommendation()
end,
update_auction_listing()
Aux.log('Scan complete: '..getn(auxSellEntries[name])..' '..Aux_PluralizeIf('auction', getn(auxSellEntries[name]))..' of '..current_auction.hyperlink..' found.')
end,
next_page = function(page, total_pages)
local last_page = max(total_pages - 1, 0)
if page < last_page then
@@ -605,82 +596,6 @@ function refresh_entries()
end
end
function Aux.sell.scrollbar_update()
-- local numrows
-- if not current_auction or not auxSellEntries[current_auction.name] then
-- numrows = 0
-- else
-- numrows = getn(auxSellEntries[current_auction.name])
-- end
-- FauxScrollFrame_Update(AuxScrollFrame, numrows, 12, 16)
-- for line = 1, 12 do
-- local dataOffset = 1 -- line + FauxScrollFrame_GetOffset(AuxScrollFrame)
-- local lineEntry = getglobal("AuxSellEntry"..line)
--
-- if numrows <= 12 then
-- lineEntry:SetWidth(603)
-- else
-- lineEntry:SetWidth(585)
-- end
--
-- lineEntry:SetID(dataOffset)
-- if current_auction and dataOffset <= numrows and auxSellEntries[current_auction.name] then
--
-- local entry = auxSellEntries[current_auction.name][dataOffset]
--
-- if auxSellEntries[current_auction.name].selected and entry.unit_buyout_price == auxSellEntries[current_auction.name].selected.unit_buyout_price and entry.stack_size == auxSellEntries[current_auction.name].selected.stack_size then
-- lineEntry:LockHighlight()
-- else
-- lineEntry:UnlockHighlight()
-- end
--
-- local lineEntry_stacks = getglobal("AuxSellEntry"..line.."_Stacks")
-- local lineEntry_time = getglobal("AuxSellEntry"..line.."_Time")
--
-- if entry.max_time_left == 1 then
-- lineEntry_time:SetText("Short")
-- elseif entry.max_time_left == 2 then
-- lineEntry_time:SetText("Medium")
-- elseif entry.max_time_left == 3 then
-- lineEntry_time:SetText("Long")
-- elseif entry.max_time_left == 4 then
-- lineEntry_time:SetText("Very Long")
-- end
--
-- if entry.stack_size == get_stack_size_slider_value() then
-- lineEntry_stacks:SetTextColor(0.2, 0.9, 0.2)
-- else
-- lineEntry_stacks:SetTextColor(1.0, 1.0, 1.0)
-- end
--
-- local own
-- if entry.yours == 0 then
-- own = ""
-- elseif
-- entry.yours == entry.count then
-- own = "(yours)"
-- else
-- own = "(yours: "..entry.yours..")"
-- end
--
-- local tx = string.format("%i %s of %i %s", entry.count, Aux_PluralizeIf("stack", entry.count), entry.stack_size, own)
-- lineEntry_stacks:SetText(tx)
--
-- MoneyFrame_Update("AuxSellEntry"..line.."_UnitPrice", Aux_Round(entry.buyout_price/entry.stack_size))
-- MoneyFrame_Update("AuxSellEntry"..line.."_TotalPrice", Aux_Round(entry.buyout_price))
--
-- lineEntry:Show()
-- else
-- lineEntry:Hide()
-- end
-- end
end
function AuxSellEntry_OnClick(entry)
auxSellEntries[current_auction.name].selected = entry
@@ -696,6 +611,7 @@ function AuxSellRefreshButton_OnClick()
refresh_entries()
select_entry()
update_recommendation()
update_auction_listing()
end)
end
@@ -709,12 +625,12 @@ end
-----------------------------------------
function record_auction(name, stack_size, buyout_price, duration, owner)
function record_auction(name, aux_quantity, buyout_price, duration, owner)
if buyout_price > 0 then
auxSellEntries[name] = auxSellEntries[name] or { created = GetTime() }
local entry
for _, existingEntry in ipairs(auxSellEntries[name]) do
if existingEntry.buyout_price == buyout_price and existingEntry.stack_size == stack_size then
if existingEntry.buyout_price == buyout_price and existingEntry.stack_size == aux_quantity then
entry = existingEntry
end
end
@@ -724,9 +640,11 @@ function record_auction(name, stack_size, buyout_price, duration, owner)
entry.max_time_left = max(entry.max_time_left, duration)
else
entry = {
stack_size = stack_size,
key = aux_quantity..':'..buyout_price,
stack_size = aux_quantity,
buyout_price = buyout_price,
unit_buyout_price = buyout_price / stack_size,
unit_buyout_price = buyout_price / aux_quantity,
max_time_left = duration,
count = 1,
yours = owner == UnitName("player") and 1 or 0,
@@ -763,14 +681,32 @@ end
-- end
-- end
-----------------------------------------
function report(hyperlink, stack_size, buyout_price, posted)
Aux.log(string.format(
'%i auctions of %s x %i posted for %s each)',
'%i %s of %s x %i posted at %s.',
posted,
Aux_PluralizeIf('auction', posted),
hyperlink,
stack_size,
Aux.util.money_string(buyout_price)
))
end
function Aux.sell.initialize_strategy_dropdown()
local function on_click()
UIDropDownMenu_SetSelectedValue(AuxSellParametersStrategyDropDown, this.value)
end
UIDropDownMenu_AddButton{
text = 'Live scan',
value = LIVE,
func = on_click,
}
-- UIDropDownMenu_AddButton{
-- text = 'Historical price',
-- value = HISTORICAL,
-- func = on_click,
-- }
end
+80 -75
View File
@@ -7,16 +7,9 @@
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="AuxRecommendStaleText" inherits="GameFontRedLarge">
<Anchors><Anchor point="TOPLEFT" relativeTo="AuxRecommendText"><Offset><AbsDimension x="430" y="-65"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Frame name="AuxSellInventory" inherits="AuxFrameBoxTemplate">
<Size><AbsDimension x="250" y="326"/></Size>
<Size><AbsDimension x="260" y="326"/></Size>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="5" y="-35"/></Offset></Anchor></Anchors>
<Scripts>
<OnLoad>
@@ -42,7 +35,7 @@
</Frames>
</Frame>
<frame name="AuxSellParameters" inherits="AuxFrameBoxTemplate">
<Size><AbsDimension x="210" y="326"/></Size>
<Size><AbsDimension x="213" y="326"/></Size>
<Anchors><Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="AuxSellInventory"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
<Scripts>
<OnLoad>
@@ -51,19 +44,6 @@
getglobal(this:GetName().."Title"):SetText('Parameters')
</OnLoad>
</Scripts>
<layers>
<layer level="BACKGROUND">
<FontString name="$parentDurationText" inherits="GameFontHighlightSmall" text="Duration">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="10" y="-100"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</layer>
</layers>
<frames>
<Frame name="$parentItem">
<Size><AbsDimension x="193" y="37"/></Size>
@@ -115,7 +95,7 @@
<HighlightTexture alphaMode="ADD" file="Interface\Buttons\ButtonHilight-Square"/>
</Frame>
<Slider name="AuxSellStackSizeSlider" inherits="AuxSliderTemplate">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="10" y="-50"/></Offset></Anchor></Anchors>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="10" y="-70"/></Offset></Anchor></Anchors>
<Scripts>
<OnValueChanged>
Aux.sell.quantity_update()
@@ -123,7 +103,7 @@
</Scripts>
</Slider>
<Slider name="AuxSellStackCountSlider" inherits="AuxSliderTemplate">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="10" y="-80"/></Offset></Anchor></Anchors>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="10" y="-100"/></Offset></Anchor></Anchors>
<Scripts>
<OnValueChanged>
Aux.sell.quantity_update()
@@ -183,50 +163,73 @@
</OnEditFocusGained>
</Scripts>
</EditBox>
<CheckButton name="$parentShortDurationRadio" inherits="SendMailRadioButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentDurationText" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="3" y="-4"/>
</Offset>
</Anchor>
</Anchors>
<CheckButton name="$parentShortDurationRadio" inherits="AuxRadioButtonTemplate">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="11" y="-143"/></Offset></Anchor></Anchors>
<layers>
<layer level="BACKGROUND">
<FontString name="$parentDurationText" inherits="GameFontNormalSmall" text="Duration">
<Anchors><Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT"><Offset><AbsDimension x="0" y="4"/></Offset></Anchor></Anchors>
</FontString>
</layer>
</layers>
<Scripts>
<OnLoad>getglobal(this:GetName().."Text"):SetText("2h");</OnLoad>
<OnClick>Aux.sell.duration_radio_button_on_click(1)</OnClick>
<OnLoad>
getglobal(this:GetName().."Text"):SetText("2h")
</OnLoad>
<OnClick>
Aux.sell.duration_radio_button_on_click(1)
</OnClick>
</Scripts>
</CheckButton>
<CheckButton name="$parentMediumDurationRadio" inherits="SendMailRadioButtonTemplate">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentShortDurationRadio" relativePoint="RIGHT">
<Offset>
<AbsDimension x="44" y="0"/>
</Offset>
</Anchor>
</Anchors>
<CheckButton name="$parentMediumDurationRadio" inherits="AuxRadioButtonTemplate">
<Anchors><Anchor point="LEFT" relativeTo="$parentShortDurationRadio" relativePoint="RIGHT"><Offset><AbsDimension x="30" y="0"/></Offset></Anchor></Anchors>
<Scripts>
<OnLoad>getglobal(this:GetName().."Text"):SetText("8h");</OnLoad>
<OnClick>Aux.sell.duration_radio_button_on_click(2)</OnClick>
<OnLoad>
getglobal(this:GetName()..'Text'):SetText("8h")
</OnLoad>
<OnClick>
Aux.sell.duration_radio_button_on_click(2)
</OnClick>
</Scripts>
</CheckButton>
<CheckButton name="$parentLongDurationRadio" inherits="SendMailRadioButtonTemplate">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentMediumDurationRadio" relativePoint="RIGHT">
<Offset>
<AbsDimension x="44" y="0"/>
</Offset>
</Anchor>
</Anchors>
<CheckButton name="$parentLongDurationRadio" inherits="AuxRadioButtonTemplate">
<Anchors><Anchor point="LEFT" relativeTo="$parentMediumDurationRadio" relativePoint="RIGHT"><Offset><AbsDimension x="30" y="0"/></Offset></Anchor></Anchors>
<Scripts>
<OnLoad>getglobal(this:GetName().."Text"):SetText("24h");</OnLoad>
<OnClick>Aux.sell.duration_radio_button_on_click(3)</OnClick>
<OnLoad>
getglobal(this:GetName().."Text"):SetText("24h")
</OnLoad>
<OnClick>
Aux.sell.duration_radio_button_on_click(3)
</OnClick>
</Scripts>
</CheckButton>
<Frame name="$parentStrategyDropDown" inherits="UIDropDownMenuTemplate">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-11" y="-180" /></Offset></Anchor></Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentLabel" inherits="GameFontNormalSmall" text="Suggestion Based On">
<Anchors><Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT"><Offset><AbsDimension x="21" y="0"/></Offset></Anchor></Anchors>
</FontString>
<FontString name="$parentStaleWarning" inherits="GameFontRedSmall">
<Anchors><Anchor point="LEFT" relativePoint="RIGHT"><Offset><AbsDimension x="-6" y="3"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
UIDropDownMenu_SetWidth(100)
UIDropDownMenu_Initialize(this, Aux.sell.initialize_strategy_dropdown)
</OnLoad>
<OnShow>
UIDropDownMenu_Initialize(this, Aux.sell.initialize_strategy_dropdown)
</OnShow>
</Scripts>
</Frame>
<Frame name="$parentStartPrice" inherits="MoneyInputFrameTemplate">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="12" y="-140"/></Offset></Anchor></Anchors>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="12" y="-221"/></Offset></Anchor></Anchors>
<layers>
<Layer level="ARTWORK">
<FontString name="$parentText" inherits="GameFontHighlightSmall" text="STARTING_PRICE">
<FontString name="$parentText" inherits="GameFontNormalSmall" text="STARTING_PRICE">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-3" y="12"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
@@ -238,10 +241,10 @@
</Scripts>
</Frame>
<Frame name="$parentBuyoutPrice" inherits="MoneyInputFrameTemplate">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="12" y="-170"/></Offset></Anchor></Anchors>
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="12" y="-256"/></Offset></Anchor></Anchors>
<layers>
<Layer level="OVERLAY">
<FontString name="$parentText" inherits="GameFontHighlightSmall" text="Buyout Price |cff808080(optional)|r">
<FontString name="$parentText" inherits="GameFontNormalSmall" text="Buyout Price |cff808080(optional)|r">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-3" y="12"/></Offset></Anchor></Anchors>
</FontString>
<FontString name="$parentErrorText" inherits="GameFontRedSmall" text="AUCTION_BUYOUT_ERROR">
@@ -254,6 +257,22 @@
MoneyInputFrame_SetOnvalueChangedFunc(this, Aux.sell.validate_parameters)
</OnLoad>
</Scripts>
</Frame>
<Frame name="$parentDepositMoneyFrame" inherits="SmallMoneyFrameTemplate">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="62" y="-295"/></Offset></Anchor></Anchors>
<Scripts>
<OnLoad>
SmallMoneyFrame_OnLoad();
MoneyFrame_SetType("AUCTION");
</OnLoad>
</Scripts>
<Layers>
<Layer level="BACKGROUND">
<FontString inherits="GameFontNormal" text="Deposit:">
<Anchors><Anchor point="RIGHT" relativePoint="LEFT"><Offset><AbsDimension x="-5" y="0"/></Offset></Anchor></Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
</frames>
</frame>
@@ -285,13 +304,7 @@
</Frame>
<Button name="AuxSellRefreshButton" inherits="UIPanelButtonTemplate" text="Refresh">
<Size><AbsDimension x="90" y="26"/></Size>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-10" y="10"/>
</Offset>
</Anchor>
</Anchors>
<Anchors><Anchor point="RIGHT" relativePoint="LEFT" relativeTo="AuxCloseButtonBottom"><Offset><AbsDimension x="-25" y="0"/></Offset></Anchor></Anchors>
<Scripts>
<OnClick>
AuxSellRefreshButton_OnClick()
@@ -299,16 +312,8 @@
</Scripts>
</Button>
<Button name="AuxSellPostButton" inherits="UIPanelButtonTemplate" text="Post Auctions">
<Size>
<AbsDimension x="120" y="26"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativePoint="LEFT" relativeTo="AuxSellRefreshButton">
<Offset>
<AbsDimension x="-10" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Size><AbsDimension x="120" y="26"/></Size>
<Anchors><Anchor point="RIGHT" relativePoint="LEFT" relativeTo="AuxSellRefreshButton"><Offset><AbsDimension x="-5" y="0"/></Offset></Anchor></Anchors>
<Scripts>
<OnClick>
Aux.sell.post_auctions()
+22
View File
@@ -9,6 +9,28 @@ local merge, copy_array
function Aux.util.pass()
end
function Aux.util.safe_index(chain)
local target = chain[1]
for i=2,getn(chain) do
if not target then
return
end
target = target[chain[i]]
end
return target
end
function Aux_PluralizeIf(word, count)
if count and count == 1 then
return word
else
return word.."s"
end
end
function Aux.util.without_sound(f)
local orig = UIErrorsFrame.AddMessage
UIErrorsFrame.AddMessage = Aux.util.pass