Debug: Add object intro and end of life dates to debug window

This commit is contained in:
Jonathan G Rennison
2021-12-10 19:49:00 +00:00
parent 8c8a129c23
commit 15b0231821

View File

@@ -872,6 +872,19 @@ class NIHObject : public NIHelper {
seprintf(buffer, lastof(buffer), " size: %ux%u, height: %u, views: %u", GB(spec->size, 4, 4), GB(spec->size, 0, 4), spec->height, spec->views);
output.print(buffer);
{
YearMonthDay ymd;
ConvertDateToYMD(spec->introduction_date, &ymd);
char *b = buffer + seprintf(buffer, lastof(buffer), " intro: %4i-%02i-%02i",
ymd.year, ymd.month + 1, ymd.day);
if (spec->end_of_life_date < MAX_DAY) {
ConvertDateToYMD(spec->end_of_life_date, &ymd);
seprintf(b, lastof(buffer), ", end of life: %4i-%02i-%02i",
ymd.year, ymd.month + 1, ymd.day);
}
output.print(buffer);
}
output.register_next_line_click_flag_toggle(1);
seprintf(buffer, lastof(buffer), " [%c] flags: 0x%X", output.flags & 1 ? '-' : '+', spec->flags);
output.print(buffer);