mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
Fix several issues with low thresholds
This addresses a user-reported issue where Low Threshold was not usable with Color By Health/Mana % disabled, due to some internal technical reasons. This was exacerbated by the recent fix that allowed Low Threshold and Color By Health % to work together. This also fixes the low threshold flash to apply immediately when changing the option, and fixes the Low Threshold % slider to be usable without the Low Flash option set. Finally, it hides the Low Flash option for bars that don't support it (right now that's just PlayerMana, I think because it only sets the low threshold to the Min Mana Color even if the class uses a different power type...something for future me...). Fixes wowace ticket #334
This commit is contained in:
@ -87,7 +87,7 @@ function IceUnitBar.prototype:GetOptions()
|
||||
self:Redraw()
|
||||
end,
|
||||
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,
|
||||
min = 0,
|
||||
max = 1,
|
||||
@ -105,10 +105,14 @@ function IceUnitBar.prototype:GetOptions()
|
||||
end,
|
||||
set = function(info, v)
|
||||
self.moduleSettings.lowThresholdFlash = v
|
||||
self:Redraw()
|
||||
end,
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
hidden = function()
|
||||
return self.noFlash
|
||||
end,
|
||||
order = 30.092
|
||||
}
|
||||
opts["lowThresholdColor"] = {
|
||||
@ -123,7 +127,7 @@ function IceUnitBar.prototype:GetOptions()
|
||||
self:Redraw()
|
||||
end,
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled or not (self.moduleSettings.scaleHealthColor and self.moduleSettings.scaleManaColor)
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
order = 30.093
|
||||
}
|
||||
|
@ -1,5 +1,9 @@
|
||||
# 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.
|
||||
|
@ -144,6 +144,8 @@ function IceCustomHealth.prototype:Update(unit)
|
||||
|
||||
if (self.moduleSettings.scaleHealthColor) then
|
||||
self.color = "ScaledHealthColor"
|
||||
elseif self.moduleSettings.lowThresholdColor and self.healthPercentage <= self.moduleSettings.lowThreshold then
|
||||
self.color = "ScaledHealthColor"
|
||||
end
|
||||
|
||||
if (self.tapped) then
|
||||
|
@ -364,6 +364,8 @@ function FocusHealth.prototype:Update(unit)
|
||||
|
||||
if (self.moduleSettings.scaleHealthColor) then
|
||||
self.color = "ScaledHealthColor"
|
||||
elseif self.moduleSettings.lowThresholdColor and self.healthPercentage <= self.moduleSettings.lowThreshold then
|
||||
self.color = "ScaledHealthColor"
|
||||
end
|
||||
|
||||
if (self.tapped) then
|
||||
|
@ -88,6 +88,8 @@ function FocusMana.prototype:Update(unit)
|
||||
local color = "FocusMana"
|
||||
if (self.moduleSettings.scaleManaColor) then
|
||||
color = "ScaledManaColor"
|
||||
elseif self.moduleSettings.lowThresholdColor and self.manaPercentage <= self.moduleSettings.lowThreshold then
|
||||
color = "ScaledManaColor"
|
||||
end
|
||||
if (manaType == SPELL_POWER_RAGE) then
|
||||
color = "FocusRage"
|
||||
|
@ -93,6 +93,8 @@ function PetHealth.prototype:Update(unit)
|
||||
|
||||
if (self.moduleSettings.scaleHealthColor) then
|
||||
color = "ScaledHealthColor"
|
||||
elseif self.moduleSettings.lowThresholdColor and self.healthPercentage <= self.moduleSettings.lowThreshold then
|
||||
color = "ScaledHealthColor"
|
||||
end
|
||||
|
||||
if not (self.alive) then
|
||||
|
@ -173,6 +173,8 @@ function PetMana.prototype:Update(unit)
|
||||
local color = "PetMana"
|
||||
if (self.moduleSettings.scaleManaColor) then
|
||||
color = "ScaledManaColor"
|
||||
elseif self.moduleSettings.lowThresholdColor and self.manaPercentage <= self.moduleSettings.lowThreshold then
|
||||
color = "ScaledManaColor"
|
||||
end
|
||||
if not (self.alive) then
|
||||
color = "Dead"
|
||||
|
@ -1276,6 +1276,8 @@ function PlayerHealth.prototype:Update(unit)
|
||||
|
||||
if (self.moduleSettings.scaleHealthColor) then
|
||||
color = "ScaledHealthColor"
|
||||
elseif self.moduleSettings.lowThresholdColor and self.healthPercentage <= self.moduleSettings.lowThreshold then
|
||||
color = "ScaledHealthColor"
|
||||
end
|
||||
|
||||
if not (self.alive) then
|
||||
|
@ -344,6 +344,8 @@ function PlayerMana.prototype:Update(unit, powertype)
|
||||
color = "Dead"
|
||||
elseif (self.moduleSettings.scaleManaColor and (UnitPowerType(self.unit) == SPELL_POWER_MANA or self.moduleSettings.scaleManaColorForAll)) then
|
||||
color = "ScaledManaColor"
|
||||
elseif self.moduleSettings.lowThresholdColor and self.manaPercentage <= self.moduleSettings.lowThreshold then
|
||||
color = "ScaledManaColor"
|
||||
else
|
||||
if (self.manaType == SPELL_POWER_RAGE) then
|
||||
color = "PlayerRage"
|
||||
|
@ -841,6 +841,8 @@ function IceTargetHealth.prototype:Update(unit)
|
||||
|
||||
if (self.moduleSettings.scaleHealthColor) then
|
||||
self.color = "ScaledHealthColor"
|
||||
elseif self.moduleSettings.lowThresholdColor and self.healthPercentage <= self.moduleSettings.lowThreshold then
|
||||
self.color = "ScaledHealthColor"
|
||||
end
|
||||
|
||||
if (self.tapped) then
|
||||
|
@ -125,6 +125,8 @@ function IceTargetMana.prototype:Update(unit)
|
||||
|
||||
if (self.moduleSettings.scaleManaColor) then
|
||||
self.color = "ScaledManaColor"
|
||||
elseif self.moduleSettings.lowThresholdColor and self.manaPercentage <= self.moduleSettings.lowThreshold then
|
||||
self.color = "ScaledManaColor"
|
||||
end
|
||||
|
||||
if (manaType == SPELL_POWER_RAGE) then
|
||||
|
@ -136,6 +136,8 @@ function TargetTargetHealth.prototype:Update(unit)
|
||||
|
||||
if (self.moduleSettings.scaleHealthColor) then
|
||||
self.color = "ScaledHealthColor"
|
||||
elseif self.moduleSettings.lowThresholdColor and self.healthPercentage <= self.moduleSettings.lowThreshold then
|
||||
self.color = "ScaledHealthColor"
|
||||
end
|
||||
|
||||
if (self.tapped) then
|
||||
|
@ -83,6 +83,8 @@ function TargetTargetMana.prototype:Update(unit)
|
||||
|
||||
if (self.moduleSettings.scaleManaColor) then
|
||||
self.color = "ScaledManaColor"
|
||||
elseif self.moduleSettings.lowThresholdColor and self.manaPercentage <= self.moduleSettings.lowThreshold then
|
||||
self.color = "ScaledManaColor"
|
||||
end
|
||||
|
||||
if (manaType == 1) then
|
||||
|
@ -1,5 +1,9 @@
|
||||
# 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.
|
||||
|
Reference in New Issue
Block a user