and I would like to know what it should be and should not do or put in files
|
Hi,
I'm not sure if I understand you. Do you want to know what a "best practice" for writing an addon should be?
If you should split your addon into several lua files, one for controls, the other for functions, etc.?
In my opinion it depends on the size of your project/addon. I'd start with a single file and local variables like
Lua Code:
local myAddon = {}
myAddon.name = "My Addon's name"
myAddon.version = 0.1
function myAddon.myfunc(param1, param2)
...
end
in there, and then advance it to using multiple files and global variables that can be used in several files
Lua Code:
--File controls.lua
myGlobalAddon = {}
myGlobalAddon.name = "My Addon's name"
myGlobalAddon.version = 0.1
myGlobalAddon.baseControl = WINDOW_MANAGER:CreateControl(......)
--File functions.lua
if myGlobalAddon == nil then myGlobalAddon = {} end
function myGlobalAddon.funcName(param1, param2)
...
end
Check these links for eso addon development:
http://wiki.esoui.com/Main_Page -> At the right side below "How-To Guides"
http://wiki.esoui.com/Getting_Started
http://wiki.esoui.com/Writing_your_first_addon