WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   How can I access the UI frames of group members? (https://www.wowinterface.com/forums/showthread.php?t=57946)

Helveg 04-16-20 06:32 PM

How can I access the UI frames of group members?
 
Hi! I tried googling the answer but it seems to be quite difficult to find anything unless you know the exact name of the API or UIObject that you're looking for.

I'd like to add a little button next to each party member's avatar similar to how it's done for minimap buttons. How can I, from LUA, access their frames? I know that for myself I could use the global "PlayerFrame", is there an analog for group members?

Fizzlemizz 04-16-20 08:03 PM

Assuming you're using the default unit frames:

PartyMemberFrame1
PartyMemberFrame2
PartyMemberFrame3
PartyMemberFrame4

or

Code:

for i=1, 4 do
    local frame = _G["PartyMemberFrame"..i]
--  do whatever for the current frame.
end

Typing /fstack and hovering the mouse over a frame will give you what details of the frame are available(/fstack to close again)

You can also extract the code for the Blizzard UI.

Helveg 04-17-20 10:17 AM

Thank you so much! Invaluable information ^_^

Does this community also use StackOverflow?

Seerah 04-17-20 11:51 AM

You might be able to find some generic Lua snippets on Stack Overflow. But most any code will be posted here on the forums or linked to someone's pastebin.


All times are GMT -6. The time now is 02:39 AM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI