diff --git a/src/lang/english.txt b/src/lang/english.txt index b1c50d6857..592d5830b4 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -5972,3 +5972,5 @@ CM_STR_NETWORK_SERVER_LIST_FILTER_REDDIT : CM_STR_NETWORK_SERVER_LIST_FILTER_TEAMGAME :{BLACK}TeamGame CM_STR_NETWORK_SERVER_LIST_FILTER_TOOLTIP :{BLACK}Filter this community +CM_STR_CONFIG_SETTING_ENABLE_POLYRAIL_TERRAFORM :Enable experimental auto-terraforming with polyrail +CM_STR_CONFIG_SETTING_ENABLE_POLYRAIL_TERRAFORM_HELPTEXT :Allows to use experimental auto-terraforming mode with polyrail tool (by pressing Fn modifier). \ No newline at end of file diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 039ca48057..2f98c65e51 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -1080,7 +1080,7 @@ struct BuildRailToolbarWindow : Window { EventState CM_OnFnModStateChange() override { - if (this->IsWidgetLowered(WID_RAT_POLYRAIL)) { + if (_settings_client.gui.cm_enable_polyrail_terraform && this->IsWidgetLowered(WID_RAT_POLYRAIL)) { return ES_HANDLED; } return ES_NOT_HANDLED; diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 1973f32f50..62590c7544 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1655,6 +1655,7 @@ static SettingsContainer &GetSettingsTree() construction->Add(new SettingEntry("gui.quick_goto")); construction->Add(new SettingEntry("gui.default_rail_type")); construction->Add(new SettingEntry("gui.cm_use_improved_station_join")); + construction->Add(new SettingEntry("gui.cm_enable_polyrail_terraform")); } interface->Add(new SettingEntry("gui.fast_forward_speed_limit")); diff --git a/src/settings_type.h b/src/settings_type.h index ae5c77d3c7..0552d4db3e 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -223,7 +223,7 @@ struct GUISettings { bool cm_show_apm; uint8 cm_graph_background; bool cm_show_client_overlay; - + bool cm_enable_polyrail_terraform; /** * Returns true when the user has sufficient privileges to edit newgrfs on a running game * @return whether the user has sufficient privileges to edit newgrfs in an existing game diff --git a/src/table/settings/cmclient_settings.ini b/src/table/settings/cmclient_settings.ini index e04ef2d22e..b925ad73ad 100644 --- a/src/table/settings/cmclient_settings.ini +++ b/src/table/settings/cmclient_settings.ini @@ -262,3 +262,10 @@ var = gui.cm_show_client_overlay def = false cat = SC_BASIC flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC + +[SDTC_BOOL] +var = gui.cm_enable_polyrail_terraform +def = false +str = CM_STR_CONFIG_SETTING_ENABLE_POLYRAIL_TERRAFORM +strhelp = CM_STR_CONFIG_SETTING_ENABLE_POLYRAIL_TERRAFORM_HELPTEXT +cat = SC_EXPERT diff --git a/src/viewport.cpp b/src/viewport.cpp index a326ae3de2..1bfbc16bc4 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -2695,7 +2695,7 @@ void UpdateTileSelection() _thd.new_size.y = y2 - y1 + TILE_SIZE; } } - _thd.cm_new_poly_terra = citymania::_fn_mod; + _thd.cm_new_poly_terra = _settings_client.gui.cm_enable_polyrail_terraform && citymania::_fn_mod; break; } /* HT_RAIL */