Thread Tools Display Modes
08-19-20, 12:07 AM   #1
Platine
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 72
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: 56
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 Cliff Giant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 72
Smile

Yes, yes! This is the solution.
Thank you, Goldpaw.
  Reply With Quote
11-19-23, 08:09 AM   #4
Platine
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 72
Bubbles in dungeons

And how to solve the same problem with dungeons?

The C_ChatBubbles.GetAllChatBubbles() function returns the value 0 there.
I can use a function there with a parameter includeForbidden : true
C_ChatBubbles.GetAllChatBubbles(true), then the function bubble:GetNumChildren() does not work:
call 'GetNumChildren' on bad self

Last edited by Platine : 11-19-23 at 08:12 AM.
  Reply With Quote
11-19-23, 08:18 AM   #5
Goldpaw
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 56
Friendly nameplates and most chat bubbles in dungeons and raids are protected and can neither be accessed or modified in any way now.

Blizzard just don't want us touching these things, and even if we found a way a new hotfix would remove it.
  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