Originally Posted by Nibelheim
As an example:
Top of first .Lua file
Lua Code:
local addon, ns = ... local Funs, Settings = unpack(select(2, ...)) Settings.defaults = { x = 0, y = 0, } Funs.updateSettings = function() -- do stuff end
Second file
Lua Code:
local Funs, Settings = unpack(select(2, ...)) local Init = function() Funs.updateSettings() print(Settings.x, Settings.y) 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?