From 20b809fc2fff1aa12ebdf7d3835457f0a3819efb Mon Sep 17 00:00:00 2001 From: Anch Date: Fri, 14 Oct 2022 21:29:08 +1300 Subject: [PATCH] token table loading -fix token tables not loading all there items --- AtlasLoot/Core/AtlasLoot.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/AtlasLoot/Core/AtlasLoot.lua b/AtlasLoot/Core/AtlasLoot.lua index cf844dc..e93fd61 100644 --- a/AtlasLoot/Core/AtlasLoot.lua +++ b/AtlasLoot/Core/AtlasLoot.lua @@ -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