from retail
This commit is contained in:
@@ -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, ...)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user