changeset 17089:6e590e642890 draft

(svn r21826) -Fix [FS#4007]: the expectations from the "always build infrastructure" setting name/description didn't match the behaviour
author rubidium <rubidium@openttd.org>
date Sun, 16 Jan 2011 21:10:41 +0000
parents d94ae66ace1f
children 9ba74d68e480
files src/lang/english.txt src/settings_gui.cpp src/settings_type.h src/table/settings.h src/vehicle.cpp
diffstat 5 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -1247,7 +1247,7 @@
 STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS                     :{LTBLUE}Keep building tools active after usage: {ORANGE}{STRING1}
 STR_CONFIG_SETTING_EXPENSES_LAYOUT                              :{LTBLUE}Group expenses in company finance window: {ORANGE}{STRING1}
 
-STR_CONFIG_SETTING_ALWAYS_BUILD_INFRASTRUCTURE                  :{LTBLUE}Show building tools when no suitable vehicles are available: {ORANGE}{STRING1}
+STR_CONFIG_SETTING_DISABLE_UNSUITABLE_BUILDING                  :{LTBLUE}Disable infrastructure building when no suitable vehicles are available: {ORANGE}{STRING1}
 STR_CONFIG_SETTING_MAX_TRAINS                                   :{LTBLUE}Max trains per company: {ORANGE}{STRING1}
 STR_CONFIG_SETTING_MAX_ROAD_VEHICLES                            :{LTBLUE}Max road vehicles per company: {ORANGE}{STRING1}
 STR_CONFIG_SETTING_MAX_AIRCRAFT                                 :{LTBLUE}Max aircraft per company: {ORANGE}{STRING1}
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -1315,7 +1315,7 @@
 	SettingEntry("gui.timetable_arrival_departure"),
 	SettingEntry("gui.quick_goto"),
 	SettingEntry("gui.default_rail_type"),
-	SettingEntry("gui.always_build_infrastructure"),
+	SettingEntry("gui.disable_unsuitable_building"),
 	SettingEntry("gui.persistent_buildingtools"),
 	SettingEntry("gui.coloured_news_year"),
 };
--- a/src/settings_type.h
+++ b/src/settings_type.h
@@ -69,7 +69,7 @@
 	uint8  statusbar_pos;                    ///< position of statusbar, 0=left, 1=center, 2=right
 	uint8  window_snap_radius;               ///< windows snap at each other if closer than this
 	uint8  window_soft_limit;                ///< soft limit of maximum number of non-stickied non-vital windows (0 = no limit)
-	bool   always_build_infrastructure;      ///< always allow building of infrastructure, even when you do not have the vehicles for it
+	bool   disable_unsuitable_building;      ///< disable infrastructure building when no suitable vehicles are available
 	byte   autosave;                         ///< how often should we do autosaves?
 	bool   threaded_saves;                   ///< should we do threaded saves?
 	bool   keep_all_autosave;                ///< name the autosave in a different way
--- a/src/table/settings.h
+++ b/src/table/settings.h
@@ -598,7 +598,7 @@
 	 SDTC_BOOL(gui.vehicle_income_warn,                  S,  0,  true,                        STR_CONFIG_SETTING_WARN_INCOME_LESS,            NULL),
 	  SDTC_VAR(gui.order_review_system,       SLE_UINT8, S, MS,     2,        0,        2, 0, STR_CONFIG_SETTING_ORDER_REVIEW,                NULL),
 	 SDTC_BOOL(gui.lost_vehicle_warn,                    S,  0,  true,                        STR_CONFIG_SETTING_WARN_LOST_VEHICLE,           NULL),
-	 SDTC_BOOL(gui.always_build_infrastructure,          S,  0, false,                        STR_CONFIG_SETTING_ALWAYS_BUILD_INFRASTRUCTURE, RedrawScreen),
+	 SDTC_BOOL(gui.disable_unsuitable_building,          S,  0,  true,                        STR_CONFIG_SETTING_DISABLE_UNSUITABLE_BUILDING, RedrawScreen),
 	 SDTC_BOOL(gui.new_nonstop,                          S,  0, false,                        STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT,          NULL),
 	  SDTC_VAR(gui.stop_location,             SLE_UINT8, S, MS,     2,        0,        2, 1, STR_CONFIG_SETTING_STOP_LOCATION,               NULL),
 	 SDTC_BOOL(gui.keep_all_autosave,                    S,  0, false,                        STR_NULL,                                       NULL),
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -1468,7 +1468,7 @@
 	assert(IsCompanyBuildableVehicleType(type));
 
 	if (!Company::IsValidID(_local_company)) return false;
-	if (_settings_client.gui.always_build_infrastructure) return true;
+	if (!_settings_client.gui.disable_unsuitable_building) return true;
 
 	UnitID max;
 	switch (type) {