Adjust handling of year display in wallclock mode and company inauguration years
See: #657
This commit is contained in:
@@ -424,10 +424,10 @@ struct CompanyFinancesWindow : Window {
|
||||
case WID_CF_EXPS_PRICE2:
|
||||
case WID_CF_EXPS_PRICE3: {
|
||||
const Company *c = Company::Get((CompanyID)this->window_number);
|
||||
YearDelta age = std::min<YearDelta>(CalTime::CurYear() - c->inaugurated_year, 2);
|
||||
YearDelta age = std::min<YearDelta>(c->age_years, 2);
|
||||
int wid_offset = widget - WID_CF_EXPS_PRICE1;
|
||||
if (wid_offset <= age.base()) {
|
||||
DrawYearColumn(r, CalTime::CurYear().base() - (age.base() - wid_offset), c->yearly_expenses[age.base() - wid_offset]);
|
||||
DrawYearColumn(r, EconTime::YearToDisplay(EconTime::CurYear().base() - (age.base() - wid_offset)), c->yearly_expenses[age.base() - wid_offset]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2595,7 +2595,7 @@ struct CompanyWindow : Window
|
||||
break;
|
||||
|
||||
case WID_C_DESC_INAUGURATION:
|
||||
SetDParam(0, Company::Get((CompanyID)this->window_number)->inaugurated_year);
|
||||
SetDParam(0, Company::Get((CompanyID)this->window_number)->InauguratedDisplayYear());
|
||||
break;
|
||||
|
||||
case WID_C_DESC_COMPANY_VALUE:
|
||||
|
||||
Reference in New Issue
Block a user