Namespace: PluginManager

PluginManager

The static class that manages plugins in the game

Methods

PluginManager.callCommand(self, pluginName, commandName, args)static

Calls a plugin command
NameTypeDescription
selfcontextThe context passed to the function
pluginNamestringThe name of the plugin
commandNamestringThe name of the plugin command
argsObjectThe various arguments passed to the callback function

PluginManager.checkErrors()static

Checks if any errors were encountered while loading plugins

PluginManager.loadScript(filename)static

Appends the plugin script file to the html game page
NameTypeDescription
filenamestringThe plugin filename

PluginManager.makeUrl(filename)stringstatic

Returns the full url of the plugin file including folder + filename + extension
NameTypeDescription
filenameErrorThe filename of the plugin with no extension
Returns:
TypeDescription
stringThe full url of the plugin file including folder + filename + extension

PluginManager.onError(e)static

Adds an error to the error stack if there was a problem loading a plugin
NameTypeDescription
eErrorThe returned error

PluginManager.parameters(name)static

Gets the parameters of a given plugin
NameTypeDescription
namestringThe name of the plugin

PluginManager.registerCommand(pluginName, commandName, func)static

Register a plugin command by plugin name, command name, and callback function
NameTypeDescription
pluginNamestringThe name of the plugin
commandNamestringThe name of the plugin command
funcfunctionThe callback function to call when plugin command is called

PluginManager.setParameters(name, parameters)static

Sets the parameters of a given plugin
NameTypeDescription
namestringThe name of the plugin
parametersObjectThe parameters of the plugin

PluginManager.setup(plugins)static

Sets up all plugins
NameTypeDescription
pluginsArrayarray of plugin objects including name, status, and parameters

PluginManager.throwLoadError()static

Throws an error if a plugin failed to load
Throws:
Failed to load error