add sample plugin to go with the sample help (#2239)

develop
Myk 2022-07-05 14:13:25 -07:00 committed by myk002
parent 27d7c3acc6
commit b0e7325d4f
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
2 changed files with 29 additions and 0 deletions

@ -106,6 +106,7 @@ if(BUILD_SUPPORTED)
dfhack_plugin(command-prompt command-prompt.cpp)
dfhack_plugin(confirm confirm.cpp LINK_LIBRARIES lua)
dfhack_plugin(createitem createitem.cpp)
dfhack_plugin(cromulate cromulate.cpp)
dfhack_plugin(cursecheck cursecheck.cpp)
dfhack_plugin(cxxrandom cxxrandom.cpp LINK_LIBRARIES lua)
dfhack_plugin(deramp deramp.cpp)

@ -0,0 +1,28 @@
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
using namespace DFHack;
using namespace df::enums;
DFHACK_PLUGIN("cromulate");
command_result cromulate (color_ostream &out, std::vector <std::string> & parameters);
DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands) {
commands.push_back(PluginCommand("cromulate",
"in-cpp plugin short desc", //to use one line in the ``[DFHack]# ls`` output
cromulate,
false,
"in-cpp plugin long help"));
return CR_OK;
}
DFhackCExport command_result plugin_shutdown (color_ostream &out) {
return CR_OK;
}
command_result cromulate (color_ostream &out, std::vector <std::string> &parameters) {
return CR_OK;
}