from retail

This commit is contained in:
NoM0Re
2025-01-11 16:43:29 +01:00
parent 8fa335c199
commit 96c5618c6b
2 changed files with 21 additions and 13 deletions
+3 -1
View File
@@ -24,7 +24,9 @@ local SubRegionEventSystem =
end,
RemoveSubscriber = function(self, event, subRegion)
tremove(self.events[event], tIndexOf(self.events[event], subRegion))
if self.events[event] then
tremove(self.events[event], tIndexOf(self.events[event], subRegion))
end
end,
Notify = function(self, event, ...)
+18 -12
View File
@@ -246,18 +246,6 @@ local function modify(parent, region, parentData, data, first)
region.FrameTick = FrameTick
region.TimerTick = TimerTick
if Update then
parent.subRegionEvents:AddSubscriber("Update", region)
end
if FrameTick then
parent.subRegionEvents:AddSubscriber("FrameTick", region)
end
if TimerTick then
parent.subRegionEvents:AddSubscriber("TimerTick", region)
end
if not UpdateText then
if text:GetFont() then
local textStr = data.text_text
@@ -288,7 +276,25 @@ local function modify(parent, region, parentData, data, first)
function region:SetVisible(visible)
if visible then
self:Show()
if self.Update then
parent.subRegionEvents:AddSubscriber("Update", region)
end
if self.FrameTick then
parent.subRegionEvents:AddSubscriber("FrameTick", region)
end
if self.TimerTick then
parent.subRegionEvents:AddSubscriber("TimerTick", region)
end
else
if self.Update then
parent.subRegionEvents:RemoveSubscriber("Update", region)
end
if self.FrameTick then
parent.subRegionEvents:RemoveSubscriber("FrameTick", region)
end
if self.TimerTick then
parent.subRegionEvents:RemoveSubscriber("TimerTick", region)
end
self:Hide()
end
end