|
|
@ -205,6 +205,7 @@ namespace DFHack
|
|
|
|
void reset_lua();
|
|
|
|
void reset_lua();
|
|
|
|
|
|
|
|
|
|
|
|
bool *plugin_is_enabled;
|
|
|
|
bool *plugin_is_enabled;
|
|
|
|
|
|
|
|
std::vector<std::string>* plugin_globals;
|
|
|
|
command_result (*plugin_init)(color_ostream &, std::vector <PluginCommand> &);
|
|
|
|
command_result (*plugin_init)(color_ostream &, std::vector <PluginCommand> &);
|
|
|
|
command_result (*plugin_status)(color_ostream &, std::string &);
|
|
|
|
command_result (*plugin_status)(color_ostream &, std::string &);
|
|
|
|
command_result (*plugin_shutdown)(color_ostream &);
|
|
|
|
command_result (*plugin_shutdown)(color_ostream &);
|
|
|
@ -264,7 +265,9 @@ namespace DFHack
|
|
|
|
#define DFHACK_PLUGIN(plugin_name) \
|
|
|
|
#define DFHACK_PLUGIN(plugin_name) \
|
|
|
|
DFhackDataExport const char * version = DFHACK_VERSION;\
|
|
|
|
DFhackDataExport const char * version = DFHACK_VERSION;\
|
|
|
|
DFhackDataExport const char * name = plugin_name;\
|
|
|
|
DFhackDataExport const char * name = plugin_name;\
|
|
|
|
DFhackDataExport Plugin *plugin_self = NULL;
|
|
|
|
DFhackDataExport Plugin *plugin_self = NULL;\
|
|
|
|
|
|
|
|
std::vector<std::string> _plugin_globals;\
|
|
|
|
|
|
|
|
DFhackDataExport std::vector<std::string>* plugin_globals = &_plugin_globals;
|
|
|
|
|
|
|
|
|
|
|
|
#define DFHACK_PLUGIN_IS_ENABLED(varname) \
|
|
|
|
#define DFHACK_PLUGIN_IS_ENABLED(varname) \
|
|
|
|
DFhackDataExport bool plugin_is_enabled = false; \
|
|
|
|
DFhackDataExport bool plugin_is_enabled = false; \
|
|
|
@ -281,3 +284,8 @@ namespace DFHack
|
|
|
|
#define DFHACK_LUA_FUNCTION(name) { #name, df::wrap_function(name,true) }
|
|
|
|
#define DFHACK_LUA_FUNCTION(name) { #name, df::wrap_function(name,true) }
|
|
|
|
#define DFHACK_LUA_EVENT(name) { #name, &name##_event }
|
|
|
|
#define DFHACK_LUA_EVENT(name) { #name, &name##_event }
|
|
|
|
#define DFHACK_LUA_END { NULL, NULL }
|
|
|
|
#define DFHACK_LUA_END { NULL, NULL }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define REQUIRE_GLOBAL(global_name) \
|
|
|
|
|
|
|
|
using df::global::global_name; \
|
|
|
|
|
|
|
|
static int VARIABLE_IS_NOT_USED CONCAT_TOKENS(required_globals_, __LINE__) = \
|
|
|
|
|
|
|
|
(plugin_globals->push_back(#global_name), 0);
|
|
|
|