mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -05:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
c5c44edf64
|
|||
59f2792ce8
|
|||
a80daface7
|
|||
f6db2f3b7c
|
|||
5d09cad6cb
|
|||
8fc2e326aa
|
@ -87,7 +87,7 @@ function IceUnitBar.prototype:GetOptions()
|
|||||||
self:Redraw()
|
self:Redraw()
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled or not self.moduleSettings.lowThresholdFlash
|
return not self.moduleSettings.enabled or not (self.moduleSettings.lowThresholdFlash or self.moduleSettings.lowThresholdColor)
|
||||||
end,
|
end,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 1,
|
max = 1,
|
||||||
@ -105,10 +105,14 @@ function IceUnitBar.prototype:GetOptions()
|
|||||||
end,
|
end,
|
||||||
set = function(info, v)
|
set = function(info, v)
|
||||||
self.moduleSettings.lowThresholdFlash = v
|
self.moduleSettings.lowThresholdFlash = v
|
||||||
|
self:Redraw()
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled
|
return not self.moduleSettings.enabled
|
||||||
end,
|
end,
|
||||||
|
hidden = function()
|
||||||
|
return self.noFlash
|
||||||
|
end,
|
||||||
order = 30.092
|
order = 30.092
|
||||||
}
|
}
|
||||||
opts["lowThresholdColor"] = {
|
opts["lowThresholdColor"] = {
|
||||||
@ -123,7 +127,7 @@ function IceUnitBar.prototype:GetOptions()
|
|||||||
self:Redraw()
|
self:Redraw()
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled or not (self.moduleSettings.scaleHealthColor and self.moduleSettings.scaleManaColor)
|
return not self.moduleSettings.enabled
|
||||||
end,
|
end,
|
||||||
order = 30.093
|
order = 30.093
|
||||||
}
|
}
|
||||||
@ -278,14 +282,14 @@ function IceUnitBar.prototype:Update()
|
|||||||
-- This looks slightly quirky. Basically the easiest way for me to achieve this is to have lowThresholdColor override
|
-- This looks slightly quirky. Basically the easiest way for me to achieve this is to have lowThresholdColor override
|
||||||
-- the scaled color. You'll need to switch them both on to get things to work.
|
-- the scaled color. You'll need to switch them both on to get things to work.
|
||||||
if( self.moduleSettings.lowThresholdColor ) then
|
if( self.moduleSettings.lowThresholdColor ) then
|
||||||
if( self.healthPercentage < self.moduleSettings.lowThreshold ) then
|
if( self.healthPercentage <= self.moduleSettings.lowThreshold ) then
|
||||||
self.settings.colors[ "ScaledHealthColor" ] = self.settings.colors[ "MinHealthColor" ]
|
self.settings.colors[ "ScaledHealthColor" ] = self.settings.colors[ "MinHealthColor" ]
|
||||||
else
|
elseif not self.moduleSettings.scaleHealthColor then
|
||||||
self.settings.colors[ "ScaledHealthColor" ] = self.settings.colors[ "MaxHealthColor" ]
|
self.settings.colors[ "ScaledHealthColor" ] = self.settings.colors[ "MaxHealthColor" ]
|
||||||
end
|
end
|
||||||
if( self.manaPercentage < self.moduleSettings.lowThreshold ) then
|
if( self.manaPercentage <= self.moduleSettings.lowThreshold ) then
|
||||||
self.settings.colors[ "ScaledManaColor" ] = self.settings.colors[ "MinManaColor" ]
|
self.settings.colors[ "ScaledManaColor" ] = self.settings.colors[ "MinManaColor" ]
|
||||||
else
|
elseif not self.moduleSettings.scaleManaColor then
|
||||||
self.settings.colors[ "ScaledManaColor" ] = self.settings.colors[ "MaxManaColor" ]
|
self.settings.colors[ "ScaledManaColor" ] = self.settings.colors[ "MaxManaColor" ]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
13
changelog.md
13
changelog.md
@ -1,5 +1,18 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
v1.14.9:
|
||||||
|
|
||||||
|
- Fix Low Threshold to be usable even when Color By Health/Mana % is disabled. (ticket #334)
|
||||||
|
|
||||||
|
v1.14.8:
|
||||||
|
|
||||||
|
- Fix Color By Health % to work with Low Threshold Color option. Previously, if Low Threshold was set, the color was always either MaxHealth/MaxMana or MinHealth/MinMana, it would never be colored by health %. Now if both are set, it will scale by health % until it reaches the low threshold, at which point it will switch to the Min color.
|
||||||
|
- Fix Low Threshold color and flashing to work at the same percentage. Previously these were slightly different such that it would start flashing at 40% but not turn to the Min color until 39.9999%, for example.
|
||||||
|
|
||||||
|
v1.14.7:
|
||||||
|
|
||||||
|
- Add option to scale absorb bar by the unit's maximum health.
|
||||||
|
|
||||||
v1.14.6:
|
v1.14.6:
|
||||||
|
|
||||||
- Add ability for buff/debuff watchers to only display when the specified buff/debuff is missing. This also adds the ability to require that the given unit exists. So if you had Unit set to Target, Display mode set to Missing, and Only if unit exists checked, you'd show the bar if you have a target and they don't have the given buff/debuff.
|
- Add ability for buff/debuff watchers to only display when the specified buff/debuff is missing. This also adds the ability to require that the given unit exists. So if you had Unit set to Target, Display mode set to Missing, and Only if unit exists checked, you'd show the bar if you have a target and they don't have the given buff/debuff.
|
||||||
|
@ -144,6 +144,8 @@ function IceCustomHealth.prototype:Update(unit)
|
|||||||
|
|
||||||
if (self.moduleSettings.scaleHealthColor) then
|
if (self.moduleSettings.scaleHealthColor) then
|
||||||
self.color = "ScaledHealthColor"
|
self.color = "ScaledHealthColor"
|
||||||
|
elseif self.moduleSettings.lowThresholdColor and self.healthPercentage <= self.moduleSettings.lowThreshold then
|
||||||
|
self.color = "ScaledHealthColor"
|
||||||
end
|
end
|
||||||
|
|
||||||
if (self.tapped) then
|
if (self.tapped) then
|
||||||
|
@ -364,6 +364,8 @@ function FocusHealth.prototype:Update(unit)
|
|||||||
|
|
||||||
if (self.moduleSettings.scaleHealthColor) then
|
if (self.moduleSettings.scaleHealthColor) then
|
||||||
self.color = "ScaledHealthColor"
|
self.color = "ScaledHealthColor"
|
||||||
|
elseif self.moduleSettings.lowThresholdColor and self.healthPercentage <= self.moduleSettings.lowThreshold then
|
||||||
|
self.color = "ScaledHealthColor"
|
||||||
end
|
end
|
||||||
|
|
||||||
if (self.tapped) then
|
if (self.tapped) then
|
||||||
|
@ -88,6 +88,8 @@ function FocusMana.prototype:Update(unit)
|
|||||||
local color = "FocusMana"
|
local color = "FocusMana"
|
||||||
if (self.moduleSettings.scaleManaColor) then
|
if (self.moduleSettings.scaleManaColor) then
|
||||||
color = "ScaledManaColor"
|
color = "ScaledManaColor"
|
||||||
|
elseif self.moduleSettings.lowThresholdColor and self.manaPercentage <= self.moduleSettings.lowThreshold then
|
||||||
|
color = "ScaledManaColor"
|
||||||
end
|
end
|
||||||
if (manaType == SPELL_POWER_RAGE) then
|
if (manaType == SPELL_POWER_RAGE) then
|
||||||
color = "FocusRage"
|
color = "FocusRage"
|
||||||
|
@ -93,6 +93,8 @@ function PetHealth.prototype:Update(unit)
|
|||||||
|
|
||||||
if (self.moduleSettings.scaleHealthColor) then
|
if (self.moduleSettings.scaleHealthColor) then
|
||||||
color = "ScaledHealthColor"
|
color = "ScaledHealthColor"
|
||||||
|
elseif self.moduleSettings.lowThresholdColor and self.healthPercentage <= self.moduleSettings.lowThreshold then
|
||||||
|
color = "ScaledHealthColor"
|
||||||
end
|
end
|
||||||
|
|
||||||
if not (self.alive) then
|
if not (self.alive) then
|
||||||
|
@ -173,6 +173,8 @@ function PetMana.prototype:Update(unit)
|
|||||||
local color = "PetMana"
|
local color = "PetMana"
|
||||||
if (self.moduleSettings.scaleManaColor) then
|
if (self.moduleSettings.scaleManaColor) then
|
||||||
color = "ScaledManaColor"
|
color = "ScaledManaColor"
|
||||||
|
elseif self.moduleSettings.lowThresholdColor and self.manaPercentage <= self.moduleSettings.lowThreshold then
|
||||||
|
color = "ScaledManaColor"
|
||||||
end
|
end
|
||||||
if not (self.alive) then
|
if not (self.alive) then
|
||||||
color = "Dead"
|
color = "Dead"
|
||||||
|
@ -1276,6 +1276,8 @@ function PlayerHealth.prototype:Update(unit)
|
|||||||
|
|
||||||
if (self.moduleSettings.scaleHealthColor) then
|
if (self.moduleSettings.scaleHealthColor) then
|
||||||
color = "ScaledHealthColor"
|
color = "ScaledHealthColor"
|
||||||
|
elseif self.moduleSettings.lowThresholdColor and self.healthPercentage <= self.moduleSettings.lowThreshold then
|
||||||
|
color = "ScaledHealthColor"
|
||||||
end
|
end
|
||||||
|
|
||||||
if not (self.alive) then
|
if not (self.alive) then
|
||||||
|
@ -344,6 +344,8 @@ function PlayerMana.prototype:Update(unit, powertype)
|
|||||||
color = "Dead"
|
color = "Dead"
|
||||||
elseif (self.moduleSettings.scaleManaColor and (UnitPowerType(self.unit) == SPELL_POWER_MANA or self.moduleSettings.scaleManaColorForAll)) then
|
elseif (self.moduleSettings.scaleManaColor and (UnitPowerType(self.unit) == SPELL_POWER_MANA or self.moduleSettings.scaleManaColorForAll)) then
|
||||||
color = "ScaledManaColor"
|
color = "ScaledManaColor"
|
||||||
|
elseif self.moduleSettings.lowThresholdColor and self.manaPercentage <= self.moduleSettings.lowThreshold then
|
||||||
|
color = "ScaledManaColor"
|
||||||
else
|
else
|
||||||
if (self.manaType == SPELL_POWER_RAGE) then
|
if (self.manaType == SPELL_POWER_RAGE) then
|
||||||
color = "PlayerRage"
|
color = "PlayerRage"
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
local L = LibStub("AceLocale-3.0"):GetLocale("IceHUD", false)
|
||||||
IceTargetAbsorb = IceCore_CreateClass(IceUnitBar)
|
IceTargetAbsorb = IceCore_CreateClass(IceUnitBar)
|
||||||
|
|
||||||
IceTargetAbsorb.prototype.highestAbsorbSinceLastZero = 0
|
IceTargetAbsorb.prototype.highestAbsorbSinceLastZero = 0
|
||||||
@ -29,6 +30,28 @@ function IceTargetAbsorb.prototype:GetDefaultSettings()
|
|||||||
return settings
|
return settings
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function IceTargetAbsorb.prototype:GetOptions()
|
||||||
|
local opts = IceTargetAbsorb.super.prototype.GetOptions(self)
|
||||||
|
|
||||||
|
opts["scaleToUnitHealth"] = {
|
||||||
|
type = 'toggle',
|
||||||
|
name = L["Scale to health"],
|
||||||
|
desc = L["Whether the bar's maximum value should be set to the unit's maximum health or not. If set, any absorb above that amount will not be shown."],
|
||||||
|
get = function()
|
||||||
|
return self.moduleSettings.scaleToUnitHealth
|
||||||
|
end,
|
||||||
|
set = function(info, v)
|
||||||
|
self.moduleSettings.scaleToUnitHealth = v
|
||||||
|
self:Update()
|
||||||
|
end,
|
||||||
|
disabled = function()
|
||||||
|
return not self.moduleSettings.enabled
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
return opts
|
||||||
|
end
|
||||||
|
|
||||||
function IceTargetAbsorb.prototype:Enable(core)
|
function IceTargetAbsorb.prototype:Enable(core)
|
||||||
IceTargetAbsorb.super.prototype.Enable(self, core)
|
IceTargetAbsorb.super.prototype.Enable(self, core)
|
||||||
|
|
||||||
@ -47,6 +70,7 @@ function IceTargetAbsorb.prototype:MyUnregisterCustomEvents()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function IceTargetAbsorb.prototype:Update()
|
function IceTargetAbsorb.prototype:Update()
|
||||||
|
IceTargetAbsorb.super.prototype.Update(self)
|
||||||
self:UpdateAbsorbAmount()
|
self:UpdateAbsorbAmount()
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -63,13 +87,17 @@ function IceTargetAbsorb.prototype:UpdateAbsorbAmount(event, unit)
|
|||||||
self.highestAbsorbSinceLastZero = absorbAmount
|
self.highestAbsorbSinceLastZero = absorbAmount
|
||||||
end
|
end
|
||||||
|
|
||||||
self.absorbPercent = self.highestAbsorbSinceLastZero ~= 0 and absorbAmount / self.highestAbsorbSinceLastZero or 0
|
local maxAbsorb = self.highestAbsorbSinceLastZero
|
||||||
|
if self.moduleSettings.scaleToUnitHealth then
|
||||||
|
maxAbsorb = self.maxHealth
|
||||||
|
end
|
||||||
|
self.absorbPercent = maxAbsorb ~= 0 and IceHUD:Clamp(absorbAmount / maxAbsorb, 0, 1) or 0
|
||||||
|
|
||||||
if absorbAmount <= 0 or self.highestAbsorbSinceLastZero <= 0 then
|
if absorbAmount <= 0 or maxAbsorb <= 0 then
|
||||||
self:Show(false)
|
self:Show(false)
|
||||||
else
|
else
|
||||||
self:Show(true)
|
self:Show(true)
|
||||||
self:UpdateBar(absorbAmount / self.highestAbsorbSinceLastZero, self.ColorName)
|
self:UpdateBar(self.absorbPercent, self.ColorName)
|
||||||
end
|
end
|
||||||
|
|
||||||
if not IceHUD.IceCore:ShouldUseDogTags() and self.frame:IsVisible() then
|
if not IceHUD.IceCore:ShouldUseDogTags() and self.frame:IsVisible() then
|
||||||
|
@ -841,6 +841,8 @@ function IceTargetHealth.prototype:Update(unit)
|
|||||||
|
|
||||||
if (self.moduleSettings.scaleHealthColor) then
|
if (self.moduleSettings.scaleHealthColor) then
|
||||||
self.color = "ScaledHealthColor"
|
self.color = "ScaledHealthColor"
|
||||||
|
elseif self.moduleSettings.lowThresholdColor and self.healthPercentage <= self.moduleSettings.lowThreshold then
|
||||||
|
self.color = "ScaledHealthColor"
|
||||||
end
|
end
|
||||||
|
|
||||||
if (self.tapped) then
|
if (self.tapped) then
|
||||||
|
@ -125,6 +125,8 @@ function IceTargetMana.prototype:Update(unit)
|
|||||||
|
|
||||||
if (self.moduleSettings.scaleManaColor) then
|
if (self.moduleSettings.scaleManaColor) then
|
||||||
self.color = "ScaledManaColor"
|
self.color = "ScaledManaColor"
|
||||||
|
elseif self.moduleSettings.lowThresholdColor and self.manaPercentage <= self.moduleSettings.lowThreshold then
|
||||||
|
self.color = "ScaledManaColor"
|
||||||
end
|
end
|
||||||
|
|
||||||
if (manaType == SPELL_POWER_RAGE) then
|
if (manaType == SPELL_POWER_RAGE) then
|
||||||
|
@ -136,6 +136,8 @@ function TargetTargetHealth.prototype:Update(unit)
|
|||||||
|
|
||||||
if (self.moduleSettings.scaleHealthColor) then
|
if (self.moduleSettings.scaleHealthColor) then
|
||||||
self.color = "ScaledHealthColor"
|
self.color = "ScaledHealthColor"
|
||||||
|
elseif self.moduleSettings.lowThresholdColor and self.healthPercentage <= self.moduleSettings.lowThreshold then
|
||||||
|
self.color = "ScaledHealthColor"
|
||||||
end
|
end
|
||||||
|
|
||||||
if (self.tapped) then
|
if (self.tapped) then
|
||||||
|
@ -83,6 +83,8 @@ function TargetTargetMana.prototype:Update(unit)
|
|||||||
|
|
||||||
if (self.moduleSettings.scaleManaColor) then
|
if (self.moduleSettings.scaleManaColor) then
|
||||||
self.color = "ScaledManaColor"
|
self.color = "ScaledManaColor"
|
||||||
|
elseif self.moduleSettings.lowThresholdColor and self.manaPercentage <= self.moduleSettings.lowThreshold then
|
||||||
|
self.color = "ScaledManaColor"
|
||||||
end
|
end
|
||||||
|
|
||||||
if (manaType == 1) then
|
if (manaType == 1) then
|
||||||
|
@ -1,5 +1,18 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
v1.14.9:
|
||||||
|
|
||||||
|
- Fix Low Threshold to be usable even when Color By Health/Mana % is disabled. (ticket #334)
|
||||||
|
|
||||||
|
v1.14.8:
|
||||||
|
|
||||||
|
- Fix Color By Health % to work with Low Threshold Color option. Previously, if Low Threshold was set, the color was always either MaxHealth/MaxMana or MinHealth/MinMana, it would never be colored by health %. Now if both are set, it will scale by health % until it reaches the low threshold, at which point it will switch to the Min color.
|
||||||
|
- Fix Low Threshold color and flashing to work at the same percentage. Previously these were slightly different such that it would start flashing at 40% but not turn to the Min color until 39.9999%, for example.
|
||||||
|
|
||||||
|
v1.14.7:
|
||||||
|
|
||||||
|
- Add option to scale absorb bar by the unit's maximum health.
|
||||||
|
|
||||||
v1.14.6:
|
v1.14.6:
|
||||||
|
|
||||||
- Add ability for buff/debuff watchers to only display when the specified buff/debuff is missing. This also adds the ability to require that the given unit exists. So if you had Unit set to Target, Display mode set to Missing, and Only if unit exists checked, you'd show the bar if you have a target and they don't have the given buff/debuff.
|
- Add ability for buff/debuff watchers to only display when the specified buff/debuff is missing. This also adds the ability to require that the given unit exists. So if you had Unit set to Target, Display mode set to Missing, and Only if unit exists checked, you'd show the bar if you have a target and they don't have the given buff/debuff.
|
||||||
|
Reference in New Issue
Block a user