Thread Tools Display Modes
08/05/16, 04:38 AM   #1
Lum1on
AddOn Author - Click to view addons
Join Date: Aug 2016
Posts: 18
XML and for loop

Hello,

I've familiar with some basic coding when it comes to QML and others simple languages. I know the basics (and some more) about for loops, and I've just now started to get my hands into XML and addon developing in ESO.

Before I want to go any deeper with this, I'm just trying to get some basic stuffs to work first. I've done own custom resource bars with values as well as target's health bar (haven't managed to get it working only when pointing at a target, but that's not an issue at this point).

So now I was wondering about buffs. Not a hard task to get the buffs listed in chat window using d(), but what I would like to learn is how to use for loop together with XML. So basically to list buffs simply from top to bottom.

No need for actual code, just a little help needed how to achieve it.

Thanks!
  Reply With Quote
08/05/16, 04:42 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,960
XML is used for the gui elements. lua is used for the source code.

If I understand you correctly you'd like to use an XML file to do the for loop?
Or do you want to use a lua file with the for loop and output some fancy xml gui elements showing the buffs in it?
  Reply With Quote
08/05/16, 06:01 AM   #3
Lum1on
AddOn Author - Click to view addons
Join Date: Aug 2016
Posts: 18
Yes, I do know what XML and LUA does. Sorry for not being precise with this issue.

So, like I said i can track my on-going buffs with d(). I can also get the buff name and icon from EVENT_LOOT_RECEIVED and GetItemLink().

The questions is, how I'm able to multiply one single XML control with 'for' loop using LUA? So I could get a sort of a drop-down list to show the buffs.
  Reply With Quote
08/05/16, 07:50 AM   #4
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by Lum1on View Post
Yes, I do know what XML and LUA does. Sorry for not being precise with this issue.

So, like I said i can track my on-going buffs with d(). I can also get the buff name and icon from EVENT_LOOT_RECEIVED and GetItemLink().

The questions is, how I'm able to multiply one single XML control with 'for' loop using LUA? So I could get a sort of a drop-down list to show the buffs.
I think you are talking about ScrollList and/or control-pooling with "virtual" XML control templates.
A single XML control is marked as virtual (=template) and when multiple instances can be created on demand.

Not the easiest topic to start with.

A ScrollList control uses this control pooling to create as much controls as visible rows only.

Or directly multipling a single virtual XML control:
CreateControlFromVirtual(name, parent, templateName, optionalNameSuffix)
CreateControlRangeFromVirtual(name, parent, templateName, rangeMinSuffix, rangeMaxSuffix)
  Reply With Quote
08/05/16, 08:15 AM   #5
Lum1on
AddOn Author - Click to view addons
Join Date: Aug 2016
Posts: 18
Thanks for the answer. So it seems I approached this from a wrong point of view.

Like I said in my first post, I've dealt with QML that uses ScrollView, so I'm used this kind of a control before. But just the lack of a documentation about all the XML and LUA things ESO can handle, is huge - in my opinion. For example, here I can't see anything about ScrollList.

Could you give me an example how to use one? All, better yet, a link to a place where I can learn by myself (used to learn by reading alone, but an example is helpful aswell).
  Reply With Quote
08/05/16, 09:34 AM   #6
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by Lum1on View Post
Thanks for the answer. So it seems I approached this from a wrong point of view.

Like I said in my first post, I've dealt with QML that uses ScrollView, so I'm used this kind of a control before. But just the lack of a documentation about all the XML and LUA things ESO can handle, is huge - in my opinion. For example, here I can't see anything about ScrollList.

Could you give me an example how to use one? All, better yet, a link to a place where I can learn by myself (used to learn by reading alone, but an example is helpful aswell).
The documentation and tutorials on the wiki here are done by people in their spare time. Nobody should expect them as "complete".

You can look at Votan's Achievements Overview. This addon is purely adding a scroll-list. But not using all features.

To my personal opinion the best and most accurate documentation is written in native language, which is Lua in this case. Any translation to another language loses information or has the same effort to be written again (if not more).

The most complete "documentation" can be found here.
  Reply With Quote
08/05/16, 11:15 AM   #7
Lum1on
AddOn Author - Click to view addons
Join Date: Aug 2016
Posts: 18
Yes, I know it's made completely by addon developers on their own - and I respect their work of course. Just said that it's not listed in there so couldn't find any information about its' functions.

But, much appreciated about those links you gave me. Thank you!
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » XML and for loop

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