View Single Post
03-20-13, 07:56 AM   #10
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
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.
  Reply With Quote