View Single Post
03-20-13, 08:04 AM   #11
fRodzet
A Flamescale Wyrmkin
Join Date: Mar 2013
Posts: 114
Originally Posted by Nibelheim View Post
As an example:

Top of first .Lua file
Lua Code:
  1. local addon, ns = ...
  2. local Funs, Settings = unpack(select(2, ...))
  3.  
  4. Settings.defaults = {
  5.    x = 0,
  6.    y = 0,
  7. }
  8.  
  9. Funs.updateSettings = function()
  10.     -- do stuff
  11. end

Second file
Lua Code:
  1. local Funs, Settings = unpack(select(2, ...))
  2.  
  3. local Init = function()
  4.     Funs.updateSettings()
  5.     print(Settings.x, Settings.y)
  6. end

You can now access thingies from any file within your addon, as each file in your addon shares a hidden passed argument.
Ty!


Some links on where to start learning, which editors is good to use, maybe some books and other stuff would be very much appreciated! I am really in to learning this stuff, i find it very exciting!

Isn't there a very good guide out there guiding you trough every single step of creating a WoWAddOn? Like first learn you the basics of lua, then explains the control structures, etc?
  Reply With Quote