View Single Post
02/24/16, 07:00 AM   #38
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,579
Originally Posted by Wandamey View Post
if you are having troubles using this variable, there is a wiki page explaining how to thanks to Sirinsidiator : http://wiki.esoui.com/Addon_manifest_%28.txt%29_format
What merlight is referring to is my failure to properly use it in sidWarTools.
It worked as expected for the transition on one update, but I didn't update sidWarTools for a long time and then the next update came along and suddenly there was an error that wasn't there before, because one file was missing.
So the proper way to use it, is to provide the files for the next api version without the use of $(APIVersion) and the old files with it like this:
Code:
myAddon.lua
myAddon_$(APIVersion).lua
And inside the file you wrap the code into a function MyAddon.Initialize that gets executed from a third file (e.g. startup).
When launched with the old update, the myAddon_100013.lua is loaded and overwrites the function for the new version and once the new api version is available, myAddon_100014.lua is not found and the version from myAddon.lua is executed instead. It won't suddenly stop working because of a missing file in the future api versions either. Hope this makes it clear.