dwarfmonitor: Allow weather indicator to be configured separately

develop
lethosor 2015-06-10 23:09:01 -04:00
parent eabcee38e5
commit 84b0b48028
3 changed files with 14 additions and 4 deletions

@ -28,6 +28,7 @@ DFHack Future
- Note: Existing stuck jobs must be cancelled and re-added - Note: Existing stuck jobs must be cancelled and re-added
Misc Improvements Misc Improvements
dwarfmonitor date format can be modified (see Readme) dwarfmonitor date format can be modified (see Readme)
dwarfmonitor weather display can be configured separately
"keybinding list" accepts a context "keybinding list" accepts a context
nyan: Can now be stopped with dfhack-run nyan: Can now be stopped with dfhack-run
quicksave: Restricted to fortress mode quicksave: Restricted to fortress mode

@ -1692,7 +1692,7 @@ Records dwarf activity to measure fort efficiency.
Options: Options:
``dwarfmonitor enable <mode>``: ``dwarfmonitor enable <mode>``:
Start monitoring ``mode``. ``mode`` can be "work", "misery", or "all". Start monitoring ``mode``. ``mode`` can be "work", "misery", "weather", or "all".
``dwarfmonitor disable <mode>``: ``dwarfmonitor disable <mode>``:
Stop monitoring ``mode`` (see above) Stop monitoring ``mode`` (see above)
``dwarfmonitor stats``: ``dwarfmonitor stats``:

@ -77,6 +77,7 @@ static dwarfmonitor_configst dwarfmonitor_config;
static bool monitor_jobs = false; static bool monitor_jobs = false;
static bool monitor_misery = true; static bool monitor_misery = true;
static bool monitor_date = true; static bool monitor_date = true;
static bool monitor_weather = true;
static map<df::unit *, deque<activity_type>> work_history; static map<df::unit *, deque<activity_type>> work_history;
static int misery[] = { 0, 0, 0, 0, 0, 0, 0 }; static int misery[] = { 0, 0, 0, 0, 0, 0, 0 };
@ -1753,8 +1754,11 @@ struct dwarf_monitor_hook : public df::viewscreen_dwarfmodest
OutputString(COLOR_GREY, x, y, date_str.str()); OutputString(COLOR_GREY, x, y, date_str.str());
x = 1; }
y = gps->dimy - 1; if (monitor_weather)
{
int x = 1;
int y = gps->dimy - 1;
bool rain = false, bool rain = false,
snow = false; snow = false;
if (current_weather) if (current_weather)
@ -1817,6 +1821,11 @@ static bool set_monitoring_mode(const string &mode, const bool &state)
mode_recognized = true; mode_recognized = true;
monitor_date = state; monitor_date = state;
} }
else if (mode == "weather" || mode == "all")
{
mode_recognized = true;
monitor_weather = state;
}
return mode_recognized; return mode_recognized;
} }
@ -1945,7 +1954,7 @@ DFhackCExport command_result plugin_init(color_ostream &out, std::vector <Plugin
dwarfmonitor_cmd, false, dwarfmonitor_cmd, false,
"dwarfmonitor enable <mode>\n" "dwarfmonitor enable <mode>\n"
" Start monitoring <mode>\n" " Start monitoring <mode>\n"
" <mode> can be \"work\", \"misery\", or \"all\"\n" " <mode> can be \"work\", \"misery\", \"weather\", or \"all\"\n"
"dwarfmonitor disable <mode>\n" "dwarfmonitor disable <mode>\n"
" <mode> as above\n\n" " <mode> as above\n\n"
"dwarfmonitor stats\n" "dwarfmonitor stats\n"