Thread Tools Display Modes
12/15/22, 06:50 AM   #1
gandalf.legris
Join Date: Dec 2022
Posts: 5
retrieve the list of players from a group and display it in the xml

I'm trying to understand how to retrieve the list of players from a group and display it in the xml view. If anyone can give me some hints that would be great!
  Reply With Quote
12/15/22, 07:21 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,960
Hello,

what XML view do you mean? Did you create a XML UI yourself where you want to add your group members?

Did you check the ESOUI Wiki for entries relating to group, maybe there are examples:
https://wiki.esoui.com/w/index.php?t...ch=group&go=Go


To get the group members you should check teh existing vanilla game lua code. The files are normally structured in fodler names
like /esoui/ingame/<topic> where <topic> would be somehting like "group" then or "party".

The ESOUI source cod can be found here for example:
https://github.com/esoui/esoui/tree/master/esoui

-> https://github.com/esoui/esoui/tree/...i/ingame/group

In there you often find a base file (an objent oriented approach base "class" that other classes inherit from, e.g. ZO_ClassWhateverBase where later ZO_ClassWhatever_Keyboard and ZO_ClassWhatEver_Gamepad inherit from).
And you often find utility files like grouputils.lua which contain functions used in all kind of group related stuff.
Also xml files can exist that relate to both, keyboard and gamepad mode.

In the subfolders keyboard or gamepad you'll find the files for the keyboard or gamepad mode then. So if you want to habe soemthing similar to the keyboard mode XML group UI you need to check the folder:
https://github.com/esoui/esoui/tree/...group/keyboard

In there you'll have lua files and XML files. The XML often is the UI or predefined "virtual" templates of controls or list rows, dialogs etc.
The lua code contains the code that connects the logic with the XML UI output then.
Sometimes XML is missing and lua will create the controls! So it's not always XML and lua! It could be only lua or only XML (containign some smaller lua portions in the xml code like <OnMouseDown> lua code here </OnMouseDown> events).


ZO_GroupList_Keyboard contains the group list as you press P ingame, afaik:
https://github.com/esoui/esoui/blob/...t_keyboard.lua


So if you do not search the group list but the group UI on the left, it's another folder:
Unitframes

https://github.com/esoui/esoui/tree/...ame/unitframes

The XML contans e.g. 2 examples (virtual templates) for a row in that group unit frame, one for keyboard and one for Gamepad mode:
Code:
<StatusBar name="ZO_GroupUnitFrameStatus_Keyboard_Template" inherits="ZO_ArrowStatusBarWithBG" virtual="true">
            <Controls>
                <Control name="$(parent)BG" hidden="false" />
                <Control name="$(parent)Overlay" hidden="false" />
            </Controls>
        </StatusBar>

        <StatusBar name="ZO_GroupUnitFrameStatus_Gamepad_Template" inherits="ZO_DefaultStatusBar" virtual="true">
            <Controls>
                <Control name="$(parent)BG" hidden="true" />
                <Control name="$(parent)Overlay" hidden="true" />
            </Controls>
        </StatusBar>
And the lua file contains info how these virtual rows are used to create 1 row for each group member, also showing you how the actual group members are read and looped.

local function CreateGroupsAfter(startIndex)
https://github.com/esoui/esoui/blob/...ames.lua#L2134

Lua Code:
  1. local groupSize = GetGroupSize()
  2.     local combinedGroupSize = UnitFrames:GetCombinedGroupSize()
  3.  
  4.     for i = startIndex, GROUP_SIZE_MAX do
  5.         local unitTag = GetGroupUnitTagByIndex(i) --returns a string unitTag which will be "group<groupIndexHere>" e.g. group1, group2 and so on. Info: The unitTag "Player" -> That's your current character  (not returned by this function here!!!)
  6.  
  7.         if unitTag then
  8.             CreateGroupMember(i, unitTag, combinedGroupSize)
  9.         end
  10.     end
  11.  
  12. ...
  13. --and so on

So the function CreateGroupMember
https://github.com/esoui/esoui/blob/...ames.lua#L2107
will create a new row at the XML UI, usng the template defined above ZO_GroupUnitFrameStatus_Keyboard_Template then I'd assume, via function
UnitFrames:CreateFrame

where UnitFrames is the object created for the class ZO_UnitFrames_Manager
https://github.com/esoui/esoui/blob/...ames.lua#L2681

