From 06274c2e9503abcdd0a40153a1562b9f191a6b7c Mon Sep 17 00:00:00 2001 From: RDW Date: Thu, 13 Jul 2023 04:26:18 +0200 Subject: [PATCH] Core: Added handling for RESEARCH_ARTIFACT_COMPLETE This is a more appropriate event for handling completions than CURRENCY_DISPLAY_UPDATE - which was presumably the best available solution at the time when the code was written. --- Core/EventHandlers.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Core/EventHandlers.lua b/Core/EventHandlers.lua index bdf947f7..d2f3f6fa 100644 --- a/Core/EventHandlers.lua +++ b/Core/EventHandlers.lua @@ -59,6 +59,7 @@ function EventHandlers:Register() self:RegisterBucketEvent("BAG_UPDATE", 0.5, "OnBagUpdate") self:RegisterEvent("LOOT_READY", "OnEvent") self:RegisterEvent("CURRENCY_DISPLAY_UPDATE", "OnCurrencyUpdate") + self:RegisterEvent("RESEARCH_ARTIFACT_COMPLETE", "OnResearchArtifactComplete") self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED", "OnCombat") -- Used to detect boss kills that we didn't solo self:RegisterEvent("BANKFRAME_OPENED", "OnEvent") self:RegisterEvent("BANKFRAME_CLOSED", "OnEvent") @@ -233,9 +234,6 @@ end function R:OnCurrencyUpdate(event) self:Debug("Currency updated (" .. event .. ")") - -- Check if any archaeology projects were solved - self:ScanArchFragments(event) - -- Check if any coins were used for k, v in pairs(self.coins) do local currency = GetCurrencyInfo(k) @@ -1108,6 +1106,10 @@ function R:OnBagUpdate() R:ProcessInventoryItems() end +function R:OnResearchArtifactComplete(event, _) + self:ScanArchFragments(event) +end + --[[ OBTAIN DETECTION --------------------------------------------------------------------------------------------------------- -- Some easy, some fairly arcane methods to detect when we've obtained something we're looking for