Add wallclock time settings
This commit is contained in:
@@ -157,7 +157,15 @@ struct SubsidyListWindow : Window {
|
||||
if (IsInsideMM(pos, 0, cap)) {
|
||||
/* Displays the two offered towns */
|
||||
SetupSubsidyDecodeParam(s, SubsidyDecodeParamType::Gui);
|
||||
SetDParam(7, EconTime::CurDate() - EconTime::CurDay() + s->remaining * 32);
|
||||
/* If using wallclock units, show minutes remaining. Otherwise show the date when the subsidy ends. */
|
||||
if (EconTime::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, EconTime::CurDate() - EconTime::CurDay() + s->remaining * 32);
|
||||
}
|
||||
|
||||
DrawString(tr.left, tr.right, tr.top + pos * GetCharacterHeight(FS_NORMAL), STR_SUBSIDIES_OFFERED_FROM_TO);
|
||||
}
|
||||
pos++;
|
||||
@@ -181,7 +189,15 @@ struct SubsidyListWindow : Window {
|
||||
if (IsInsideMM(pos, 0, cap)) {
|
||||
SetupSubsidyDecodeParam(s, SubsidyDecodeParamType::Gui);
|
||||
SetDParam(7, s->awarded);
|
||||
SetDParam(8, EconTime::CurDate() - EconTime::CurDay() + s->remaining * 32);
|
||||
/* If using wallclock units, show minutes remaining. Otherwise show the date when the subsidy ends. */
|
||||
if (EconTime::UsingWallclockUnits()) {
|
||||
SetDParam(8, STR_SUBSIDIES_SUBSIDISED_EXPIRY_TIME);
|
||||
SetDParam(9, s->remaining);
|
||||
}
|
||||
else {
|
||||
SetDParam(8, STR_SUBSIDIES_SUBSIDISED_EXPIRY_DATE);
|
||||
SetDParam(9, EconTime::CurDate() - EconTime::CurDay() + s->remaining * 32);
|
||||
}
|
||||
|
||||
/* Displays the two connected stations */
|
||||
DrawString(tr.left, tr.right, tr.top + pos * GetCharacterHeight(FS_NORMAL), STR_SUBSIDIES_SUBSIDISED_FROM_TO);
|
||||
|
Reference in New Issue
Block a user