Hide polyrail auto-terraform mode behind a setting for now

This commit is contained in:
dP
2021-10-23 18:48:24 +03:00
parent e4b2af2709
commit ece06f8510
6 changed files with 13 additions and 3 deletions

View File

@@ -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).

View File

@@ -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;

View File

@@ -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"));

View File

@@ -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

View File

@@ -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

View File

@@ -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 */