Skip to content

Commit

Permalink
Core: Added handling for RESEARCH_ARTIFACT_COMPLETE
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rdw-software committed Jul 13, 2023
1 parent 077bdee commit 06274c2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Core/EventHandlers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 06274c2

Please sign in to comment.