- fixed a potential nil access problem in the CastBar

- fixed a bug causing TargetInfo lines to be forced to contain data. now any of the lines can be empty if the user chooses
This commit is contained in:
Parnic
2008-11-13 21:59:03 +00:00
parent 4923e3c2ca
commit 3f930d4ed2
2 changed files with 2 additions and 12 deletions

View File

@ -378,7 +378,7 @@ function CastBar.prototype:SpellCastStart(unit, spell, rank)
CastBar.super.prototype.SpellCastStart(self, unit, spell, rank)
if (unit ~= self.unit) then return end
local lag = GetTime() - self.spellCastSent
local lag = GetTime() - (self.spellCastSent or 0)
local pos = lag / self.actionDuration
local y = self.settings.barHeight - (pos * self.settings.barHeight)

View File

@ -1008,24 +1008,14 @@ function TargetInfo.prototype:Update(unit)
return
end
if DogTag == nil or self.moduleSettings.line1Tag == '' then
-- local reactionColor = UnitSelectionColor("target")
-- if (self.tapped) then
-- reactionColor = self:GetHexColor("Tapped")
-- end
-- local line1 = string.format("%s", self.name or '')
if DogTag == nil then
self.frame.targetName:SetText(self.name or '')
self.frame.targetName:SetVertexColor(UnitSelectionColor("target"))
end
if DogTag == nil or self.moduleSettings.line2Tag == '' then
local line2 = string.format("%s %s%s%s%s%s",
self.level or '', self.classLocale or '', self.pvp or '', self.leader or '', self.classification or '', self.targetCombat or '')
self.frame.targetInfo:SetText(line2)
end
if DogTag == nil or self.moduleSettings.line3Tag == '' then
local realm = self.realm and " " .. self.realm or ""
local line3 = string.format("%s%s", self.guild or '', realm)
self.frame.targetGuild:SetText(line3)