WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   PTR General Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=172)
-   -   Bubbles in 9.0.1 (https://www.wowinterface.com/forums/showthread.php?t=58159)

Platine 08-19-20 12:07 AM

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?

Goldpaw 08-26-20 03:52 AM

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

Platine 10-16-20 10:26 AM

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

Platine 11-19-23 08:09 AM

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

Goldpaw 11-19-23 08:18 AM

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.


All times are GMT -6. The time now is 06:56 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI