From 3f98ed80afaec1407117a62879b8fb901c35ed7b Mon Sep 17 00:00:00 2001 From: Pavel Stupnikov Date: Thu, 26 Mar 2015 00:45:33 +0300 Subject: [PATCH] setting for disabling 'runway too short' warning --- src/lang/english.txt | 2 ++ src/order_cmd.cpp | 1 + src/settings_gui.cpp | 1 + src/settings_type.h | 1 + src/table/settings.ini | 6 ++++++ 5 files changed, 11 insertions(+) diff --git a/src/lang/english.txt b/src/lang/english.txt index 88e9952559..bf99e8e5de 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -5270,3 +5270,5 @@ STR_FUND_INDUSTRY_FORBIDDEN_TILES_ON_TOOLTIP :{BLACK}Highligh STR_CB_GUI_TOWN_VIEW_BUTTON :{BLACK}Town view STR_CB_GUI_TOWN_VIEW_TOOLTIP :{BLACK}Show information on town + +STR_CONFIG_SETTING_WARN_IF_RUNWAY_IS_TOO_SHORT :Warn if airplane has in its orders an airport whose runway is too short diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index e3ae8c20f7..b3b3b6a91b 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -1794,6 +1794,7 @@ void CheckOrders(const Vehicle *v) } else if (v->type == VEH_AIRCRAFT && (AircraftVehInfo(v->engine_type)->subtype & AIR_FAST) && (st->airport.GetFTA()->flags & AirportFTAClass::SHORT_STRIP) && + _settings_client.gui.runway_too_short_warn && _settings_game.vehicle.plane_crashes != 0 && !_cheats.no_jetcrash.value && message == INVALID_STRING_ID) { diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 039a552d88..b421326013 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1581,6 +1581,7 @@ static SettingsContainer &GetSettingsTree() advisors->Add(new SettingEntry("gui.order_review_system")); advisors->Add(new SettingEntry("gui.vehicle_income_warn")); advisors->Add(new SettingEntry("gui.lost_vehicle_warn")); + advisors->Add(new SettingEntry("gui.runway_too_short_warn")); advisors->Add(new SettingEntry("gui.show_finances")); advisors->Add(new SettingEntry("news_display.economy")); advisors->Add(new SettingEntry("news_display.subsidies")); diff --git a/src/settings_type.h b/src/settings_type.h index 9ed095ff89..81ebd7bf51 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -172,6 +172,7 @@ struct GUISettings { bool enable_extra_tooltips; ///< enable extra tooltips when hovering over various elements bool polyrail_double_click; ///< finish polyrail with mouse double click bool show_industry_forbidden_tiles; ///< higlight areas where industry placement is forbidden regardless of terrain + bool runway_too_short_warn; ///< warn about aircrafts using too short runways /** * Returns true when the user has sufficient privileges to edit newgrfs on a running game diff --git a/src/table/settings.ini b/src/table/settings.ini index ed2f0b5a82..f976ee65e4 100644 --- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -4075,5 +4075,11 @@ flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC def = false cat = SC_BASIC +[SDTC_BOOL] +var = gui.runway_too_short_warn +flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC +def = true +str = STR_CONFIG_SETTING_WARN_IF_RUNWAY_IS_TOO_SHORT + [SDT_END]