Quantcast
WoWInterface - View Single Post - AlertFrame identified by numbers?
View Single Post
12-05-20, 05:57 PM   #5
LudiusMaximus
A Frostmaul Preserver
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 280
Wow, this is amazing!! How do you get to know stuff like this?? :-D

Could you also think of a way to SetIgnoreParentAlpha() of alert frames that are already shown; i.e. after the resetterFunc has already been fired?

Anyway, thank you so much!


UPDATE: I think I found a way.

Lua Code:
  1. local collectedAlertFrames = {}
  2. local alertFramesIgnoreParentAlpha = false
  3.  
  4. -- Function I call whenever I toggle UIParent's alpha.
  5. local function SetAlertFramesIgnoreParentAlpha(enable)
  6.   alertFramesIgnoreParentAlpha = enable
  7.   for _, v in pairs(collectedAlertFrames) do
  8.     v:SetIgnoreParentAlpha(enable)
  9.   end
  10. end
  11.  
  12. local function CollectAlertFrame(_, frame)
  13.   if not frame.IEF_collected then
  14.     tinsert(collectedAlertFrames, frame)
  15.     frame.IEF_collected = true
  16.     frame:SetIgnoreParentAlpha(alertFramesIgnoreParentAlpha)
  17.   end
  18. end
  19.  
  20. for _, subSystem in pairs(AlertFrame.alertFrameSubSystems) do
  21.   local pool = type(subSystem) == 'table' and subSystem.alertFramePool
  22.   if type(pool) == 'table' and type(pool.resetterFunc) == 'function' then
  23.     hooksecurefunc(pool, "resetterFunc", CollectAlertFrame)
  24.   end
  25. end
__________________
~ Be the change you want to see in the world... of warcraft interface! ~

Last edited by LudiusMaximus : 12-05-20 at 06:44 PM.
  Reply With Quote