mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- 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:
@ -9,6 +9,7 @@ IceHUD.options =
|
||||
type = 'group',
|
||||
name = "IceHUD",
|
||||
desc = "IceHUD",
|
||||
icon = "Interface\\Icons\\Spell_Frost_Frost",
|
||||
args =
|
||||
{
|
||||
headerGeneral = {
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -29,6 +29,7 @@ function TargetHealth.prototype:GetDefaultSettings()
|
||||
settings["showRaidIcon"] = true
|
||||
settings["raidIconXOffset"] = 12
|
||||
settings["raidIconYOffset"] = 0
|
||||
settings["lockIconAlpha"] = false
|
||||
|
||||
return settings
|
||||
end
|
||||
@ -127,6 +128,23 @@ function TargetHealth.prototype:GetOptions()
|
||||
order = 50
|
||||
}
|
||||
|
||||
opts["lockIconAlpha"] = {
|
||||
type = "toggle",
|
||||
name = "Lock raid icon to 100% alpha",
|
||||
desc = "With this enabled, the raid icon is always 100% alpha, regardless of the bar's alpha. Otherwise, it assumes the bar's alpha level.",
|
||||
get = function()
|
||||
return self.moduleSettings.lockIconAlpha
|
||||
end,
|
||||
set = function(value)
|
||||
self.moduleSettings.lockIconAlpha = value
|
||||
self:Redraw()
|
||||
end,
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
order = 51
|
||||
}
|
||||
|
||||
opts["raidIconOnTop"] = {
|
||||
type = "toggle",
|
||||
name = "Draw Raid Icon On Top",
|
||||
@ -141,7 +159,7 @@ function TargetHealth.prototype:GetOptions()
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled or not self.moduleSettings.showRaidIcon
|
||||
end,
|
||||
order = 51
|
||||
order = 52
|
||||
}
|
||||
|
||||
opts["raidIconXOffset"] = {
|
||||
@ -162,7 +180,7 @@ function TargetHealth.prototype:GetOptions()
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
order = 52
|
||||
order = 53
|
||||
}
|
||||
|
||||
opts["raidIconYOffset"] = {
|
||||
@ -183,7 +201,7 @@ function TargetHealth.prototype:GetOptions()
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
order = 53
|
||||
order = 54
|
||||
}
|
||||
|
||||
return opts
|
||||
@ -272,6 +290,10 @@ function TargetHealth.prototype:Update(unit)
|
||||
self:SetBottomText2()
|
||||
end
|
||||
end
|
||||
|
||||
if self.frame.raidIcon then
|
||||
self.frame.raidIcon:SetAlpha(self.moduleSettings.lockIconAlpha and 1 or self.alpha)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user