Quantcast
Bubbles in 9.0.1 - WoWInterface
Thread Tools Display Modes
08-19-20, 12:07 AM   #1
Platine
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 17
Bubbles in 9.0.1

I have a function fired on event CHAT_MSG_MONSTER_SAY - ChatFrame_AddMessageEventFilter("CHAT_MSG_MONSTER_SAY", ChatFilter) :

Code:
local function BB_bubblizeText()
  for i = 1, WorldFrame:GetNumChildren() do
     local child = select(i, WorldFrame:GetChildren());
     if not child:IsForbidden() then
        for j = 1, child:GetNumRegions() do
           region = select(j, child:GetRegions());
           ----more code
        end
     end
  end
  BB_ctrFrame:SetScript("OnUpdate", nil);
end


local function ChatFilter(self, event, arg1, arg2, arg3, _, arg5, ...)
   if (GetCVar("ChatBubbles")) then
      BB_ctrFrame:SetScript("OnUpdate", BB_bubblizeText);
   end
end
Method child:GetNumRegions() return always 0 now.
Is now any other way to review bubblized frames on the screen?

Last edited by Platine : 08-19-20 at 12:18 AM.
  Reply With Quote
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
10-16-20, 10:26 AM   #3
Platine
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 17
Smile

Yes, yes! This is the solution.
Thank you, Goldpaw.
  Reply With Quote

WoWInterface » PTR » PTR General Discussion » Bubbles in 9.0.1

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off