|
local f = CreateFrame("Frame") |
|
local function OnLoad() |
if GetActiveTalentGroup() == selfCast then |
SetCVar("autoSelfCast", 1, "AUTO_SELF_CAST_TEXT") --find global string for cvar to fire the event |
else |
SetCVar("autoSelfCast", 0, "AUTO_SELF_CAST_TEXT") |
end |
f:UnregisterEvent("PLAYER_ENTERING_WORLD") |
if GetActiveTalentGroup() == selfCast then |
SetCVar("autoSelfCast", 1, "AUTO_SELF_CAST_TEXT") --find global string for cvar to fire the event |
else |
SetCVar("autoSelfCast", 0, "AUTO_SELF_CAST_TEXT") |
end |
|
local function ToggleSelfCast(spec) |
if spec == selfCast then |
SetCVar("autoSelfCast", 1, "AUTO_SELF_CAST_TEXT") --find global string for cvar to fire the event |
else |
SetCVar("autoSelfCast", 0, "AUTO_SELF_CAST_TEXT") |
end |
end |
f:SetScript("OnEvent", function(self, event, spec) |
if spec == selfCast then |
SetCVar("autoSelfCast", 1, "AUTO_SELF_CAST_TEXT") --find global string for cvar to fire the event |
else |
SetCVar("autoSelfCast", 0, "AUTO_SELF_CAST_TEXT") |
end |
end) |
|
f:RegisterEvent("PLAYER_ENTERING_WORLD") |
f:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") |
f:SetScript("OnEvent", function(self, event, ...) |
if event == "PLAYER_ENTERING_WORLD" then |
OnLoad() |
else |
ToggleSelfCast(...) |
end |
end) |