fix: Added isUnusable detection with caching
This commit is contained in:
@@ -188,15 +188,9 @@ function BankScanner:Initialize()
|
||||
BankScanner:ClearCache() -- Clear cache on open
|
||||
addon:Debug("Bank opened")
|
||||
|
||||
-- Delay scan to ensure bank is fully loaded
|
||||
local frame = CreateFrame("Frame")
|
||||
local elapsed = 0
|
||||
frame:SetScript("OnUpdate", function()
|
||||
elapsed = elapsed + arg1
|
||||
if elapsed >= 0.5 then
|
||||
frame:SetScript("OnUpdate", nil)
|
||||
BankScanner:SaveToDatabase()
|
||||
end
|
||||
-- Delay scan to ensure bank is fully loaded (uses pooled timer)
|
||||
Guda_ScheduleTimer(0.5, function()
|
||||
BankScanner:SaveToDatabase()
|
||||
end)
|
||||
end, "BankScanner")
|
||||
|
||||
|
||||
@@ -91,16 +91,10 @@ function EquipmentScanner:Initialize()
|
||||
playerLoggedIn = true
|
||||
addon:Print("Scanning equipped items...")
|
||||
|
||||
-- Delay scan to ensure character is fully loaded
|
||||
local frame = CreateFrame("Frame")
|
||||
local elapsed = 0
|
||||
frame:SetScript("OnUpdate", function()
|
||||
elapsed = elapsed + arg1
|
||||
if elapsed >= 2.0 then
|
||||
frame:SetScript("OnUpdate", nil)
|
||||
EquipmentScanner:SaveToDatabase()
|
||||
addon:Print("Equipped items scanned and saved!")
|
||||
end
|
||||
-- Delay scan to ensure character is fully loaded (uses pooled timer)
|
||||
Guda_ScheduleTimer(2.0, function()
|
||||
EquipmentScanner:SaveToDatabase()
|
||||
addon:Print("Equipped items scanned and saved!")
|
||||
end)
|
||||
end, "EquipmentScanner")
|
||||
|
||||
|
||||
+4
-10
@@ -36,17 +36,11 @@ function MoneyTracker:Initialize()
|
||||
MoneyTracker:Update()
|
||||
end, "MoneyTracker")
|
||||
|
||||
-- Initial update and save on login
|
||||
-- Initial update and save on login (uses pooled timer)
|
||||
addon.Modules.Events:OnPlayerLogin(function()
|
||||
local frame = CreateFrame("Frame")
|
||||
local elapsed = 0
|
||||
frame:SetScript("OnUpdate", function()
|
||||
elapsed = elapsed + arg1
|
||||
if elapsed >= 1 then
|
||||
frame:SetScript("OnUpdate", nil)
|
||||
MoneyTracker:Update()
|
||||
addon:Debug("Initial money saved")
|
||||
end
|
||||
Guda_ScheduleTimer(1, function()
|
||||
MoneyTracker:Update()
|
||||
addon:Debug("Initial money saved")
|
||||
end)
|
||||
end, "MoneyTracker")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user