From 15b0231821af4b2e6b089555c4395ad37267ccb3 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Fri, 10 Dec 2021 19:49:00 +0000 Subject: [PATCH] Debug: Add object intro and end of life dates to debug window --- src/table/newgrf_debug_data.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index e40f9226bc..85ed6fe031 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -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);