So it will call ZO_UnitFrames_Manager:CreateFrame
https://github.com/esoui/esoui/blob/...rames.lua#L309

It will then call the next class unitFrame = ZO_UnitFrameObject:New ->
https://github.com/esoui/esoui/blob/...rames.lua#L313
Which will internally call the ZO_UnitFrameObject:Initialize function
https://github.com/esoui/esoui/blob/...ames.lua#L1138

This reads the platform uses (pc, console, etc.) and the input type keyboard or gamepad, reads the template from XML to use, and then uses functions like self:AddFadeComponent or ZO_UnitFrameBar:New to create new fading controls or bar controls (self.healthBar -> health e.g.) to show at the UI.

I guess that's not that easy to understand but I cannot explain it better. If you start with ESO addon creation you maybe should first do some more easy tasks -> Or try and error until it works


Check the WIKI for tutorials with XML, and expalining controls and anchors etc. if you are new to this too:
https://wiki.esoui.com/Circonians_Stamina_Bar_Tutorial

https://wiki.esoui.com/Control:SetAnchor
https://wiki.esoui.com/UI_XML
https://wiki.esoui.com/How_to..._do_UI_element_X
  Reply With Quote
12/15/22, 07:23 AM   #3
Masteroshi430
 
Masteroshi430's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2020
Posts: 185
Originally Posted by gandalf.legris View Post
I'm trying to understand how to retrieve the list of players from a group and display it in the xml view. If anyone can give me some hints that would be great!
for i = 1, GetGroupSize() do
local tag = "group"..tostring(i)
local name = GetRawUnitName(tag)
end

Something like that for starters...

EDIT: Ah I chose to help you a bit, Beartram chose to help you a lot

Last edited by Masteroshi430 : 12/15/22 at 07:26 AM.
  Reply With Quote
12/15/22, 07:56 AM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,960
One hint to your code Masteroshi:

Could work but is a manual concatenation which should not be used if there are better ways provided by ZOs:
local tag = "group"..tostring(i)

You also would not (or at least should not) always just use 1, instead of the correct constant BAG_BAGPACK for the inventory's bagId.
-> The constants and API functions exist to make it compatible, also for future use cases. So better make use of them instead of re-inventing your own code that maybe works today, but breaks tomorrow.


Definately works (and is API and should be used here):
Code:
local unitTag = GetGroupUnitTagByIndex(i)
Attention:
A unitTag may be nil if there are gaps in the group indices! So GetGroupUnitTagByIndex(index) might return nil, add a nil check afterwards!
Code:
local unitTag = GetGroupUnitTagByIndex(i)
if unitTag ~= nil and DoesUnitExist(unitTag) then
 --Only here we know the unit at index i exists!
end

Last edited by Baertram : 07/03/23 at 07:39 AM.
  Reply With Quote
12/15/22, 08:05 AM   #5
Masteroshi430
 
Masteroshi430's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2020
Posts: 185
Originally Posted by Baertram View Post
One hint to your code Masteroshi:

Could work but is a manual concatenation which should not be used if there are better ways provided by ZOs:
local tag = "group"..tostring(i)

You also would not (or at least should not) always just use 1, instead of the correct constant BAG_BAGPACK for the inventory's bagId.
-> The constants and API functions exist to make it compatible, also for future use cases. So better make use of them instead of re-inventing your own code that maybe works today, but breaks tomorrow.


Definately works (and is API and should be used here):
Code:
local unitTag = GetGroupUnitTagByIndex(i)
Ah yep Will change this in my code too, thanks
  Reply With Quote
12/15/22, 09:21 PM   #6
gandalf.legris
Join Date: Dec 2022
Posts: 5
More information

Hello when I wrote you these few lines, I was just beginning to have the idea of making my first add on. So I got interested in XML and started drawing my idea. My idea is to display all members of a trial(vHRC, vSS...) and add information to facilitate the management of the group management. That's why I asked you how to display the list of group members instead of Player2, Player3....

In a trial there are always 12 players.


I need to figure out how to fetch the list of players to figure out how to loop and handle the display in my XML. If you can help me that would be great


Code:
<GuiXml> 
   <Controls>
   <TopLevelControl name="WypeInProgessWindow" clampedToScreen="true" mouseEnabled="true" movable="true" hidden="false">	
      <Dimensions x="64" y="64" />
      <Anchor point="TOPLEFT" relativeTo="GuiRoot" relativePoint="CENTER" offsetX="0" offsetY="0"/>
      <Controls>
	  <!-- GROUPE 1 -->
	  <!-- TANK -->
         <Label name="$(parent)LabelNom1" font="ZoFontWinH5" color="ffffff" text="@Player1" verticalAlignment="CENTER" horizontalAlignment="LEFT"  alpha="0.85">			
            <Dimensions x="130" y="50" />
            <Anchor point="BOTTOMLEFT"  relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="10" offsetY="40"/>
         </Label>
		 <Backdrop name="$(parent)Backdrop1" edgeColor="000000" centerColor="2b950b" alpha="0.6" >
            <Dimensions x="130" y="30" />
            <Anchor point="TOPLEFT"  relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
		 <Backdrop name="$(parent)UltimeA1" edgeColor="FF0000" alpha="0.6" >
            <Dimensions x="30" y="30" />
            <Anchor point="TOPLEFT" offsetX="135" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="2" />
         </Backdrop>
		 <Backdrop name="$(parent)UltimeB1" edgeColor="FF0000" alpha="0.6" >
            <Dimensions x="30" y="30" />
            <Anchor point="TOPLEFT" offsetX="170" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="2" />
         </Backdrop>
		 <!-- nova /esoui/art/icons/ability_templar_nova.dds -->
		 <Texture name="$(parent)UltimeA1Picture1" textureFile="/esoui/art/icons/ability_ava_003_a.dds" tier="HIGH">
			<Dimensions x="26" y="26"/>
			<Anchor point="TOPLEFT" relativeTo="$(parent)" offsetX="137" offsetY="2" />
		</Texture>
		<Texture name="$(parent)UltimeB1Picture1" textureFile="/esoui/art/icons/ability_ava_006_b.dds" tier="HIGH">
			<Dimensions x="26" y="26"/>
			<Anchor point="TOPLEFT" relativeTo="$(parent)" offsetX="172" offsetY="2" />
		</Texture> 
		 <!-- TANK -->
		 <!-- Pour animer plus tard <StatusBar name="$(parent)StatusBar" color="8A2BE2" alpha="1">
            <Dimensions x="200" y="30" />
            <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="0" offsetY="0"/>
            <Limits min="0" max="100" />
         </StatusBar> -->
	  <!-- HEAL -->
		 <Label name="$(parent)LabelNom2" font="ZoFontWinH5" color="ffffff" text="@Player2" verticalAlignment="CENTER" horizontalAlignment="LEFT"  alpha="0.85">			
			<Dimensions x="130" y="50" />
			<Anchor point="BOTTOMLEFT"  relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="10" offsetY="80"/>
		 </Label>
