[implemented] Programmatical way to get the API version
There are cases where I would like to get the API version to make checks with in my code. In specific I need a way to detect if the API version changed and manaully reset the stored data to defaults then.
My Addon UTC can store the Categoreis that are enabeled for each tab in each chat container. I asume the current code will be good for a few more years, as there is no even remotely botusable function in the chat part I touch and I use Loops based on #Table and GetNum Functions. However every time the API version changes the order of chat categories might change. So at least in the first start after a version change I have to reset the settings & data. Doing this via the existing Saved Var Versioning system is not viable (or nessesary for that matter). All I need is a function "getAPIVersion()" that returns a int or string with the version (either works for me. Only doing an inequality check). Asuming it was not added with the 1.2.3 patch. |
As far as i know it's not there, however...
you can use the trick to check for new Functions or Globals (introduced in a certain version) for example: Lua Code:
|
I don't think so. Where I look is in the file AddOnSettings.txt. It's in the same folder as UserSettings and the parent of the Addons folder for the game. The first line declares the API version. It could be in a cVar the new EULA for Addons are. (ViewedAddOnEULAVersion and AcceptedAddOnEULAVersion) Those are exposed in the UserSettings file.
--halja |
Quote:
Better then just deletion everytime _VERSION (the build version of the client) changed. |
not a perfect way but this should work:
Lua Code:
|
Quote:
Since that is propably better to be left to a library to gather all this data once, I made it a Feature Request for OrangUtils. But I am going to test it a bit via a button. If he thinks it is out of scope, I just make it library myself. |
All times are GMT -6. The time now is 04:10 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI