View Single Post
05-15-16, 01:30 PM   #2
lucro
A Murloc Raider
Join Date: May 2016
Posts: 5
If you look at the source you'll see that the achievement alerts are created using a queued subsystem with
Code:
AchievementAlertSystem = AlertFrame:AddQueuedAlertFrameSubSystem("AchievementAlertFrameTemplate", AchievementAlertFrame_SetUp, 2, 6);
If you look at the source of the queued subsystem definition you'll see the important part is in OnLoad
Code:
function AlertFrameQueueMixin:OnLoad(alertFrameTemplate, setUpFunction, maxAlerts, maxQueue)
	self.alertFramePool = CreateFramePool("BUTTON", UIParent, alertFrameTemplate, OnPooledAlertFrameQueueReset);
-- .. more code ...
end
Primarily the CreateFramePool call returns an instance of a frame pool that now handles the creation and recycling of the alert frames.

The frame pool has some functions that may be relevant to you. Primarily EnumerateActive() that you can use in an a loop to go through all the alerts that are being displayed currently.

For example:
Code:
local achievementAlertPool = AchievementAlertSystem.alertFramePool
for alertFrame in achievementAlertPool:EnumerateActive() do
    --modify the alertFrame however
end

Last edited by lucro : 05-15-16 at 01:57 PM.