From da8404b172bbce320b9d1e4aeefaf5d463281032 Mon Sep 17 00:00:00 2001 From: Spit <19otari98@gmail.com> Date: Wed, 24 Sep 2025 15:03:57 +0300 Subject: [PATCH 1/5] fix inbox tooltip --- core/tooltip.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tooltip.lua b/core/tooltip.lua index 8fbc32e..5fa18b3 100644 --- a/core/tooltip.lua +++ b/core/tooltip.lua @@ -155,7 +155,7 @@ function game_tooltip_hooks:SetInboxItem(index) local name, _, quantity = GetInboxItem(index) local id = name and info.item_id(name) if id then - local _, itemstring, quality = (id) + local _, itemstring, quality = GetItemInfo(id) if quality and itemstring then local hex = aux.select(4, GetItemQualityColor(tonumber(quality))) local link = hex .. '|H' .. itemstring .. '|h[' .. name .. ']|h' .. FONT_COLOR_CODE_CLOSE From edfa9f7a54cee7ef818e95872971f4cade11350a Mon Sep 17 00:00:00 2001 From: MarcelineVQ Date: Wed, 24 Sep 2025 08:18:34 -0700 Subject: [PATCH 2/5] [ add ] price-per-unit setting saving --- aux-addon.lua | 1 + gui/auction_listing.lua | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/aux-addon.lua b/aux-addon.lua index a63dae2..258ea56 100644 --- a/aux-addon.lua +++ b/aux-addon.lua @@ -68,6 +68,7 @@ function handle.LOAD() post_duration = post.DURATION_24, post_stack = true, undercut = true, + price_per_unit = false, items = {}, item_ids = {}, auctionable_items = {}, diff --git a/gui/auction_listing.lua b/gui/auction_listing.lua index f27a260..d86b6e7 100644 --- a/gui/auction_listing.lua +++ b/gui/auction_listing.lua @@ -11,6 +11,13 @@ local tooltip = require 'aux.core.tooltip' local price_per_unit = false +-- Initialize from account data when available +aux.handle.LOAD = function() + if aux.account_data and aux.account_data.price_per_unit ~= nil then + price_per_unit = aux.account_data.price_per_unit + end +end + local HEAD_HEIGHT = 27 local HEAD_SPACE = 2 @@ -546,6 +553,7 @@ local methods = { if button == 'RightButton' and rt.headCells[this.columnIndex].info.isPrice then price_per_unit = not price_per_unit + aux.account_data.price_per_unit = price_per_unit for _, cell in rt.headCells do if cell.info.isPrice then cell:SetText(cell.info.title[price_per_unit and 1 or 2]) From 12891f443a253d569851c566e0d65a4905145ff4 Mon Sep 17 00:00:00 2001 From: MarcelineVQ Date: Wed, 24 Sep 2025 08:30:18 -0700 Subject: [PATCH 3/5] [ add ] stack size filter --- README.md | 3 +++ tabs/search/filter.lua | 2 +- util/filter.lua | 11 ++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 964b6c9..cd2519f 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,9 @@ This will scan for usable recipes and exclude those with "libram" in the tooltip **armor/cloth/50/intellect/stamina**
This will scan the auction house for cloth armor which has a requirement of at least lvl 50 as well both intellect and stamina stats. +**felcloth/exact/stack/5**
+This will search for auctions of felcloth with exactly 5 items in the stack. + ## Historical Value aux condenses the prices you've scanned during a day (midnight to midnight) into a single value, similarly to retail Auctioneer's "stat-simple" module. diff --git a/tabs/search/filter.lua b/tabs/search/filter.lua index b95d33d..c2ce2ae 100644 --- a/tabs/search/filter.lua +++ b/tabs/search/filter.lua @@ -323,7 +323,7 @@ function set_filter_display_offset(x_offset, y_offset) end function initialize_filter_dropdown() - for _, filter in ipairs(T.temp-T.list('and', 'or', 'not', 'price', 'profit', 'vendor-profit', 'disenchant-profit', 'percent', 'disenchant-percent', 'bid-price', 'bid-profit', 'bid-vendor-profit', 'bid-disenchant-profit', 'bid-percent', 'bid-disenchant-percent', 'item', 'tooltip', 'min-level', 'max-level', 'rarity', 'left', 'utilizable', 'seller', 'isgear')) do + for _, filter in ipairs(T.temp-T.list('and', 'or', 'not', 'price', 'profit', 'vendor-profit', 'disenchant-profit', 'percent', 'disenchant-percent', 'bid-price', 'bid-profit', 'bid-vendor-profit', 'bid-disenchant-profit', 'bid-percent', 'bid-disenchant-percent', 'item', 'tooltip', 'min-level', 'max-level', 'rarity', 'left', 'utilizable', 'seller', 'isgear', 'stack')) do UIDropDownMenu_AddButton(T.map( 'text', filter, 'value', filter, diff --git a/util/filter.lua b/util/filter.lua index 42facb8..0922be0 100644 --- a/util/filter.lua +++ b/util/filter.lua @@ -238,7 +238,16 @@ M.filters = { end end, }, - + + ['stack'] = { + input_type = 'number', + validator = function(size) + return function(auction_record) + return auction_record.aux_quantity == size + end + end + }, + } function operator(str) From 2c9013e797d7efc6bc78be183262c34b0bffe386 Mon Sep 17 00:00:00 2001 From: MarcelineVQ Date: Wed, 24 Sep 2025 08:00:14 -0700 Subject: [PATCH 4/5] [ add ] purchase summary window Adds an optional purchase summary window to track gold use during a purchase session --- README.md | 2 + aux-addon.lua | 8 ++ aux-addon.toc | 1 + core/slash.lua | 9 ++ gui/purchase_summary.lua | 227 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 247 insertions(+) create mode 100644 gui/purchase_summary.lua diff --git a/README.md b/README.md index 964b6c9..e7dc09c 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ The most advanced auction house addOn for the 1.12 client with some features mor * Sorting across all scanned pages. * Quick buying from any page without rescanning everything. * Real time mode which continuously scans the last page. +* Purchase summary window to track gold spent during a session. ### Post * Automatic assembling and posting of multiple stacks. @@ -67,6 +68,7 @@ The most advanced auction house addOn for the 1.12 client with some features mor **/aux post duration _hours_** (Sets the default auction duration to _2_/_8_/_24_ hours)
**/aux sharing** (Enable or disable auction data sharing as described above)
**/aux theme** (Switch between the two themes)
+**/aux purchase summary** (Toggles the purchase summary window that tracks gold spending)
### Tooltip **/aux tooltip value**
**/aux tooltip daily**
diff --git a/aux-addon.lua b/aux-addon.lua index a63dae2..2c7ea7a 100644 --- a/aux-addon.lua +++ b/aux-addon.lua @@ -3,6 +3,7 @@ module 'aux' local T = require 'T' local post = require 'aux.tabs.post' local gui = require 'aux.gui' +local purchase_summary = require 'aux.util.purchase_summary' M.print = T.vararg-function(arg) DEFAULT_CHAT_FRAME:AddMessage(LIGHTYELLOW_FONT_COLOR_CODE .. ' ' .. join(map(arg, tostring), ' ')) @@ -68,6 +69,7 @@ function handle.LOAD() post_duration = post.DURATION_24, post_stack = true, undercut = true, + purchase_summary = true, items = {}, item_ids = {}, auctionable_items = {}, @@ -162,7 +164,13 @@ do if money >= amount then locked = true local send_signal, signal_received = signal() + local name, texture, count, _, _, _, _, _, buyout_price = GetAuctionItemInfo(type, index) thread(when, signal_received, function() + -- Track all (buyout) purchases after successful bid + if name and amount > 0 and amount >= buyout_price then + purchase_summary.add_purchase(name, texture, count, amount) + purchase_summary.update_display() + end do (on_success or pass)() end locked = false end) diff --git a/aux-addon.toc b/aux-addon.toc index 67a58e0..93bae1d 100644 --- a/aux-addon.toc +++ b/aux-addon.toc @@ -35,6 +35,7 @@ core\shortcut.lua gui\listing.lua gui\auction_listing.lua gui\item_listing.lua +gui\purchase_summary.lua tabs\search\core.lua tabs\search\results.lua diff --git a/core/slash.lua b/core/slash.lua index cb3978c..406db4d 100644 --- a/core/slash.lua +++ b/core/slash.lua @@ -4,6 +4,7 @@ local T = require 'T' local aux = require 'aux' local info = require 'aux.util.info' local post = require 'aux.tabs.post' +local purchase_summary = require 'aux.util.purchase_summary' function status(enabled) return (enabled and aux.color.green'on' or aux.color.red'off') @@ -76,6 +77,13 @@ function SlashCmdList.AUX(command) elseif arguments[1] == 'show' and arguments[2] == 'hidden' then aux.account_data.showhidden = not aux.account_data.showhidden aux.print('show hidden ' .. status(aux.account_data.showhidden)) + elseif arguments[1] == 'purchase' and arguments[2] == 'summary' then + aux.account_data.purchase_summary = not aux.account_data.purchase_summary + aux.print('purchase summary ' .. status(aux.account_data.purchase_summary)) + -- Hide the frame if disabled + if not aux.account_data.purchase_summary then + purchase_summary.hide() + end else aux.print('Usage:') aux.print('- scale [' .. aux.color.blue(aux.account_data.scale) .. ']') @@ -97,5 +105,6 @@ function SlashCmdList.AUX(command) aux.print('- theme [' .. aux.color[aux.account_data.theme == 'blizzard' and 'green' or 'red']('blizzard') .. ' | ' .. aux.color[aux.account_data.theme == 'modern' and 'green' or 'red']('modern') .. ']') aux.print('- show hidden [' .. status(aux.account_data.showhidden) .. ']') + aux.print('- purchase summary [' .. status(aux.account_data.purchase_summary) .. ']') end end diff --git a/gui/purchase_summary.lua b/gui/purchase_summary.lua new file mode 100644 index 0000000..d75ad38 --- /dev/null +++ b/gui/purchase_summary.lua @@ -0,0 +1,227 @@ +module 'aux.util.purchase_summary' + +local T = require 'T' +local aux = require 'aux' +local gui = require 'aux.gui' +local money = require 'aux.util.money' + +-- Purchase summary data storage +local purchase_summaries = {} + +-- Purchase summary display frame +local purchase_summary_frame + +function M.get_summaries() + return purchase_summaries +end + +function M.clear_summaries() + T.wipe(purchase_summaries) +end + +function M.add_purchase(name, texture, quantity, cost) + if not name then return end + + if not purchase_summaries[name] then + purchase_summaries[name] = { + item_name = name, + texture = texture or '', + total_quantity = 0, + total_cost = 0, + purchase_count = 0 + } + end + + purchase_summaries[name].total_quantity = purchase_summaries[name].total_quantity + (quantity or 0) + purchase_summaries[name].total_cost = purchase_summaries[name].total_cost + (cost or 0) + purchase_summaries[name].purchase_count = purchase_summaries[name].purchase_count + 1 +end + +function create_purchase_summary_frame() + if purchase_summary_frame then return purchase_summary_frame end + + purchase_summary_frame = CreateFrame('Frame', 'AuxPurchaseSummary', UIParent) + purchase_summary_frame:SetWidth(300) + purchase_summary_frame:SetHeight(100) + -- Position differently based on theme + local y_offset = gui.is_blizzard() and 9 or -2 + purchase_summary_frame:SetPoint('BOTTOM', aux.frame, 'TOP', 0, y_offset) + purchase_summary_frame:SetFrameLevel(aux.frame:GetFrameLevel()) + + -- Use aux's standard panel styling + gui.set_panel_style(purchase_summary_frame, 2, 2, 2, 2) + purchase_summary_frame:Hide() + + -- Title text using aux color scheme + local title = purchase_summary_frame:CreateFontString(nil, 'OVERLAY', 'GameFontHighlight') + title:SetPoint('TOPLEFT', 8, -8) + title:SetText('Purchase Summary') + title:SetTextColor(aux.color.label.enabled()) + purchase_summary_frame.title = title + + -- Total spent amount aligned with cost column + local total_spent_text = purchase_summary_frame:CreateFontString(nil, 'OVERLAY', 'GameFontHighlight') + total_spent_text:SetPoint('TOPLEFT', 208, -8) -- Same x as cost column (200 + 8 offset) + total_spent_text:SetWidth(80) + total_spent_text:SetJustifyH('RIGHT') + total_spent_text:SetTextColor(aux.color.label.enabled()) + purchase_summary_frame.total_spent_text = total_spent_text + + -- Column headers + local header_item = purchase_summary_frame:CreateFontString(nil, 'OVERLAY', 'GameFontNormalSmall') + header_item:SetPoint('TOPLEFT', title, 'BOTTOMLEFT', 0, -4) + header_item:SetWidth(150) + header_item:SetJustifyH('LEFT') + header_item:SetText('Item') + header_item:SetTextColor(aux.color.label.enabled()) + purchase_summary_frame.header_item = header_item + + local header_count = purchase_summary_frame:CreateFontString(nil, 'OVERLAY', 'GameFontNormalSmall') + header_count:SetPoint('LEFT', header_item, 'RIGHT', 5, 0) + header_count:SetWidth(40) + header_count:SetJustifyH('RIGHT') + header_count:SetText('Count') + header_count:SetTextColor(aux.color.label.enabled()) + purchase_summary_frame.header_count = header_count + + local header_cost = purchase_summary_frame:CreateFontString(nil, 'OVERLAY', 'GameFontNormalSmall') + header_cost:SetPoint('LEFT', header_count, 'RIGHT', 5, 0) + header_cost:SetWidth(80) + header_cost:SetJustifyH('RIGHT') + header_cost:SetText('Gold Spent') + header_cost:SetTextColor(aux.color.label.enabled()) + purchase_summary_frame.header_cost = header_cost + + -- Storage for row frames + purchase_summary_frame.rows = {} + return purchase_summary_frame +end + +function M.update_display() + local frame = create_purchase_summary_frame() + + -- Check if purchase summary is disabled + if not aux.account_data.purchase_summary then + frame:Hide() + return + end + + if not purchase_summaries or aux.size(purchase_summaries) == 0 then + frame:Hide() + return + end + + -- Calculate total spent across all purchases + local total_spent = 0 + for item_name, summary in purchase_summaries do + total_spent = total_spent + (summary.total_cost or 0) + end + + -- Update total spent display aligned with cost column + if total_spent > 0 then + -- Drop copper when displaying gold amounts (same logic as cost column) + local total_string + if total_spent >= 10000 then -- 1 gold = 10000 copper + -- For gold amounts, round to silver and hide copper + local rounded_total = aux.round(total_spent / 100) * 100 -- Round to nearest silver + total_string = money.to_string(rounded_total, nil, true) + else + total_string = money.to_string(total_spent, nil, true) -- Show full amount for smaller values + end + frame.total_spent_text:SetText(total_string) + frame.total_spent_text:Show() + else + frame.total_spent_text:Hide() + end + + -- Clear existing row frames + for _, row in frame.rows do + row:Hide() + end + + -- Create rows for each item + local row_count = 0 + for item_name, summary in purchase_summaries do + row_count = row_count + 1 + + -- Create new row frame if needed + if not frame.rows[row_count] then + local row = CreateFrame('Frame', nil, frame) + row:SetHeight(14) + row:SetWidth(260) -- Reduced width + + -- Item name column + local item_text = row:CreateFontString(nil, 'OVERLAY', 'GameFontNormal') + item_text:SetPoint('TOPLEFT', row, 'TOPLEFT', 0, 0) + item_text:SetWidth(150) + item_text:SetJustifyH('LEFT') + item_text:SetTextColor(aux.color.text.enabled()) + row.item_text = item_text + + -- Count column + local count_text = row:CreateFontString(nil, 'OVERLAY', 'GameFontNormal') + count_text:SetPoint('TOPLEFT', row, 'TOPLEFT', 155, 0) -- 150 + 5 spacing + count_text:SetWidth(40) + count_text:SetJustifyH('RIGHT') + count_text:SetTextColor(aux.color.text.enabled()) + row.count_text = count_text + + -- Cost column + local cost_text = row:CreateFontString(nil, 'OVERLAY', 'GameFontNormal') + cost_text:SetPoint('TOPLEFT', row, 'TOPLEFT', 200, 0) -- 155 + 40 + 5 spacing + cost_text:SetWidth(80) + cost_text:SetJustifyH('RIGHT') + cost_text:SetTextColor(aux.color.text.enabled()) + row.cost_text = cost_text + + frame.rows[row_count] = row + end + + local row = frame.rows[row_count] + + -- Position the row relative to headers or previous row + if row_count == 1 then + row:SetPoint('TOPLEFT', frame.header_item, 'BOTTOMLEFT', 0, -2) + else + row:SetPoint('TOPLEFT', frame.rows[row_count - 1], 'BOTTOMLEFT', 0, 0) + end + + -- Set the text content + row.item_text:SetText(item_name) + row.count_text:SetText(summary.total_quantity .. 'x') + + -- Drop copper when displaying gold amounts + local cost = summary.total_cost or 0 + local cost_string + if cost >= 10000 then -- 1 gold = 10000 copper + -- For gold amounts, round to silver and hide copper + local rounded_cost = aux.round(cost / 100) * 100 -- Round to nearest silver + cost_string = money.to_string(rounded_cost, nil, true) + else + cost_string = money.to_string(cost, nil, true) -- Show full amount for smaller values + end + row.cost_text:SetText(cost_string) + + row:Show() + end + + -- Resize frame to fit content + local estimated_height = 44 + (row_count * 14) -- Header + rows with reduced padding + frame:SetHeight(math.max(60, estimated_height)) + + frame:Show() +end + +function M.hide() + if purchase_summary_frame then + purchase_summary_frame:Hide() + end +end + +-- Set up handlers - use direct function references instead of M. +function aux.handle.CLOSE() + if purchase_summary_frame then + purchase_summary_frame:Hide() + end + T.wipe(purchase_summaries) +end \ No newline at end of file From fe2b7ebd021f92363e87e6ee85df0f568a1ae52d Mon Sep 17 00:00:00 2001 From: MarcelineVQ Date: Wed, 24 Sep 2025 09:08:35 -0700 Subject: [PATCH 5/5] fixup, slightly less conflicting option position --- aux-addon.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aux-addon.lua b/aux-addon.lua index 2c7ea7a..369f326 100644 --- a/aux-addon.lua +++ b/aux-addon.lua @@ -69,7 +69,6 @@ function handle.LOAD() post_duration = post.DURATION_24, post_stack = true, undercut = true, - purchase_summary = true, items = {}, item_ids = {}, auctionable_items = {}, @@ -77,6 +76,7 @@ function handle.LOAD() merchant_sell = {}, sharing = true, theme = 'blizzard', + purchase_summary = true, }) do local key = format('%s|%s', GetCVar'realmName', UnitName'player')