summaryrefslogtreecommitdiff
path: root/src/company_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-12-08 17:18:51 +0000
committerfrosch <frosch@openttd.org>2012-12-08 17:18:51 +0000
commitb533523258dfd943caa307d28413693bcaa64007 (patch)
tree1236d0e560354d9b22d34269ba5ff99265a94cf6 /src/company_gui.cpp
parent18a5ba4ad7967c537854a3061df9e600c8f55bf7 (diff)
downloadopenttd-b533523258dfd943caa307d28413693bcaa64007.tar.xz
(svn r24801) -Codechange: Add functions to set integral DParams to suitable values for size computations.
Diffstat (limited to 'src/company_gui.cpp')
-rw-r--r--src/company_gui.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index ae6f394e9..c6ddd6bd0 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -319,7 +319,7 @@ struct CompanyFinancesWindow : Window {
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;
@@ -1691,12 +1691,12 @@ struct CompanyInfrastructureWindow : Window
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);
}
@@ -2095,14 +2095,14 @@ struct CompanyWindow : Window
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);
@@ -2115,7 +2115,7 @@ struct CompanyWindow : Window
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);