Thread Tools Display Modes
Prev Previous Post   Next Post Next
04/25/14, 12:17 PM   #21
Fathis Ules
Thief Guild Master
 
Fathis Ules's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 42
ha yeah you use XML so you will need globals and a naming like MyAddonRollDice

or one good practice is to have a unique global aray named after your addon like MyAddon = {}

Lua Code:
  1. MyAddon = {}
  2.  
  3. function MyAddon.RollDice()
  4.     d("hello")
  5. end
  6.  
  7. function MyAddon.d()
  8.  
  9. end
  10.  
  11. function MyAddon.whatever()
  12.  
  13. end

So then you can call in your XML the MyAddon.RollDice()

You will be able directly call locals when you will experiment doing an UI without a single xml file, with API CreateControl, but easier to start with XML, at least you see the concept of local vs globals
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » Anyone Know the Lua for Random Numbers in ESO????


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