I'm trying to debug this so I can learn how to handle an event properly
I put the covenant event handler within a code that disables spell activation overlay just to see how it works
Lua Code:
local addon, ns = ...
local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:RegisterEvent("PLAYER_REGEN_ENABLED")
f:RegisterEvent("COVENANT_CHOSEN")
f:SetScript("OnEvent", function(self, event, ...)
if event == "PLAYER_ENTERING_WORLD" then
SetCVar("displaySpellActivationOverlays", 0)
SetCVar("nameplateShowAll", 0)
elseif event == "PLAYER_REGEN_ENABLED" and not IsAddOnLoaded("ConsolePort") then
SetCVar("nameplateShowAll", 0)
elseif event == "COVENANT_CHOSEN" then
print("Hello World! Hello " .. event);
end
end)
local function eventHandler(self, event, ...)
print("Hello World! Hello " .. event);
end
f:SetScript("OnEvent", eventHandler);
if (MouseIsOver(MacroButton)) then
-- do something
end
if (MouseIsOver(MacroNewButton)) then
-- do something
end
The only message I get in-game is
Code:
11:33:15 | Hello World! Hello PLAYER_ENTERING_WORLD
Shouldn't I be getting a Hello COVENANT_CHOSEN?