A feature request that has been made is to add/expose the current Addons plugin version number to addons. This allows addons to test/check for expected functionality and warn users they may need to upgrade their version of Ashita (and/or Addons plugin) in order to use a given addon.
To avoid pollution of the global namespace, an idea on how this could be added is to include it within the existing ashita table. Such as the following:
print(ashita.addons_version);
In this case, addons_version is a Lua number value, matching its double value returned from calling its GetVersion method.
Some positives about implementing things this way:
It does not pollute the global namespace with a new variable.
It does not break any existing addons.
It allows future addons to easily check if the value even exists.
Feature Description
A feature request that has been made is to add/expose the current Addons plugin version number to addons. This allows addons to test/check for expected functionality and warn users they may need to upgrade their version of Ashita (and/or Addons plugin) in order to use a given addon.
To avoid pollution of the global namespace, an idea on how this could be added is to include it within the existing
ashita
table. Such as the following:In this case,
addons_version
is a Luanumber
value, matching itsdouble
value returned from calling itsGetVersion
method.Some positives about implementing things this way: