Character name in XML
Hello,
So I'm doing more AddOn tests, and I'm finally working on something. I need to put the character name of the character the player's account is logged in, in a text in an anchor in the XML. So let's say, I have a black anchor, and I want to put the character name of the character I'm playing at the moment in that black anchor. I think I have to get the name from the Guild Roster and do this in the lua, but I'm not too sure how to do this. I think it is with "GetGuildMemberCharacterInfo(integer guildId, integer memberIndex)" Any ideas of how can I do this? Thanks ^^ |
If you got in XML :
Lua Code:
In LUA, it will be : Lua Code:
There is other ways to do this, but this one is almost quite easy. |
Oh, hm. So I got this, as you say:
Code:
<GuiXml> Code:
user:/AddOns/Test1/Test1.lua:1: attempt to index a nil value Thanks for the reply : ) |
Because doing like this need that you write the lua code in your function which will be executed when addon will be loaded. (with event_add_on_loaded).
If you write Lua Code:
Another way of doing this is : Lua Code:
Lua Code:
You can also use $(parent), like this : Lua Code:
Lua Code:
|
Ahh, I get it, alright, many thanks : )
|
If you need some example code for getting started, you may look at Hello World
|
All times are GMT -6. The time now is 06:21 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI