Interface to interact with the Stingray plugin system.
The PluginManager is a singleton and can be used without creating an instance of the class.
Other related reference items
Related help topics
add_hot_reload_directory ( dir )Adds a directory that will be monitored for hot reload of plugin DLLs.
|
dir : | string | A directory to monitor for new DLLs. |
This function does not return any values. |
If a new plugin is found in the directory dir that matches the name of an already loaded plugin and that plugin supports the hot reload interface, the plugin will be reloaded.
Since the engine locks the DLLs it is using and the debugger can lock an arbitrary number of old .pdb files, you are recommended to add the following steps to your plugin's pre-build step:
rename ${plugin}.dll ${plugin}.dll.old rename ${plugin}.pdb ${plugin}.${timestamp}.pdb.old del *.old
Renaming ensures that the engine can still continue to use the old DLL while the new one is being created. We need to add a timestamp when renaming the PDB, since the debugger will lock any PDB it has encountered. The final del command must be set up to tolerate failure -- it will fail on the DLLs and PDBs that are still in use, leaving them in place.
loaded_plugins ( ) : string[]Returns a list of the names of all loaded plugins.
|
This function does not accept any parameters. |
string[] |
A list of the name of all loaded plugins. The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown. |
load_plugin ( path ) : string?Dynamically loads a plugin from the specified path and returns its name.
|
path : | string | The path to the plugin. |
string? |
If successful, returns the name of the loaded plugin, otherwise nil. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
If no such file exists or if it can't be loaded, the function will return nil.
load_relative_plugin ( relative_path ) : string?Dynamically loads a plugin from the specified relative path and returns its name.
|
relative_path : | string | The relative path to the plugin from the application's plugin directory. |
string? |
If successful, returns the name of the loaded plugin, otherwise nil. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
If no such file exists or if it can't be loaded, the function will return nil.
remove_hot_reload_directory ( dir )Removes a hot reload directory added by add_hot_reload_directory().
|
dir : | string | A directory that will no longer be monitored for new DLLs. |
This function does not return any values. |
unload_plugin ( name )Unloads the plugin with the specified name.
|
name : | string | The name of the plugin. |
This function does not return any values. |