begin utilizing ClassicAPI

This commit is contained in:
Brues
2026-05-16 13:02:38 -05:00
parent a8ee751b42
commit 67146ef3a4
12 changed files with 202 additions and 214 deletions
+9
View File
@@ -6,6 +6,7 @@ pfUI:RegisterModule("xpbar", "vanilla:tbc", function ()
data:RegisterEvent("CHAT_MSG_COMBAT_FACTION_CHANGE")
data:RegisterEvent("PLAYER_ENTERING_WORLD")
data:RegisterEvent("PLAYER_LEVEL_UP")
data:RegisterEvent("UPDATE_FACTION")
data:SetScript("OnEvent", function()
if event == "PLAYER_ENTERING_WORLD" then
this.starttime = GetTime()
@@ -16,6 +17,14 @@ pfUI:RegisterModule("xpbar", "vanilla:tbc", function ()
elseif event == "CHAT_MSG_COMBAT_FACTION_CHANGE" then
local _,_, faction, amount = string.find(arg1, parse_faction)
this.faction = faction or this.faction
elseif event == "UPDATE_FACTION" then
-- drop the auto-tracked faction when the user changes the watched one
local watched = C_Reputation.GetWatchedFactionData()
local watchedName = watched and watched.name or nil
if watchedName ~= this.watched then
this.watched = watchedName
this.faction = nil
end
end
end)