*		 <Backdrop name="$(parent)Backdrop2" edgeColor="000000" centerColor="6495ED" alpha="0.6" >
            <Dimensions x="130" y="30" />
            <Anchor point="TOPLEFT" offsetY="40" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
		 <Backdrop name="$(parent)UltimeA2" edgeColor="FF0000" alpha="0.6" >
            <Dimensions x="30" y="30" />
            <Anchor point="TOPLEFT" offsetX="135" offsetY="40" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
		 <Backdrop name="$(parent)UltimeB2" edgeColor="FF0000" alpha="0.6" >
            <Dimensions x="30" y="30" />
            <Anchor point="TOPLEFT" offsetX="170" offsetY="40" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
         
	  <!-- DPS -->
		 <Label name="$(parent)LabelNom3" font="ZoFontWinH5" color="ffffff" text="@Player3" verticalAlignment="CENTER" horizontalAlignment="LEFT"  alpha="0.85">			
            <Dimensions x="130" y="50" />
            <Anchor point="BOTTOMLEFT"  relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="10" offsetY="120"/>
         </Label>
		 <Backdrop name="$(parent)Backdrop3" edgeColor="000000" centerColor="6495ED" alpha="0.6" >
            <Dimensions x="130" y="30" />
            <Anchor point="TOPLEFT" offsetY="80" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
		 <Backdrop name="$(parent)UltimeA3" edgeColor="FF0000" alpha="0.6" >
            <Dimensions x="30" y="30" />
            <Anchor point="TOPLEFT" offsetX="135" offsetY="80" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
		 <Backdrop name="$(parent)UltimeB3" edgeColor="FF0000" alpha="0.6" >
            <Dimensions x="30" y="30" />
            <Anchor point="TOPLEFT" offsetX="170" offsetY="80" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
        
		 <Label name="$(parent)LabelNom4" font="ZoFontWinH5" color="ffffff" text="@Player4" verticalAlignment="CENTER" horizontalAlignment="LEFT"  alpha="0.85">			
            <Dimensions x="130" y="50" />
            <Anchor point="BOTTOMLEFT"  relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="10" offsetY="160"/>
         </Label>
		 <Backdrop name="$(parent)Backdrop4" edgeColor="000000" centerColor="6495ED" alpha="0.6" >
            <Dimensions x="130" y="30" />
            <Anchor point="TOPLEFT" offsetY="120" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
		 <Backdrop name="$(parent)UltimeA4" edgeColor="FF0000" alpha="0.6" >
            <Dimensions x="30" y="30" />
            <Anchor point="TOPLEFT" offsetX="135" offsetY="120" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
		 <Backdrop name="$(parent)UltimeB4" edgeColor="FF0000" alpha="0.6" >
            <Dimensions x="30" y="30" />
            <Anchor point="TOPLEFT" offsetX="170" offsetY="120" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
         
		 <Label name="$(parent)LabelNom5" font="ZoFontWinH5" color="ffffff" text="@Player5" verticalAlignment="CENTER" horizontalAlignment="LEFT"  alpha="0.85">			
            <Dimensions x="130" y="50" />
            <Anchor point="BOTTOMLEFT"  relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="10" offsetY="200"/>
         </Label>
		 <Backdrop name="$(parent)Backdrop5" edgeColor="000000" centerColor="6495ED" alpha="0.6" >
            <Dimensions x="130" y="30" />
            <Anchor point="TOPLEFT" offsetY="160" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
		 <Backdrop name="$(parent)UltimeA5" edgeColor="FF0000" alpha="0.6" >
            <Dimensions x="30" y="30" />
            <Anchor point="TOPLEFT" offsetX="135" offsetY="160" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
		 <Backdrop name="$(parent)UltimeB5" edgeColor="FF0000" alpha="0.6" >
            <Dimensions x="30" y="30" />
            <Anchor point="TOPLEFT" offsetX="170" offsetY="160" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
         
		 <Label name="$(parent)LabelNom6" font="ZoFontWinH5" color="ffffff" text="@Player6" verticalAlignment="CENTER" horizontalAlignment="LEFT"  alpha="0.85">			
            <Dimensions x="130" y="50" />
            <Anchor point="BOTTOMLEFT"  relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="10" offsetY="240"/>
         </Label>
		 <Backdrop name="$(parent)Backdrop6" edgeColor="000000" centerColor="6495ED" alpha="0.6" >
            <Dimensions x="130" y="30" />
            <Anchor point="TOPLEFT" offsetY="200" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
		 <Backdrop name="$(parent)UltimeA6" edgeColor="FF0000" alpha="0.6" >
            <Dimensions x="30" y="30" />
            <Anchor point="TOPLEFT" offsetX="135" offsetY="200" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
		 <Backdrop name="$(parent)UltimeB6" edgeColor="FF0000" alpha="0.6" >
            <Dimensions x="30" y="30" />
            <Anchor point="TOPLEFT" offsetX="170" offsetY="200" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
         
	<!-- GROUPE 2 -->
	  <!-- TANK -->
		 <Label name="$(parent)LabelNom7" font="ZoFontWinH5" color="ffffff" text="@Player7" verticalAlignment="CENTER" horizontalAlignment="LEFT"  alpha="0.85">			
            <Dimensions x="130" y="50" />
            <Anchor point="BOTTOMLEFT"  relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="230" offsetY="40"/>
         </Label>
         <Backdrop name="$(parent)Backdrop7" edgeColor="000000" centerColor="6495ED" alpha="0.6" >
            <Dimensions x="130" y="30" />
            <Anchor point="TOPLEFT" offsetX="210" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
		 
	  <!-- HEAL -->
		 <Label name="$(parent)LabelNom8" font="ZoFontWinH5" color="ffffff" text="@Player8" verticalAlignment="CENTER" horizontalAlignment="LEFT"  alpha="0.85">			
            <Dimensions x="130" y="50" />
            <Anchor point="BOTTOMLEFT"  relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="230" offsetY="80"/>
         </Label>
