ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Manifest Version Number (https://www.esoui.com/forums/showthread.php?t=5107)

circonian 09/01/15 06:25 PM

Manifest Version Number
 
This is a long shot, but is there any way to get the manifest version number
Lua Code:
  1. ## Version: 0.9
from lua code? I never remember to change it in both places when I do updates :D

Halja 09/01/15 07:32 PM

Chip added it for us awhile back. ;)
GetAPIVersion()

votan 09/01/15 11:38 PM

Quote:

Originally Posted by Halja (Post 23148)
Chip added it for us awhile back. ;)
GetAPIVersion()

circonian means addon version, not API version. ;)

And yes, would be nice to have all meta data from manifest available in Lua. :)

merlight 09/02/15 04:13 AM

That's why I don't put version in the manifest :D I'm afraid it's not only inaccessible, but silently ignored because it's not one of the known keywords.

AddOnManager could keep a table of all "^## (%w+): ?(.*)" key-value pairs, and provide a function that would return the corresponding value for any given key.

circonian 09/02/15 04:18 PM

Quote:

Originally Posted by merlight (Post 23156)
That's why I don't put version in the manifest :D I'm afraid it's not only inaccessible, but silently ignored because it's not one of the known keywords.

AddOnManager could keep a table of all "^## (%w+): ?(.*)" key-value pairs, and provide a function that would return the corresponding value for any given key.

Did I misunderstand? Don't you have to put the version in the manifest? That's how the game knows if your addon is out of date?

merlight 09/02/15 04:32 PM

Quote:

Originally Posted by circonian (Post 23191)
Did I misunderstand? Don't you have to put the version in the manifest? That's how the game knows if your addon is out of date?

That's APIVersion. Version is ignored.

circonian 09/02/15 04:36 PM

Quote:

Originally Posted by merlight (Post 23195)
That's APIVersion. Version is ignored.

Oh, woops, yeah what was I thinking :o

CaptainBlagbird 11/24/15 02:38 AM

Quote:

Originally Posted by merlight (Post 23156)
AddOnManager could keep a table of all "^## (%w+): ?(.*)" key-value pairs, and provide a function that would return the corresponding value for any given key.

That would be awesome :D

bump bump

Ayantir 11/24/15 07:35 AM

yes or ..


Lua Code:
  1. number numAddons = GetAddonsInstalled()
  2. string addonName = GetAddonName(number index)
  3. boolean isLoaded, string:nilable addonVersion, string:nilable addonAPI, string:nilable addonDescription, string:nilable addonAuthor = GetAddonInfo(addonName)

so we could do

Lua Code:
  1. for i, GetAddonsInstalled() do
  2.       local addonName = GetAddonName(i)
  3.       if GetAddonInfo(addonName) then
  4.             -- Addon addonName is loaded !
  5.       end
  6. end

or

Lua Code:
  1. if GetAddonInfo("anObviousAddonWhichDontLeakAnyGlobal") then

There is also SavedVars and Depends and and Optional depends on, but it could be a really good start

haggen 11/24/15 07:52 AM

Ayantir nailed it, thank you!


All times are GMT -6. The time now is 11:58 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI