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;
|
|
|
|
|
2014-12-06 16:47:35 -07:00
|
|
|
DFHACK_PLUGIN("initflags");
|
|
|
|
REQUIRE_GLOBAL(d_init);
|
2011-12-24 03:51:58 -07:00
|
|
|
|
2012-03-10 04:55:42 -07:00
|
|
|
command_result twaterlvl(color_ostream &out, vector <string> & parameters);
|
|
|
|
command_result tidlers(color_ostream &out, vector <string> & parameters);
|
2011-12-24 03:51:58 -07:00
|
|
|
|
2012-03-10 04:55:42 -07:00
|
|
|
DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands)
|
2011-12-24 03:51:58 -07:00
|
|
|
{
|
|
|
|
if (d_init) {
|
2011-12-31 02:25:46 -07:00
|
|
|
commands.push_back(PluginCommand("twaterlvl", "Toggle display of water/magma depth.",
|
2012-03-03 06:38:24 -07:00
|
|
|
twaterlvl, Gui::dwarfmode_hotkey));
|
2011-12-31 02:25:46 -07:00
|
|
|
commands.push_back(PluginCommand("tidlers", "Toggle display of idlers.",
|
2012-03-03 06:38:24 -07:00
|
|
|
tidlers, Gui::dwarfmode_hotkey));
|
2011-12-24 03:51:58 -07:00
|
|
|
}
|
|
|
|
return CR_OK;
|
|
|
|
}
|
|
|
|
|
2012-03-10 04:55:42 -07:00
|
|
|
DFhackCExport command_result plugin_shutdown ( color_ostream &out )
|
2011-12-24 03:51:58 -07:00
|
|
|
{
|
|
|
|
return CR_OK;
|
|
|
|
}
|
|
|
|
|
2012-03-10 04:55:42 -07:00
|
|
|
command_result twaterlvl(color_ostream &out, 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);
|
2012-03-10 04:55:42 -07:00
|
|
|
out << "Toggled the display of water/magma depth." << endl;
|
2011-12-24 03:51:58 -07:00
|
|
|
return CR_OK;
|
|
|
|
}
|
|
|
|
|
2012-03-10 04:55:42 -07:00
|
|
|
command_result tidlers(color_ostream &out, 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);
|
2012-03-10 04:55:42 -07:00
|
|
|
out << "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;
|
|
|
|
}
|