HealComm: Add toggle for Absorbs and reduce redundant updates (#94)

* HealComm: Add toggle for Absorbs and reduce redundant updates

* HealComm: Throttle updates, cache anchors
This commit is contained in:
scorpzor
2025-12-24 18:16:58 -05:00
committed by GitHub
parent 3d456d036a
commit 5ee511181e
7 changed files with 169 additions and 37 deletions
+17 -9
View File
@@ -100,6 +100,8 @@ local reversibleBar = setmetatable({
"Usage: StatusBar:SetMinMaxValues(number, number)"
)
if self.MINVALUE == minValue and self.MAXVALUE == maxValue then return end
if maxValue > minValue then
self.MINVALUE = minValue
self.MAXVALUE = maxValue
@@ -122,6 +124,7 @@ local reversibleBar = setmetatable({
SetValue = function(self, value)
assert(type(value) == "number", "Usage: StatusBar:SetValue(number)")
if WithinRange(value, self.MINVALUE, self.MAXVALUE) then
if self.VALUE == value then return end
self.VALUE = value
reversibleBar_Update(self)
end
@@ -131,6 +134,7 @@ local reversibleBar = setmetatable({
end,
SetOrientation = function(self, orientation)
if orientation == "HORIZONTAL" or orientation == "VERTICAL" then
if self.ORIENTATION == orientation then return end
self.ORIENTATION = orientation
reversibleBar_Update(self)
end
@@ -139,14 +143,18 @@ local reversibleBar = setmetatable({
return self.ORIENTATION
end,
SetRotatesTexture = function(self, rotate)
self.ROTATE = (rotate ~= nil and rotate ~= false)
local newRotate = (rotate ~= nil and rotate ~= false)
if self.ROTATE == newRotate then return end
self.ROTATE = newRotate
reversibleBar_Update(self)
end,
GetRotatesTexture = function(self)
return self.ROTATE
end,
SetReverseFill = function(self, reverse)
self.REVERSE = (reverse == true)
local newReverse = (reverse == true)
if self.REVERSE == newReverse then return end
self.REVERSE = newReverse
reversibleBar_Update(self)
end,
GetReverseFill = function(self)
@@ -154,16 +162,16 @@ local reversibleBar = setmetatable({
end,
SetFillStyle = function(self, style)
assert(type(style) == "string" or style == nil, "Usage: StatusBar:SetFillStyle(string)")
local newStyle = "STANDARD"
if style and style:lower() == "center" then
self.FILLSTYLE = "CENTER"
reversibleBar_Update(self)
newStyle = "CENTER"
elseif style and style:lower() == "reverse" then
self.FILLSTYLE = "REVERSE"
reversibleBar_Update(self)
else
self.FILLSTYLE = "STANDARD"
reversibleBar_Update(self)
newStyle = "REVERSE"
end
if self.FILLSTYLE == newStyle then return end
self.FILLSTYLE = newStyle
reversibleBar_Update(self)
end,
GetFillStyle = function(self)
return self.FILLSTYLE