Refactor progress handling

probably some regressions
This commit is contained in:
NoM0Re
2025-01-22 03:37:10 +01:00
parent a643b275ba
commit 23c7da5ea6
29 changed files with 2037 additions and 1263 deletions
+3 -12
View File
@@ -244,7 +244,7 @@ local function modify(parent, region, parentData, data, first)
end
return data[fullKey]
end
region.subTextFormatters = Private.CreateFormatters(texts, getter)
region.subTextFormatters = Private.CreateFormatters(texts, getter, false, parentData)
function region:ConfigureTextUpdate()
local UpdateText
@@ -273,12 +273,11 @@ local function modify(parent, region, parentData, data, first)
Update = UpdateText
end
local TimerTick
local FrameTick
if Private.ContainsPlaceHolders(region.text_text, "p") then
TimerTick = UpdateText
FrameTick = UpdateText
end
local FrameTick
if parent.customTextFunc and parentData.customTextUpdate == "update" then
if Private.ContainsCustomPlaceHolder(region.text_text) then
FrameTick = function()
@@ -293,7 +292,6 @@ local function modify(parent, region, parentData, data, first)
region.Update = Update
region.FrameTick = FrameTick
region.TimerTick = TimerTick
if not UpdateText then
if text:GetFont() then
@@ -320,13 +318,6 @@ local function modify(parent, region, parentData, data, first)
else
parent.subRegionEvents:RemoveSubscriber("FrameTick", region)
end
if self.TimerTick then
if visible then
parent.subRegionEvents:AddSubscriber("TimerTick", region)
end
else
parent.subRegionEvents:RemoveSubscriber("TimerTick", region)
end
if self.Update and parent.state and visible then
self:Update()
end