|
@@ -316,13 +316,13 @@ struct CompanyFinancesWindow : Window {
|
|
|
case WID_CF_EXPS_PRICE3:
|
|
|
size->height = _expenses_list_types[type].GetHeight();
|
|
|
/* FALL THROUGH */
|
|
|
case WID_CF_BALANCE_VALUE:
|
|
|
case WID_CF_LOAN_VALUE:
|
|
|
case WID_CF_TOTAL_VALUE:
|
|
|
SetDParam(0, CompanyFinancesWindow::max_money);
|
|
|
SetDParamMaxValue(0, CompanyFinancesWindow::max_money);
|
|
|
size->width = max(GetStringBoundingBox(STR_FINANCES_NEGATIVE_INCOME).width, GetStringBoundingBox(STR_FINANCES_POSITIVE_INCOME).width) + padding.width;
|
|
|
break;
|
|
|
|
|
|
case WID_CF_MAXLOAN_GAP:
|
|
|
size->height = FONT_HEIGHT_NORMAL;
|
|
|
break;
|
|
@@ -1688,18 +1688,18 @@ struct CompanyInfrastructureWindow : Win
|
|
|
max_cost = max(max_cost, CanalMaintenanceCost(c->infrastructure.water));
|
|
|
max_val = max(max_val, c->infrastructure.station);
|
|
|
max_cost = max(max_cost, StationMaintenanceCost(c->infrastructure.station));
|
|
|
max_val = max(max_val, c->infrastructure.airport);
|
|
|
max_cost = max(max_cost, AirportMaintenanceCost(c->index));
|
|
|
|
|
|
SetDParam(0, max_val);
|
|
|
SetDParam(1, max_cost * 12); // Convert to per year
|
|
|
SetDParamMaxValue(0, max_val);
|
|
|
SetDParamMaxValue(1, max_cost * 12); // Convert to per year
|
|
|
size->width = max(size->width, GetStringBoundingBox(_settings_game.economy.infrastructure_maintenance ? STR_COMPANY_INFRASTRUCTURE_VIEW_COST : STR_WHITE_COMMA).width + 20); // Reserve some wiggle room.
|
|
|
|
|
|
if (_settings_game.economy.infrastructure_maintenance) {
|
|
|
SetDParam(0, this->GetTotalMaintenanceCost() * 12); // Convert to per year
|
|
|
SetDParamMaxValue(0, this->GetTotalMaintenanceCost() * 12); // Convert to per year
|
|
|
this->total_width = GetStringBoundingBox(STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL).width + 20;
|
|
|
size->width = max(size->width, this->total_width);
|
|
|
}
|
|
|
|
|
|
/* Set height of the total line. */
|
|
|
if (widget == WID_CI_TOTAL) {
|
|
@@ -2092,33 +2092,33 @@ struct CompanyWindow : Window
|
|
|
case WID_C_DESC_COMPANY_VALUE:
|
|
|
SetDParam(0, INT64_MAX); // Arguably the maximum company value
|
|
|
size->width = GetStringBoundingBox(STR_COMPANY_VIEW_COMPANY_VALUE).width;
|
|
|
break;
|
|
|
|
|
|
case WID_C_DESC_VEHICLE_COUNTS:
|
|
|
SetDParam(0, 5000); // Maximum number of vehicles
|
|
|
SetDParamMaxValue(0, 5000); // Maximum number of vehicles
|
|
|
for (uint i = 0; i < lengthof(_company_view_vehicle_count_strings); i++) {
|
|
|
size->width = max(size->width, GetStringBoundingBox(_company_view_vehicle_count_strings[i]).width);
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
case WID_C_DESC_INFRASTRUCTURE_COUNTS:
|
|
|
SetDParam(0, UINT_MAX);
|
|
|
SetDParamMaxValue(0, UINT_MAX);
|
|
|
size->width = max(size->width, GetStringBoundingBox(STR_COMPANY_VIEW_INFRASTRUCTURE_RAIL).width);
|
|
|
size->width = max(size->width, GetStringBoundingBox(STR_COMPANY_VIEW_INFRASTRUCTURE_ROAD).width);
|
|
|
size->width = max(size->width, GetStringBoundingBox(STR_COMPANY_VIEW_INFRASTRUCTURE_WATER).width);
|
|
|
size->width = max(size->width, GetStringBoundingBox(STR_COMPANY_VIEW_INFRASTRUCTURE_STATION).width);
|
|
|
size->width = max(size->width, GetStringBoundingBox(STR_COMPANY_VIEW_INFRASTRUCTURE_AIRPORT).width);
|
|
|
size->width = max(size->width, GetStringBoundingBox(STR_COMPANY_VIEW_INFRASTRUCTURE_NONE).width);
|
|
|
break;
|
|
|
|
|
|
case WID_C_DESC_OWNERS: {
|
|
|
const Company *c2;
|
|
|
|
|
|
FOR_ALL_COMPANIES(c2) {
|
|
|
SetDParam(0, 25);
|
|
|
SetDParamMaxValue(0, 75);
|
|
|
SetDParam(1, c2->index);
|
|
|
|
|
|
size->width = max(size->width, GetStringBoundingBox(STR_COMPANY_VIEW_SHARES_OWNED_BY).width);
|
|
|
}
|
|
|
break;
|
|
|
}
|