|
local f = CreateFrame("Frame") |
|
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") |
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") |
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) |
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:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") |