Go to Page... |
Compatibility: | Elsweyr (5.0.5) Wrathstone (4.3) |
Updated: | 05/12/19 05:36 PM |
Created: | 05/12/19 05:36 PM |
Monthly downloads: | 1,793 |
Total downloads: | 105,407 |
Favorites: | 5 |
MD5: |
function LibManifest:Create( addOnName: string ) return Create( addOnName ) or nil, 0 end
manifest = { -- These values are retrieved from existing manifest directives author, -- From the Author: directive Without any special characters description, -- From the Description: directive fileName, -- The name of this add-on's folder and manifest file isEnabled, -- ESO boolean value isOutOfDate, -- ESO boolean value loadState, -- ESO load state (i.e. loaded; not loaded) title, -- From the Title: directive without any special characters -- These values are retrieved from 100026 manifest directives addOnVersion, -- From the AddOnVersion: directive filePath, -- Path to this add-on's folder/directory -- These values are retrieved from 100027 manifest directives isLibrary, -- From the IsLibrary: directive }
--[[------------------------------------------------------------------------------------------------------------------- Local variables shared by multiple functions within this add-on. ---------------------------------------------------------------------------------------------------------------------]] local ADDON_NAME = "LibManifest" local addon = {} --[[------------------------------------------------------------------------------------------------------------------- Bootstrap code to either load or fail this add-on. ---------------------------------------------------------------------------------------------------------------------]] assert( not _G[ADDON_NAME], ADDON_NAME.. ": is already loaded. Do NOT load add-ons multiple times!" ) _G[ADDON_NAME] = addon assert( _G[ADDON_NAME], ADDON_NAME.. ". The game failed to create a global control entry!" ) --[[------------------------------------------------------------------------------------------------------------------- ... And add-on initialization continues on from here... ---------------------------------------------------------------------------------------------------------------------]]
--[[------------------------------------------------------------------------------------------------------------------- And the last thing we do in this add-on is to wait for ESO to notify us that our modules and support add-ons (i.e. libraries) have been loaded so we can retrieve our own manifest table to verify that this add-on is functioning correctly. ---------------------------------------------------------------------------------------------------------------------]] local function OnAddonLoaded( event, name ) if name ~= ADDON_NAME then return end EVENT_MANAGER:UnregisterForEvent( ADDON_NAME, EVENT_ADD_ON_LOADED ) local test, index = Create( ADDON_NAME ) assert( test ~= nil, ADDON_NAME.. ": Failed! The table return value was nil" ) assert( index > 0, ADDON_NAME.. ": Failed! The index return value was zero" ) addon.manifest = test _G[ADDON_NAME] = addon end EVENT_MANAGER:RegisterForEvent( ADDON_NAME, EVENT_ADD_ON_LOADED, OnAddonLoaded )
There have been no comments posted to this file.
Be the first to add one. |