WoWInterface SVN Aloft

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /branches/pandaria/Aloft/AloftCastWarning
    from Rev 2423 to Rev 2424
    Reverse comparison

Rev 2423 → Rev 2424

AloftCastWarning.lua
402,7 → 402,7
if (not self.db.profile.enable)
or (aloftData.invisible) -- TODO: check aloftData.alphaOverride?
-- or (active and active.endTime <= now)
-- or (aloftData.isTarget or aloftData:IsTarget())
-- or currentTarget
or (not self.db.profile.players and (aloftData.type == "friendlyPlayer" or aloftData.type == "hostilePlayer")) -- TODO: use isPlayer for this? TODO: add a final check for nameplate (class) color (to catch transient color changes)?
or (not self.db.profile.friendly and (aloftData.type == "friendlyPlayer" or aloftData.type == "friendlyNPC")) -- TODO: add a final check for nameplate color (to catch transient color changes)?
-- or (castFrame and layoutFrame and castFrame:GetParent() == layoutFrame and castFrame:IsVisible()) then -- the target cast bar is visible on the current nameplate; disabled for now, redundant: nameplate isTarget check subsumes this
534,32 → 534,29
-- ChatFrame7:AddMessage("AloftCastWarning:Update(): no nameplateId " .. tostring(aloftData.name) .. "/" .. tostring(targetGUId))
end
else
-- ChatFrame7:AddMessage("AloftCastWarning:Update(): current target " .. tostring(aloftData.name) .. "/" .. tostring(targetGUId))
-- ChatFrame7:AddMessage("AloftCastWarning:Update(): no override current target " .. tostring(aloftData.name) .. "/" .. tostring(targetGUId) .. "/" .. tostring(self.db.profile.override) .. "/" .. tostring(currentTarget))
end
 
-- fall through to here: if we have no nameplate id and/or no tracked targetGUId and/or no active cast spellId,
-- or this (via fall through from above) is the current target nameplate (not overridden), then disable any cast warning bar that
-- is showing and/or animation that is in progress
if not (((self.db.profile.override and currentTarget) or nameplateId) and targetGUId and active) then
-- ChatFrame7:AddMessage("AloftCastWarning:Update(): handle non-spell " .. tostring(aloftData.name))
local castWarningFrame = aloftData.castWarningFrame
if castWarningFrame then
if castWarningFrame.event --[[and self:TimeLeft(castWarningFrame.event)]] then
self:CancelTimer(castWarningFrame.event, true)
castWarningFrame.event = nil
castWarningFrame.value = nil
-- ChatFrame7:AddMessage("AloftCastWarning:Update(): cancel obsolete event" .. tostring(aloftData.name))
end
if castWarningFrame.onUpdate then
castWarningFrame:SetScript("OnUpdate", nil)
castWarningFrame.onUpdate = nil
end
if castWarningFrame:IsVisible() then
-- ChatFrame7:AddMessage("AloftCastWarning:Update(): release " .. tostring(aloftData.name))
self:SendMessage("AloftCastWarning:OnCastWarningDataChanged", aloftData, targetGUId, active)
self:ReleaseCastWarning(aloftData)
end
-- ChatFrame7:AddMessage("AloftCastWarning:Update(): handle non-spell " .. tostring(aloftData.name))
 
-- fall through to here: if we have any aspect of a cast warning bar active (event, OnUpdate script, visible bar, etc), when we shouldn't, then clean it up
local castWarningFrame = aloftData.castWarningFrame
if castWarningFrame then
if castWarningFrame.event --[[and self:TimeLeft(castWarningFrame.event)]] then
self:CancelTimer(castWarningFrame.event, true)
castWarningFrame.event = nil
castWarningFrame.value = nil
-- ChatFrame7:AddMessage("AloftCastWarning:Update(): cancel obsolete event" .. tostring(aloftData.name))
end
if castWarningFrame.onUpdate then
castWarningFrame:SetScript("OnUpdate", nil)
castWarningFrame.onUpdate = nil
end
if castWarningFrame:IsVisible() then
-- ChatFrame7:AddMessage("AloftCastWarning:Update(): release " .. tostring(aloftData.name))
self:SendMessage("AloftCastWarning:OnCastWarningDataChanged", aloftData, targetGUId, active)
self:ReleaseCastWarning(aloftData)
end
end
end
 
619,8 → 616,8
 
-- time out old GUId<>ActiveCast mappings
for targetGUId, active in pairs(self.targetGUIdToActiveCast) do
if not (self.db.profile.override or AloftTargetTrackingData:GetGUIdNameplateId(targetGUId)) or (active.fadeEndTime and active.fadeEndTime <= now) or ((active.endTime + (ACTIVE_CAST_TIMEOUT * 1000)) <= now) then
-- no nameplate, or done fading, or ended and timed out
if not AloftTargetTrackingData:GetGUIdNameplateId(targetGUId) or (active.fadeEndTime and active.fadeEndTime <= now) or ((active.endTime + (ACTIVE_CAST_TIMEOUT * 1000)) <= now) then
-- no nameplate, or done fading, or ended and timed out ("now" has moved past these time points)
-- ChatFrame7:AddMessage("AloftCastWarning:OnDataTimeout(): " .. tostring(targetGUId) .. "/" .. tostring(active.id) .. "/" .. tostring(active.startTime) .. "/" .. tostring(active.Time))
self.ReleaseActive(targetGUId)
-- TODO: flag these timeouts to chat
876,6 → 873,7
active = nil
end
else -- we are not already fading
-- ChatFrame7:AddMessage("AloftCastWarning:AnimateActiveCast(): not actively fading")
if now >= active.endTime then -- spell cast/channel is finished, start fading
-- ChatFrame7:AddMessage("AloftCastWarning:AnimateActiveCast(): expired, start fade " .. tostring(aloftData.name) .. "/" .. tostring(castWarningFrame.targetGUId) .. "/" .. tostring(active.id) .. "/" .. tostring(active.name) .. "/" .. tostring(active.rank) .. "|" .. tostring(active.startTime) .. "<" .. tostring(now) .. "<" .. tostring(active.endTime) .. "|" .. tostring(active.fadeEndTime) .. "/" .. tostring(castWarningFrame.event))
-- TODO: transition finished casting to a "conclusion" phase, where the cast warning bar time interval changes to an outcome and is faded out