Browse Source

TSMAPI extension + support for Vanity Item search (#14)

* GetItemPrice TSMAPI-Extension

* Itemfilter Vanity Item Support

* Rarity search extended up to heirloom

* Rarity search extended up to heirloom
pull/16/head
RSS90 2 years ago committed by GitHub
parent
commit
acc582c1b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 46
      TradeSkillMaster/TradeSkillMaster.lua
  2. 2
      TradeSkillMaster_Shopping/modules/Search.lua
  3. 2
      TradeSkillMaster_Shopping/sidebar/CustomFilter.lua

46
TradeSkillMaster/TradeSkillMaster.lua

@ -725,3 +725,49 @@ function TSMAPI:BulkQuery(items)
end
end)
end
-- GetItemPrice TSMAPI-Extension
function TSMAPI:GetItemPrices(itemLink)
if not itemLink then return nil end
local prices = {}
-- Get ItemString from ItemLink
local itemString = TSMAPI:GetItemString(itemLink)
if not itemString then return nil end
-- Use TSM:GetCustomPrice to get DBMarket price
prices.DBMarket = TSM:GetCustomPrice("DBMarket", itemString) or 0
-- Use TSM:GetCustomPrice to get DBMinBuyout price
prices.DBMinBuyout = TSM:GetCustomPrice("DBMinBuyout", itemString) or 0
-- Use TSM:GetCustomPrice to get avgBuy price
prices.avgBuy = TSM:GetCustomPrice("avgBuy", itemString) or 0
-- Use TSM:GetCustomPrice to get avgSell price
prices.avgSell = TSM:GetCustomPrice("avgSell", itemString) or 0
-- Use TSM:GetCustomPrice to get maxBuy price
prices.maxBuy = TSM:GetCustomPrice("maxBuy", itemString) or 0
-- Use TSM:GetCustomPrice to get maxSell price
prices.maxSell = TSM:GetCustomPrice("maxSell", itemString) or 0
-- Use TSM:GetCustomPrice to get minBuy price
prices.minBuy = TSM:GetCustomPrice("minBuy", itemString) or 0
-- Use TSM:GetCustomPrice to get minSell price
prices.minSell = TSM:GetCustomPrice("minSell", itemString) or 0
-- Use TSM:GetCustomPrice to get Disenchant price
prices.Disenchant = TSM:GetCustomPrice("Disenchant", itemString) or 0
-- Use TSM:GetCustomPrice to get vendorBuy price
prices.vendorBuy = TSM:GetCustomPrice("vendorBuy", itemString) or 0
-- Use TSM:GetCustomPrice to get vendorSell price
prices.vendorSell = TSM:GetCustomPrice("vendorSell", itemString) or 0
return prices
end

2
TradeSkillMaster_Shopping/modules/Search.lua

@ -420,7 +420,7 @@ local function GetItemSubClass(str, class)
end
local function GetItemRarity(str)
for i=0, 4 do
for i=0, 7 do
local text = _G["ITEM_QUALITY"..i.."_DESC"]
if strlower(str) == strlower(text) then
return i

2
TradeSkillMaster_Shopping/sidebar/CustomFilter.lua

@ -106,7 +106,7 @@ function private.Create(parent)
-- row 6 - rarity
y = y + 60
local rarityList = {}
for i = 1, 4 do tinsert(rarityList, _G["ITEM_QUALITY"..i.."_DESC"]) end
for i = 1, 7 do tinsert(rarityList, _G["ITEM_QUALITY"..i.."_DESC"]) end
local rarityDropdown = TSMAPI.GUI:CreateDropdown(frame, rarityList, "")
rarityDropdown:SetLabel(L["Minimum Rarity"])
rarityDropdown:SetPoint("TOPLEFT", 5, -y)

Loading…
Cancel
Save