|
|
|
@ -48,7 +48,7 @@ using df::global::ui;
|
|
|
|
|
|
|
|
|
|
typedef int16_t activity_type;
|
|
|
|
|
|
|
|
|
|
#define PLUGIN_VERSION 0.8
|
|
|
|
|
#define PLUGIN_VERSION 0.9
|
|
|
|
|
#define DAY_TICKS 1200
|
|
|
|
|
#define DELTA_TICKS 100
|
|
|
|
|
|
|
|
|
@ -66,6 +66,7 @@ struct less_second {
|
|
|
|
|
|
|
|
|
|
static bool monitor_jobs = false;
|
|
|
|
|
static bool monitor_misery = true;
|
|
|
|
|
static bool monitor_date = true;
|
|
|
|
|
static map<df::unit *, deque<activity_type>> work_history;
|
|
|
|
|
|
|
|
|
|
static int misery[] = { 0, 0, 0, 0, 0, 0, 0 };
|
|
|
|
@ -1693,7 +1694,9 @@ struct dwarf_monitor_hook : public df::viewscreen_dwarfmodest
|
|
|
|
|
{
|
|
|
|
|
INTERPOSE_NEXT(render)();
|
|
|
|
|
|
|
|
|
|
if (monitor_misery && Maps::IsValid())
|
|
|
|
|
if (Maps::IsValid())
|
|
|
|
|
{
|
|
|
|
|
if (monitor_misery)
|
|
|
|
|
{
|
|
|
|
|
string entries[7];
|
|
|
|
|
size_t length = 9;
|
|
|
|
@ -1713,6 +1716,29 @@ struct dwarf_monitor_hook : public df::viewscreen_dwarfmodest
|
|
|
|
|
OutputString(COLOR_WHITE, x, y, "/");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (monitor_date)
|
|
|
|
|
{
|
|
|
|
|
int x = gps->dimx - 30;
|
|
|
|
|
int y = 0;
|
|
|
|
|
|
|
|
|
|
ostringstream date_str;
|
|
|
|
|
auto month = World::ReadCurrentMonth();
|
|
|
|
|
auto day = World::ReadCurrentDay();
|
|
|
|
|
date_str << "Date:" << World::ReadCurrentYear() << "/" <<
|
|
|
|
|
((month < 10) ? "0" : "") << month << "/" <<
|
|
|
|
|
((day < 10) ? "0" : "") << day;
|
|
|
|
|
|
|
|
|
|
OutputString(COLOR_GREY, x, y, date_str.str());
|
|
|
|
|
|
|
|
|
|
x = 1;
|
|
|
|
|
y = gps->dimy - 1;
|
|
|
|
|
if (World::ReadCurrentWeather() == weather_type::Rain)
|
|
|
|
|
OutputString(COLOR_BLUE, x, y, "Rain");
|
|
|
|
|
else if (World::ReadCurrentWeather() == weather_type::Snow)
|
|
|
|
|
OutputString(COLOR_WHITE, x, y, "Snow");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -1736,12 +1762,16 @@ static bool set_monitoring_mode(const string &mode, const bool &state)
|
|
|
|
|
if (!monitor_jobs)
|
|
|
|
|
reset();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mode == "misery" || mode == "all")
|
|
|
|
|
else if (mode == "misery" || mode == "all")
|
|
|
|
|
{
|
|
|
|
|
mode_recognized = true;
|
|
|
|
|
monitor_misery = state;
|
|
|
|
|
}
|
|
|
|
|
else if (mode == "date" || mode == "all")
|
|
|
|
|
{
|
|
|
|
|
mode_recognized = true;
|
|
|
|
|
monitor_date = state;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return mode_recognized;
|
|
|
|
|
}
|
|
|
|
|