Finding Frames of other Addons and overwriting their position
Hi,
Im using several AddOns and some of them do not allow to anchor to certain frames. So what I really would like to do is to be able to find those frames and to overwrite them. Yet I could not find any way to do this. At first I would need to find frames by its name: Code:
local children = { UIParent:GetChildren() } Code:
local frame = EnumerateFrames(); Is there no way to iterate over all frames and to find the frame I need by its name? |
If the frame does have a name, you should be able to type /fstack in-game and mouse over the frame. Type /fstack again to turn it off.
You might also want to install FrameStackGlobalizer |
Hi,
this is not what I need. I mean it is what I need to find the names BUT I need to get a frame by its name in luca code. Not ingame. I need something like: Code:
local frame = FindFrameByName("Grid2LayoutFrame"); -- example |
This code you showed, will work but it will error out if that particular child doesn't have a name
Code:
local children = { UIParent:GetChildren() } Code:
local children = { UIParent:GetChildren() } I've not needed to do this myself but theoretically it is sound. |
Hi, thx for your quick reply.
Yes, the code works. But it only prints out 223 children of 398 Code:
print("amount children: " .. UIParent:GetNumChildren()); example is a child of UIParent. Thats what im getting with /framestack. But this frame is not appearing in the list of frames im printing. Btw. Not Named is never printed out. Its erroring out after 223 items. |
Are you getting an error for trying to access a forbidden object?
|
No, no error. Its just silently crashing. The code after the loop is also not continuing.
Code:
print("amount children: " .. UIParent:GetNumChildren()); is never getting printed. |
|
I think you need to be a bit more specific about what you are trying to anchor too or start your child search at Grid2LayoutFrame.
|
You are right, with BugSack I get an error:
Code:
1x Lybrial_Anchors\init.lua:90: Attempt to access forbidden object from code tainted by an AddOn I have created WeakAuras which are anchored to the personal player resource nameplate. So when the nameplate moves my WeakAuras move too. I want to do this for other AddOns too. Raven for example supports this functionality out of the box. In the options frame I can choose an anchor. Other AddOns like Grid2 or Hekili are not providing such a functionality. That is why I wanted to implement a small Addon which picks up the frames of some predefined AddOns and overwrites their anchor and position on the screen. So for example I have the Grid2LayoutFrame which is the root frame of Grid2 and a child of UIParent. So my Idea was to iterate over all frames of the UIParent to get the Grid2LayoutFrame and to be able to modify its attributes. Without iterating the children of UIParent and comparing the frame names I do not see any possiblity to access the frames that I need. |
Grid2LayoutFrame is the name of the frame. You don't have to "find" it.
Code:
/run print(Grid2LayoutFrame) If you are creating names from strings build from the name you can locate them in the global table Code:
/run print(_G["Grid2LayoutFrame"]) |
Holy moly you are right.
That makes stuff a lot easier. Thank you! |
Makes /fstack look a whole lot more useful ;)
|
Rofl Fizzle .. I actually do it that way but for some reason didn't equate why I do it to why he does but I do it for the same reason... I think the loop exanple confused me .. yes, lets go with that rofl.
|
Not what the OP wanted which is solved (as named frames are global)
But what if you want to see all frames, or rather all frames you are allowed to see, how would one skip over the forbidden one and get the loop above to not fail in the middle? |
|
Thanks Fizzlemizz!
|
I was able to anchor my frames perfectly to the player resource bar:
Code:
if (self.anchorFrame) then Code:
function Raven:SetupFrames() Code:
7x Raven\Nest.lua:918: Action[FrameMeasurement] failed because[Can't measure restricted regions]: attempted from: RavenBarGroupDebuffs:GetLeft(). |
So nameplates are "restricted frames now" so if I would attach raven
to nameplates I would not be able to call functions like GetCenter(), GetLeft() etc on nameplates frame, right? But that is not what im doing here. Im creating another frame, an "anchorFrame" and attach this frame to the nameplates. Raven is then getting attached to the anchorFrame. The error says that raven was not able to call GetLeft() etc. on that anchor frame. So is a child frame of a restricted frame automatically restricted too? Hell that would suck :D |
Yes. Being able to attach an "unrestricted intermediary" frame wold defeat the purpose of restricting nameplates in the first place.
|
But why restricting nameplates anyway? Whats the sense of blocking these API calls?
I mean the restricted API calls are very basic functions. Can you do anything evil with it? |
I can't link to the original post because the old forums got moved, but there's a post from Lore explaining things:
Quote:
|
Ok but first: This is about friendly player nameplates, im talking about the personal resource nameplate and second: Its not only in dungeon. Its restricted everywhere now.
|
Sadly this breaaks addons like Obelisk Quest which helped a lot for me.
https://wowinterface.com/downloads/i...liskQuest.html |
Quote:
|
Quote:
|
Quote:
To stay on topic-ish, the official reason anchoring is being restricted for nameplates is in response to addons drawing lines between them during boss encounters (and potentially providing more information about unit positioning in the game world than intended). |
All times are GMT -6. The time now is 07:53 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI