|
|
@ -1,37 +1,58 @@
|
|
|
|
#include "Console.h"
|
|
|
|
|
|
|
|
#include "Core.h"
|
|
|
|
#include "Core.h"
|
|
|
|
#include "DataDefs.h"
|
|
|
|
#include <Console.h>
|
|
|
|
#include "Export.h"
|
|
|
|
#include <Export.h>
|
|
|
|
#include "PluginManager.h"
|
|
|
|
#include <PluginManager.h>
|
|
|
|
|
|
|
|
#include <modules/EventManager.h>
|
|
|
|
|
|
|
|
|
|
|
|
//#include "df/world.h"
|
|
|
|
//#include "df/world.h"
|
|
|
|
|
|
|
|
|
|
|
|
using namespace DFHack;
|
|
|
|
using namespace DFHack;
|
|
|
|
|
|
|
|
using namespace df::enums;
|
|
|
|
|
|
|
|
|
|
|
|
DFHACK_PLUGIN("skeleton2");
|
|
|
|
DFHACK_PLUGIN("skeleton2");
|
|
|
|
|
|
|
|
DFHACK_PLUGIN_IS_ENABLED(enabled);
|
|
|
|
//REQUIRE_GLOBAL(world);
|
|
|
|
//REQUIRE_GLOBAL(world);
|
|
|
|
|
|
|
|
|
|
|
|
command_result skeleton2 (color_ostream &out, std::vector <std::string> & parameters);
|
|
|
|
command_result skeleton2 (color_ostream &out, std::vector <std::string> & parameters);
|
|
|
|
|
|
|
|
|
|
|
|
DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands)
|
|
|
|
DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands) {
|
|
|
|
{
|
|
|
|
commands.push_back(PluginCommand("skeleton2",
|
|
|
|
commands.push_back(PluginCommand(
|
|
|
|
"~54 character description of plugin", //to use one line in the ``[DFHack]# ls`` output
|
|
|
|
"skeleton2",
|
|
|
|
skeleton2,
|
|
|
|
"shortHelpString",
|
|
|
|
false,
|
|
|
|
skeleton2,
|
|
|
|
"example usage"
|
|
|
|
false, //allow non-interactive use
|
|
|
|
" skeleton2 <option> <args>\n"
|
|
|
|
"longHelpString"
|
|
|
|
" explanation of plugin/command\n"
|
|
|
|
));
|
|
|
|
"\n"
|
|
|
|
|
|
|
|
" skeleton2\n"
|
|
|
|
|
|
|
|
" what happens when using the command\n"
|
|
|
|
|
|
|
|
"\n"
|
|
|
|
|
|
|
|
" skeleton2 option1\n"
|
|
|
|
|
|
|
|
" what happens when using the command with option1\n"
|
|
|
|
|
|
|
|
"\n"));
|
|
|
|
return CR_OK;
|
|
|
|
return CR_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DFhackCExport command_result plugin_shutdown (color_ostream &out)
|
|
|
|
DFhackCExport command_result plugin_shutdown (color_ostream &out) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return CR_OK;
|
|
|
|
return CR_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
command_result skeleton2 (color_ostream &out, std::vector <std::string> & parameters)
|
|
|
|
DFhackCExport command_result plugin_enable(color_ostream &out, bool enable) {
|
|
|
|
{
|
|
|
|
namespace EM = EventManager;
|
|
|
|
|
|
|
|
if (enable && !enabled) {
|
|
|
|
|
|
|
|
//using namespace EM::EventType;
|
|
|
|
|
|
|
|
//EM::EventHandler eventHandler(onNewEvent, maxTickFreq);
|
|
|
|
|
|
|
|
//EM::registerListener(EventType::JOB_COMPLETED, eventHandler, plugin_self);
|
|
|
|
|
|
|
|
//out.print("plugin enabled!\n");
|
|
|
|
|
|
|
|
} else if (!enable && enabled) {
|
|
|
|
|
|
|
|
EM::unregisterAll(plugin_self);
|
|
|
|
|
|
|
|
//out.print("plugin disabled!\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
enabled = enable;
|
|
|
|
|
|
|
|
return CR_OK;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
command_result skeleton2 (color_ostream &out, std::vector <std::string> & parameters) {
|
|
|
|
if (!parameters.empty())
|
|
|
|
if (!parameters.empty())
|
|
|
|
return CR_WRONG_USAGE;
|
|
|
|
return CR_WRONG_USAGE;
|
|
|
|
CoreSuspender suspend;
|
|
|
|
CoreSuspender suspend;
|
|
|
|