Enabling/Disabling Plug-Ins
These routines are used to work with plug-ins and manage them. Most plugins will not need to use these APIs.
XPLMIsPluginEnabled
function
Returns whether the specified plug-in is enabled for running.
-- returns boolean -> assign to local/var
local my_result = XPLMIsPluginEnabled(
inPluginID -- XPLMPluginID
)
XPLMEnablePlugin
function
This routine enables a plug-in if it is not already enabled. It returns true if the plugin was enabled or successfully enables itself, false if it does not. Plugins may fail to enable (for example, if resources cannot be acquired) by returning false from their XPluginEnable callback.
-- returns boolean -> assign to local/var
local my_result = XPLMEnablePlugin(
inPluginID -- XPLMPluginID
)
XPLMDisablePlugin
function
This routine disables an enabled plug-in.
XPLMDisablePlugin(
inPluginID -- XPLMPluginID
)
XPLMReloadPlugins
function
This routine reloads all plug-ins. Once this routine is called and you return from the callback you were within (e.g. a menu select callback) you will receive your XPluginDisable and XPluginStop callbacks and your DLL will be unloaded, then the start process happens as if the sim was starting up.
XPLMReloadPlugins(
)
XPLMReloadThisPlugin
function XPLM440
This routine reloads the plug-ins which calls it. If you pass true for 'forReplacement', a dialog will be shown after the .xpl has been unloaded to allow you to replace it with a newer one manually. In other respects it works identically to XPLMReloadPlugins().
XPLMReloadThisPlugin(
forReplacement -- boolean
)