Replace BulkContinueOnLoad. Support Primal Nether properly (#21)
* BulkContinueOnLoad is no longer necessary or exists * Add primal nether as soulbound item so TSM handles it correctly * query calles iscached, removed redundancy * missed a then
This commit is contained in:
@@ -234,14 +234,13 @@ function TSM:OnInitialize()
|
||||
|
||||
-- create the main TSM frame
|
||||
TSM:CreateMainFrame()
|
||||
local bulkquerybuffer = {}
|
||||
-- fix any items with spaces in them
|
||||
for itemString, groupPath in pairs(TSM.db.profile.items) do
|
||||
-- check if item is cached
|
||||
local _,_,itemID = itemString:find("item:(%d+)")
|
||||
if itemID then
|
||||
local item = Item:CreateFromID(itemID)
|
||||
if not item:IsCached() then bulkquerybuffer[#bulkquerybuffer+1] = item.itemID end
|
||||
item:Query()
|
||||
end
|
||||
if strfind(itemString, " ") then
|
||||
local newItemString = gsub(itemString, " ", "")
|
||||
@@ -249,7 +248,6 @@ function TSM:OnInitialize()
|
||||
TSM.db.profile.items[itemString] = nil
|
||||
end
|
||||
end
|
||||
TSMAPI:BulkQuery(bulkquerybuffer)
|
||||
|
||||
if TSM.db.profile.deValueSource then
|
||||
TSM.db.profile.destroyValueSource = TSM.db.profile.deValueSource
|
||||
@@ -714,18 +712,6 @@ function TSM:GetAuctionPlayer(player, player_full)
|
||||
end
|
||||
end
|
||||
|
||||
-- Bulk load uncached IDs. Divides in to buckets of 50
|
||||
function TSMAPI:BulkQuery(items)
|
||||
if not items or #items == 0 then return end
|
||||
self.QueryTicker = Timer.NewTicker(1, function()
|
||||
Item:BulkContinueOnLoad(table.take(items, 50), function(id) end, function(id) return GetItemInfo(id) == nil end) -- 3rd parameter (validator) is optional
|
||||
if #items == 0 then
|
||||
self.QueryTicker:Cancel()
|
||||
self.QueryTicker = nil
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
-- GetItemPrice TSMAPI-Extension
|
||||
function TSMAPI:GetItemPrices(itemLink)
|
||||
if not itemLink then return nil end
|
||||
|
||||
Reference in New Issue
Block a user