/branches
end |
NeedToKnow_ExecutiveFrame:RegisterEvent("PLAYER_TALENT_UPDATE") |
NeedToKnow_ExecutiveFrame:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") |
NeedToKnow.Update() |
NeedToKnow_ExecutiveFrame:UnregisterEvent("PLAYER_LOGIN") |
end |
function NeedToKnow.ExecutiveFrame_ACTIVE_TALENT_GROUP_CHANGED() |
-- This is the only event we're guaranteed to get on a talent switch, |
-- so we have to listen for it. However, the client may not yet have |
-- the spellbook updates, so trying to evaluate the cooldows may fail. |
-- This is one of the reasons the cooldown logic has to fail silently |
-- and try again later |
NeedToKnow.ExecutiveFrame_PLAYER_TALENT_UPDATE() |
end |
function NeedToKnow.ExecutiveFrame_PLAYER_TALENT_UPDATE() |
if NeedToKnow.CharSettings then |
local spec = GetActiveTalentGroup() |
function NeedToKnow.Update() |
if UnitExists("player") and NeedToKnow.ProfileSettings then |
NeedToKnow.UpdateWeaponEnchants() |
for groupID = 1, NeedToKnow.ProfileSettings.nGroups do |
NeedToKnow.Group_Update(groupID) |
end |
bar:RegisterEvent("STOP_AUTOREPEAT_SPELL") |
end |
bar:RegisterEvent("ACTIONBAR_UPDATE_COOLDOWN") |
bar:RegisterEvent("SPELL_UPDATE_COOLDOWN") |
elseif ( "USABLE" == bar.settings.BuffOrDebuff ) then |
bar:RegisterEvent("SPELL_UPDATE_USABLE") |
elseif ( "mhand" == bar.settings.Unit or "ohand" == bar.settings.Unit ) then |
end |
elseif ( event == "PLAYER_TOTEM_UPDATE" ) or |
( event == "ACTIONBAR_UPDATE_COOLDOWN" ) or |
( event == "SPELL_UPDATE_COOLDOWN" ) or |
( event == "SPELL_UPDATE_USABLE" ) or |
( event == "PLAYER_REGEN_ENABLED" ) or |
( event == "PLAYER_REGEN_DISABLED" ) |
-- filter out the GCD, we only care about actual spell CDs |
if start and cd_len <= 1.5 and func ~= NeedToKnow.GetAutoShotCooldown then |
if bar.expirationTime then |
if bar.expirationTime and bar.expirationTime <= (start + cd_len) then |
start = bar.expirationTime - bar.duration |
cd_len = bar.duration |
else |