diff --git a/library/include/PluginManager.h b/library/include/PluginManager.h index ec00e4ab0..f168d7e47 100644 --- a/library/include/PluginManager.h +++ b/library/include/PluginManager.h @@ -316,6 +316,7 @@ namespace DFHack #ifdef DEV_PLUGIN #define DFHACK_PLUGIN(m_plugin_name) DFHACK_PLUGIN_AUX(m_plugin_name, true) #else +// Expose the plugin name to the DFHack core, as well as metadata like the DFHack version. #define DFHACK_PLUGIN(m_plugin_name) DFHACK_PLUGIN_AUX(m_plugin_name, false) #endif diff --git a/plugins/skeleton/skeleton.cpp b/plugins/skeleton/skeleton.cpp index c06ca26cb..fd1571e4f 100644 --- a/plugins/skeleton/skeleton.cpp +++ b/plugins/skeleton/skeleton.cpp @@ -19,7 +19,7 @@ using namespace DFHack; using namespace df::enums; -// A plugin must be able to return its name and version. +// Expose the plugin name to the DFHack core, as well as metadata like the DFHack version. // The name string provided must correspond to the filename - // skeleton.plug.so, skeleton.plug.dylib, or skeleton.plug.dll in this case DFHACK_PLUGIN("skeleton"); @@ -59,6 +59,18 @@ DFhackCExport command_result plugin_shutdown (color_ostream &out) return CR_OK; } +// Used by `plug` to track this plugin's status. +// Called to enable/disable this plugin's state. +// Is called when using `enable` or `disable` in the console +/* +DFHACK_PLUGIN_IS_ENABLED(enabled); +DFhackCExport command_result plugin_enable(color_ostream &out, bool enable) { + enabled = enable; + // other code + return CR_OK; +} +*/ + // Called to notify the plugin about important state changes. // Invoked with DF suspended, and always before the matching plugin_onupdate. // More event codes may be added in the future.