2011-12-31 04:48:42 -07:00
|
|
|
#include "Core.h"
|
2012-01-15 13:54:14 -07:00
|
|
|
#include "Console.h"
|
|
|
|
#include "Export.h"
|
|
|
|
#include "PluginManager.h"
|
2011-12-24 03:51:58 -07:00
|
|
|
|
2012-01-15 13:54:14 -07:00
|
|
|
#include "DataDefs.h"
|
|
|
|
#include "df/d_init.h"
|
2011-12-24 03:51:58 -07:00
|
|
|
|
|
|
|
using std::vector;
|
|
|
|
using std::string;
|
|
|
|
using std::endl;
|
|
|
|
using namespace DFHack;
|
|
|
|
using namespace df::enums;
|
|
|
|
|
|
|
|
using df::global::d_init;
|
|
|
|
|
2012-02-13 21:54:08 -07:00
|
|
|
command_result twaterlvl(Core * c, vector <string> & parameters);
|
|
|
|
command_result tidlers(Core * c, vector <string> & parameters);
|
2011-12-24 03:51:58 -07:00
|
|
|
|
|
|
|
DFhackCExport const char * plugin_name ( void )
|
|
|
|
{
|
|
|
|
return "initflags";
|
|
|
|
}
|
|
|
|
|
|
|
|
DFhackCExport command_result plugin_init (Core *c, std::vector <PluginCommand> &commands)
|
|
|
|
{
|
|
|
|
commands.clear();
|
|
|
|
if (d_init) {
|
2011-12-31 02:25:46 -07:00
|
|
|
commands.push_back(PluginCommand("twaterlvl", "Toggle display of water/magma depth.",
|
|
|
|
twaterlvl, dwarfmode_hotkey));
|
|
|
|
commands.push_back(PluginCommand("tidlers", "Toggle display of idlers.",
|
|
|
|
tidlers, dwarfmode_hotkey));
|
2011-12-24 03:51:58 -07:00
|
|
|
}
|
|
|
|
std::cerr << "d_init: " << sizeof(df::d_init) << endl;
|
|
|
|
return CR_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
DFhackCExport command_result plugin_shutdown ( Core * c )
|
|
|
|
{
|
|
|
|
return CR_OK;
|
|
|
|
}
|
|
|
|
|
2012-02-13 21:54:08 -07:00
|
|
|
command_result twaterlvl(Core * c, vector <string> & parameters)
|
2011-12-24 03:51:58 -07:00
|
|
|
{
|
2011-12-31 02:25:46 -07:00
|
|
|
// HOTKEY COMMAND: CORE ALREADY SUSPENDED
|
2012-01-21 17:31:15 -07:00
|
|
|
d_init->flags1.toggle(d_init_flags1::SHOW_FLOW_AMOUNTS);
|
2011-12-24 03:51:58 -07:00
|
|
|
c->con << "Toggled the display of water/magma depth." << endl;
|
|
|
|
return CR_OK;
|
|
|
|
}
|
|
|
|
|
2012-02-13 21:54:08 -07:00
|
|
|
command_result tidlers(Core * c, vector <string> & parameters)
|
2011-12-24 03:51:58 -07:00
|
|
|
{
|
2011-12-31 02:25:46 -07:00
|
|
|
// HOTKEY COMMAND: CORE ALREADY SUSPENDED
|
2012-01-03 08:25:55 -07:00
|
|
|
d_init->idlers = ENUM_NEXT_ITEM(d_init_idlers, d_init->idlers);
|
|
|
|
c->con << "Toggled the display of idlers to " << ENUM_KEY_STR(d_init_idlers, d_init->idlers) << endl;
|
2011-12-24 03:51:58 -07:00
|
|
|
return CR_OK;
|
|
|
|
}
|