token table loading

-fix token tables not loading all there items
This commit is contained in:
Anch
2022-10-14 21:29:08 +13:00
parent c19860c16d
commit 20b809fc2f
+9 -3
View File
@@ -22,7 +22,7 @@ AtlasLoot:AddTooltip(frameb, tooltiptext)
AtlasLoot:FindId(name, difficulty)
]]
AtlasLoot = LibStub("AceAddon-3.0"):NewAddon("AtlasLoot", "AceEvent-3.0");
AtlasLoot = LibStub("AceAddon-3.0"):NewAddon("AtlasLoot", "AceEvent-3.0", "AceTimer-3.0")
--Instance required libraries
local BabbleBoss = AtlasLoot_GetLocaleLibBabble("LibBabble-Boss-3.0")
@@ -374,8 +374,9 @@ function AtlasLoot:CreateToken(dataID)
if itemType == select(9, GetItemInfo(itemID)) or itemType2 == select(9, GetItemInfo(itemID)) then
table.insert(AtlasLoot_TokenData[orgID][1], {#AtlasLoot_TokenData[orgID][1] + 1, v[2], v[3], v[4], t.Name});
end
if #AtlasLoot_Data[dataID] == n and #t == c then
AtlasLoot:ShowItemsFrame(AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3]);
if #t == n then
AtlasLoot:CancelTimer(AtlasLoot.refreshTimer);
AtlasLoot.refreshTimer = AtlasLoot:ScheduleTimer("Refresh", 2);
end
end)
end
@@ -383,6 +384,11 @@ function AtlasLoot:CreateToken(dataID)
end
end
-- Refresh loottable after token table creation.
function AtlasLoot:Refresh()
AtlasLoot:ShowItemsFrame(AtlasLootItemsFrame.refresh[1], AtlasLootItemsFrame.refresh[2], AtlasLootItemsFrame.refresh[3]);
end
--[[
AtlasLoot:ShowItemsFrame(dataID, dataSource, tablenum):
dataID - Name of the loot table