from retail
This commit is contained in:
@@ -24,7 +24,9 @@ local SubRegionEventSystem =
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
RemoveSubscriber = function(self, event, subRegion)
|
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,
|
end,
|
||||||
|
|
||||||
Notify = function(self, event, ...)
|
Notify = function(self, event, ...)
|
||||||
|
|||||||
@@ -246,18 +246,6 @@ local function modify(parent, region, parentData, data, first)
|
|||||||
region.FrameTick = FrameTick
|
region.FrameTick = FrameTick
|
||||||
region.TimerTick = TimerTick
|
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 not UpdateText then
|
||||||
if text:GetFont() then
|
if text:GetFont() then
|
||||||
local textStr = data.text_text
|
local textStr = data.text_text
|
||||||
@@ -288,7 +276,25 @@ local function modify(parent, region, parentData, data, first)
|
|||||||
function region:SetVisible(visible)
|
function region:SetVisible(visible)
|
||||||
if visible then
|
if visible then
|
||||||
self:Show()
|
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
|
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()
|
self:Hide()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user