*		 <Backdrop name="$(parent)Backdrop8" edgeColor="000000" centerColor="6495ED" alpha="0.6" >
            <Dimensions x="130" y="30" />
            <Anchor point="TOPLEFT" offsetY="40" offsetX="210" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
         
	  <!-- DPS -->
		 <Label name="$(parent)LabelNom9" font="ZoFontWinH5" color="ffffff" text="@Player9" verticalAlignment="CENTER" horizontalAlignment="LEFT"  alpha="0.85">			
            <Dimensions x="130" y="50" />
            <Anchor point="BOTTOMLEFT"  relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="230" offsetY="120"/>
         </Label>
		 <Backdrop name="$(parent)Backdrop9" edgeColor="000000" centerColor="6495ED" alpha="0.6" >
            <Dimensions x="130" y="30" />
            <Anchor point="TOPLEFT" offsetY="80" offsetX="210" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
         
         <Label name="$(parent)LabelNom10" font="ZoFontWinH5" color="ffffff" text="@Player10" verticalAlignment="CENTER" horizontalAlignment="LEFT"  alpha="0.85">			
            <Dimensions x="130" y="50" />
            <Anchor point="BOTTOMLEFT"  relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="230" offsetY="160"/>
         </Label>
		 <Backdrop name="$(parent)Backdrop10" edgeColor="000000" centerColor="6495ED" alpha="0.6" >
            <Dimensions x="130" y="30" />
            <Anchor point="TOPLEFT" offsetY="120" offsetX="210" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
		 
         <Label name="$(parent)LabelNom11" font="ZoFontWinH5" color="ffffff" text="@Player11" verticalAlignment="CENTER" horizontalAlignment="LEFT"  alpha="0.85">			
            <Dimensions x="130" y="50" />
            <Anchor point="BOTTOMLEFT"  relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="230" offsetY="200"/>
         </Label>
		 <Backdrop name="$(parent)Backdrop11" edgeColor="000000" centerColor="6495ED" alpha="0.6" >
            <Dimensions x="130" y="30" />
            <Anchor point="TOPLEFT" offsetY="160" offsetX="210" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>
		 
         <Label name="$(parent)LabelNom12" font="ZoFontWinH5" color="ffffff" text="@Player12" verticalAlignment="CENTER" horizontalAlignment="LEFT"  alpha="0.85">			
            <Dimensions x="130" y="50" />
            <Anchor point="BOTTOMLEFT"  relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="230" offsetY="240"/>
         </Label>
		 <Backdrop name="$(parent)Backdrop12" edgeColor="000000" centerColor="6495ED" alpha="0.6" >
            <Dimensions x="130" y="30" />
            <Anchor point="TOPLEFT" offsetY="200" offsetX="210" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
            <Edge edgeSize="3" />
         </Backdrop>

         <Label name="$(parent)Label1" font="ZoFontWinH4" color="ffffff" text="Groupe 1 : " verticalAlignment="CENTER" horizontalAlignment="LEFT"  alpha="0.85">			
            <Dimensions x="130" y="50" />
            <Anchor point="BOTTOMLEFT"  relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="5" offsetY="10"/>
         </Label>
		 <Label name="$(parent)LabelUltA1" font="ZoFontWinH4" color="ffffff" text="Ult1" verticalAlignment="CENTER" horizontalAlignment="LEFT"  alpha="0.85">			
            <Dimensions x="30" y="50" />
            <Anchor point="BOTTOMLEFT"  relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="135" offsetY="10"/>
         </Label>
         <Label name="$(parent)LabelUltB1" font="ZoFontWinH4" color="ffffff" text="Ult2" verticalAlignment="CENTER" horizontalAlignment="LEFT"  alpha="0.85">			
            <Dimensions x="30" y="50" />
            <Anchor point="BOTTOMLEFT"  relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="170" offsetY="10"/>
         </Label>
		 
         <Label name="$(parent)Label2" font="ZoFontWinH4" color="ffffff" text="Groupe 2 : " verticalAlignment="CENTER" horizontalAlignment="LEFT"  alpha="0.85">			
            <Dimensions x="130" y="50" />
            <Anchor point="BOTTOMLEFT"  relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="215" offsetY="10"/>
         </Label>
         <Label name="$(parent)LabelUltA2" font="ZoFontWinH4" color="ffffff" text="Ult1" verticalAlignment="CENTER" horizontalAlignment="LEFT"  alpha="0.85">			
            <Dimensions x="30" y="50" />
            <Anchor point="BOTTOMLEFT"  relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="335" offsetY="10"/>
         </Label>
         <Label name="$(parent)LabelUltB2" font="ZoFontWinH4" color="ffffff" text="Ult2" verticalAlignment="CENTER" horizontalAlignment="LEFT"  alpha="0.85">			
            <Dimensions x="30" y="50" />
            <Anchor point="BOTTOMLEFT"  relativeTo="$(parent)StatusBar" relativePoint="TOPLEFT" offsetX="370" offsetY="10"/>
         </Label>
		  
      </Controls>
   </TopLevelControl>
   </Controls>
