/
end |
end |
local function UpdatePortrait(self, min, max) |
if(UnitIsDeadOrGhost(self.unit)) then |
self.Portrait:Hide() |
else |
self.Portrait:Show() |
self.Portrait:SetWidth(230 * min/max) |
end |
end |
local function PostUpdateReputation(self, event, unit, bar) |
local name, id = GetWatchedFactionInfo() |
bar:SetStatusBarColor(FACTION_BAR_COLORS[id].r, FACTION_BAR_COLORS[id].g, FACTION_BAR_COLORS[id].b) |
end |
end |
end |
if(self.Portrait) then |
UpdatePortrait(self, min, max) |
end |
end |
local function OverrideCastbarTime(self, duration) |
local power = self.Power:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallLeft') |
power:SetPoint('LEFT', self.Health, 2, -1) |
power.frequentUpdates = true |
if(unit == 'player') then |
self:Tag(power, '[colorpp][curpp]|r') |
self.DruidPower.Text:SetPoint('CENTER', self.DruidPower) |
self.DruidPower.Text:SetTextColor(unpack(colors.power['MANA'])) |
table.insert(self.__elements, UpdateDruidPower) |
self:RegisterEvent('UNIT_MANA', UpdateDruidPower) |
self:RegisterEvent('UNIT_ENERGY', UpdateDruidPower) |
self:RegisterEvent('PLAYER_LOGIN', UpdateDruidPower) |
end |
if(class == 'DEATHKNIGHT') then |
self:SetAttribute('initial-width', 181) |
end |
if(unit == 'player' or unit == 'target') then |
if(unit == 'player' or unit == 'target' or unit == 'pet') then |
self.CombatFeedbackText = self.Health:CreateFontString(nil, 'OVERLAY', 'GameFontNormal') |
self.CombatFeedbackText:SetPoint('CENTER', self) |
self.Castbar.bg = self.Castbar:CreateTexture(nil, 'BORDER') |
self.Castbar.bg:SetAllPoints(self.Castbar) |
self.Castbar.bg:SetTexture(0.3, 0.3, 0.3) |
end |
if(unit == 'target' or unit == 'player') then |
self.Portrait = CreateFrame('PlayerModel', nil, self) |
self.Portrait:SetPoint('TOPLEFT', self.Health) |
self.Portrait:SetPoint('BOTTOMLEFT', self.Health) |
self.Portrait:SetAlpha(0.1) |
self.Portrait:SetWidth(230) |
self:RegisterEvent('PLAYER_DEAD', UpdatePortrait) |
self:SetAttribute('initial-height', 27) |
self:SetAttribute('initial-width', 230) |
end |