WoWInterface - View Single Post - AlertFrame identified by numbers?
View Single Post
12-05-20, 04:04 PM   #4
A Scalebane Royal Guard
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
Originally Posted by LudiusMaximus View Post
But I never see the print of my hook...

Am I missing something?
That function runs before your code ever has a chance to hook it.

You need something like:
Lua Code:
  1. local function SetIgnoreParentAlpha(_, frame)
  2.     frame:SetIgnoreParentAlpha(true)
  3. end
  5. for _, subSystem in pairs(AlertFrame.alertFrameSubSystems) do
  6.     local pool = type(subSystem) == 'table' and subSystem.alertFramePool
  7.     if type(pool) == 'table' and type(pool.resetterFunc) == 'function' then
  8.         hooksecurefunc(pool, "resetterFunc", SetIgnoreParentAlpha)
  9.     end
  10. end
Here is an easy way to test it:
/run UIParent:SetAlpha(0.5); NewMountAlertSystem:ShowAlert("123")
  Reply With Quote