</GuiXml>
  Reply With Quote
12/16/22, 01:48 AM   #7
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,960
I hope that does not sound rude now but:
I recommand reading the long post I had answered you above. If this is not enough help I do not know what to do else, as we are not going to create your addon for you

As I had written above: Group management is nothing you should start with if you want to create your first addon! You should first create something easy with your own UI and understand how that works and how data from lua will be send to the XML created controls.

The eso code shows you that they just use 1 XML template where they can add several new controls (1 per character in the group) dynamically.
And you should do the similar there, or you will get intro trouble if you "hardcode up to 12 or 24 group frames manually".
So your goal should be to understand how the vanilla ESO code works and does that, so you are able to create smething similar for your addon.

This is just my understanding, off course you can go ahead and create 12-24 harcoded XML structures for each player and update them each time redundantly, if you like to.
  Reply With Quote
12/16/22, 10:20 AM   #8
gandalf.legris
Join Date: Dec 2022
Posts: 5
more information

local unitTag = GetGroupUnitTagByIndex(i)
return Group1, Group2

How i find the @ of the player ?
  Reply With Quote
12/16/22, 12:05 PM   #9
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,960
You can just get the "Character name" of that group members via the code that Masteroshi showed you above:
Code:
local characterName = GetRawUnitName(unitTag)
As character names could contain gender specific text parts, shown as ^m (masculin) or ^f (feminin) e.g., you should always use the function zo_strformat to change them to readable correct names, using GetUnitName(unitTag)

Lua Code:
  1. local characterName = zo_strformat(SI_UNIT_NAME, GetUnitName(unitTag))

I doubt there is a way to get the @displayName of other group members. If there is a way it should be in the group unit frame source code that I had linked above.
Here the name label control is created:
https://github.com/esoui/esoui/blob/...ames.lua#L1163

And here the name label of the unit frame is updated:
https://github.com/esoui/esoui/blob/...ames.lua#L1706

And here you see what I wrote above:
https://github.com/esoui/esoui/blob/...ames.lua#L1727

You cannot get the @displayName, only the character name of other group members.
Only yoruself unitTag == "player") can provide the @displayName:
Lua Code:
  1. elseif IsUnitPlayer(tag) then
  2.             name = ZO_GetPrimaryPlayerNameFromUnitTag(tag)
  3.         else
  4.             name = GetUnitName(tag)
  5.         end

Last edited by Baertram : 12/16/22 at 12:11 PM.
  Reply With Quote
12/16/22, 12:43 PM   #10
gandalf.legris
Join Date: Dec 2022
Posts: 5
Find the displayName

local dysplayName = GetDisplayName(unitTag)

Ok i have find thanks for your help

Update : just for me not for other in the group !

Can we save variables in SavedVariables in json format(type) ?

Last edited by gandalf.legris : 12/16/22 at 01:42 PM.
  Reply With Quote
12/16/22, 03:46 PM   #11
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,960
Originally Posted by gandalf.legris View Post
local dysplayName = GetDisplayName(unitTag)

Ok i have find thanks for your help

Update : just for me not for other in the group !
Yeah, like explained in detail above


Originally Posted by gandalf.legris
Can we save variables in SavedVariables in json format(type) ?
https://www.esoui.com/forums/showthread.php?p=46880
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » retrieve the list of players from a group and display it in the xml

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