diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp --- a/src/subsidy_gui.cpp +++ b/src/subsidy_gui.cpp @@ -159,7 +159,15 @@ struct SubsidyListWindow : Window { if (IsInsideMM(pos, 0, cap)) { /* Displays the two offered towns */ SetupSubsidyDecodeParam(s, SubsidyDecodeParamType::Gui); - SetDParam(7, TimerGameEconomy::date - ymd.day + s->remaining * 32); + /* If using wallclock units, show minutes remaining. Otherwise show the date when the subsidy ends. */ + if (TimerGameEconomy::UsingWallclockUnits()) { + SetDParam(7, STR_SUBSIDIES_OFFERED_EXPIRY_TIME); + SetDParam(8, s->remaining + 1); // We get the rest of the current economy month for free, since the expiration is checked on each new month. + } else { + SetDParam(7, STR_SUBSIDIES_OFFERED_EXPIRY_DATE); + SetDParam(8, TimerGameEconomy::date - ymd.day + s->remaining * 32); + } + DrawString(tr.left, tr.right, tr.top + pos * GetCharacterHeight(FS_NORMAL), STR_SUBSIDIES_OFFERED_FROM_TO); } pos++; @@ -183,7 +191,15 @@ struct SubsidyListWindow : Window { if (IsInsideMM(pos, 0, cap)) { SetupSubsidyDecodeParam(s, SubsidyDecodeParamType::Gui); SetDParam(7, s->awarded); - SetDParam(8, TimerGameEconomy::date - ymd.day + s->remaining * 32); + /* If using wallclock units, show minutes remaining. Otherwise show the date when the subsidy ends. */ + if (TimerGameEconomy::UsingWallclockUnits()) { + SetDParam(8, STR_SUBSIDIES_SUBSIDISED_EXPIRY_TIME); + SetDParam(9, s->remaining); + } + else { + SetDParam(8, STR_SUBSIDIES_SUBSIDISED_EXPIRY_DATE); + SetDParam(9, TimerGameEconomy::date - ymd.day + s->remaining * 32); + } /* Displays the two connected stations */ DrawString(tr.left, tr.right, tr.top + pos * GetCharacterHeight(FS_NORMAL), STR_SUBSIDIES_SUBSIDISED_FROM_TO);