From a4b78fd4d378968c5d3db7753c6a1a3feb4b5fce Mon Sep 17 00:00:00 2001 From: Brad Morgan Date: Sat, 19 Oct 2024 11:29:00 -0600 Subject: [PATCH] Add Auctionator price source (#21) * Add Auctionator price source --- Config.lua | 8 ++++++-- GatheringTracker.toc | 2 +- Utilities.lua | 3 +++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Config.lua b/Config.lua index 917e083..33ac785 100644 --- a/Config.lua +++ b/Config.lua @@ -437,7 +437,8 @@ local generalOptions = { "|cffff0000Supported addon required.|r\n\n" .. "Supports:\n" .. "TradeSkillMaster\n" .. - "RECrystallize", + "RECrystallize\n" .. + "Auctionator", width = 1.70, values = function() local options = {} @@ -456,6 +457,9 @@ local generalOptions = { if GT.priceSources["RECrystallize"] then options[10] = "RECrystallize" end + if GT.priceSources["Auctionator"] then + options[20] = "Auctionator" + end return options end, get = function() return GT.db.profile.General.tsmPrice end, @@ -1547,7 +1551,7 @@ local function UpdateChangedorRemovedSavedVariables() end local function InitializePriceSource() - local priceSources = { "TradeSkillMaster", "RECrystallize" } + local priceSources = { "TradeSkillMaster", "RECrystallize", "Auctionator" } local priceSourcesLoaded = {} for _, source in ipairs(priceSources) do diff --git a/GatheringTracker.toc b/GatheringTracker.toc index 089248a..15a8c8a 100644 --- a/GatheringTracker.toc +++ b/GatheringTracker.toc @@ -3,7 +3,7 @@ ## Notes: Addon for tracking gathered items, supports solo players and groups ## Author: Noshei ## Version: 2.5.5 -## OptionalDeps: TradeSkillMaster, RECrystallize +## OptionalDeps: TradeSkillMaster, RECrystallize, Auctionator ## SavedVariables: GatheringTrackerDB ## AddonCompartmentFunc: GatheringTracker_OnAddonCompartmentClick ## IconTexture: 3692438 diff --git a/Utilities.lua b/Utilities.lua index d2094b5..8e20ad9 100644 --- a/Utilities.lua +++ b/Utilities.lua @@ -275,6 +275,9 @@ function GT:GetItemPrice(itemID) if GT.priceSources["RECrystallize"] and GT.db.profile.General.tsmPrice == 10 then price = (RECrystallize_PriceCheckItemID(itemID) or 0) / 10000 end + if GT.priceSources["Auctionator"] and GT.db.profile.General.tsmPrice == 20 then + price = (Auctionator.API.v1.GetAuctionPriceByItemID("GatheringTracker", itemID) or 0) / 10000 + end if GT.priceSources["TradeSkillMaster"] then price = (TSM_API.GetCustomPriceValue(GT.TSM, "i:" .. itemID) or 0) / 10000 end