- added icon to config for purtiness

- made player icons and raid icons fade according to bar visibility and added a config option to make them always locked to 100%
ICE-5
This commit is contained in:
Parnic
2008-02-15 05:26:03 +00:00
parent 9332f48d0d
commit 3c61a67b6a
3 changed files with 67 additions and 5 deletions

View File

@ -23,6 +23,7 @@ function PlayerHealth.prototype:GetDefaultSettings()
settings["upperText"] = "[PercentHP:Round]"
settings["lowerText"] = "[FractionalHP:HPColor:Bracket]"
settings["allowMouseInteraction"] = true
settings["lockIconAlpha"] = false
settings["showStatusIcon"] = true
settings["statusIconOffset"] = {x=110, y=0}
@ -175,6 +176,20 @@ function PlayerHealth.prototype:GetOptions()
order = 5
},
lockIconAlpha = {
type = "toggle",
name = "Lock all icons to 100% alpha",
desc = "With this enabled, all icons will be 100% visible regardless of the alpha settings for this bar.",
get = function()
return self.moduleSettings.lockIconAlpha
end,
set = function(v)
self.moduleSettings.lockIconAlpha = v
self:Redraw()
end,
order = 6
},
statusIcon = {
type = "toggle",
name = "Show status icon",
@ -525,17 +540,18 @@ end
function PlayerHealth.prototype:EnteringWorld()
self:Resting()
self:CheckCombat()
self:CheckLeader()
self:CheckPvP()
-- Parnic - moved :Resting to the end because it calls Update which sets alpha on everything
self:Resting()
end
function PlayerHealth.prototype:Resting()
self.resting = IsResting()
self:Update(self.unit)
-- moved icon logic above :Update so that it will trigger the alpha settings properly
if (self.resting) then
if self.moduleSettings.showStatusIcon and not self.frame.statusIcon then
self.frame.statusIcon = self:CreateTexCoord(self.frame.statusIcon, "Interface\\CharacterFrame\\UI-StateIcon", 20, 20,
@ -549,6 +565,8 @@ function PlayerHealth.prototype:Resting()
self.frame.statusIcon = self:DestroyTexFrame(self.frame.statusIcon)
end
end
self:Update(self.unit)
end
@ -671,6 +689,27 @@ function PlayerHealth.prototype:Update(unit)
self:SetBottomText1(math.floor(self.healthPercentage * 100))
self:SetBottomText2(self:GetFormattedText(self.health, self.maxHealth), textColor)
end
self:SetIconAlpha()
end
function PlayerHealth.prototype:SetIconAlpha()
if self.frame.statusIcon then
self.frame.statusIcon:SetAlpha(self.moduleSettings.lockIconAlpha and 1 or self.alpha)
end
if self.frame.leaderIcon then
self.frame.leaderIcon:SetAlpha(self.moduleSettings.lockIconAlpha and 1 or self.alpha)
end
if self.frame.lootMasterIcon then
self.frame.lootMasterIcon:SetAlpha(self.moduleSettings.lockIconAlpha and 1 or self.alpha)
end
if self.frame.PvPIcon then
self.frame.PvPIcon:SetAlpha(self.moduleSettings.lockIconAlpha and 1 or self.alpha)
end
end