Quantcast
WoWInterface - View Single Post - Bubbles in 9.0.1
View Single Post
08-26-20, 03:52 AM   #2
Goldpaw
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 55
It returns 0 because all the regions have been moved to a nameless subframe now. I was able to discover the regions more or less this way;

Lua Code:
  1. -- Iterate all the bubbles.
  2. -- This function only returns bubbles we can edit,
  3. -- so we can bypass all the forbidden stuff, and save time.
  4. for _, bubble in pairs(C_ChatBubbles.GetAllChatBubbles()) do
  5.     -- Iterate the children, as the actual bubble content
  6.     -- has been placed in a nameless subframe in 9.0.1.
  7.     for i = 1, bubble:GetNumChildren() do
  8.         local child = select(i, select(i, bubble:GetChildren()))
  9.         if (child:GetObjectType() == "Frame") and (child.String) and (child.Center) then
  10.             -- This is hopefully the frame with the content
  11.             for i = 1, child:GetNumRegions() do
  12.                 local region = select(i, child:GetRegions())
  13.                 if (region:GetObjectType() == "Texture") then
  14.                     local texture = region:GetTexture()
  15.                     -- do something
  16.  
  17.                 elseif (region:GetObjectType() == "FontString") then
  18.                     local text = region
  19.                     -- do something
  20.                 end
  21.             end
  22.         end
  23.     end
  24.  
  25. end
  Reply With Quote