Unify low flash and low color thresholds

Low Flash was using >= while Low Color was using >, so they would activate at ever-so-slightly different values (0.4 vs 0.39999, for example).
This commit is contained in:
Parnic
2022-11-25 15:31:26 -06:00
parent f6db2f3b7c
commit a80daface7

View File

@ -278,12 +278,12 @@ function IceUnitBar.prototype:Update()
-- 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.
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" ]
elseif not self.moduleSettings.scaleHealthColor then
self.settings.colors[ "ScaledHealthColor" ] = self.settings.colors[ "MaxHealthColor" ]
end
if( self.manaPercentage < self.moduleSettings.lowThreshold ) then
if( self.manaPercentage <= self.moduleSettings.lowThreshold ) then
self.settings.colors[ "ScaledManaColor" ] = self.settings.colors[ "MinManaColor" ]
elseif not self.moduleSettings.scaleManaColor then
self.settings.colors[ "ScaledManaColor" ] = self.settings.colors[ "MaxManaColor" ]