Add UI setting for whether to open new vehicle GUI when share-cloning

pull/78/head
Jonathan G Rennison 5 years ago
parent f1a6f1161d
commit 7b8db50fd5

@ -912,7 +912,8 @@ struct DepotWindow : Window {
{
if (_ctrl_pressed) {
/* Share-clone, do not open new viewport, and keep tool active */
DoCommandP(this->window_number, v->index, 1, CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type), NULL);
DoCommandP(this->window_number, v->index, 1, CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type),
_settings_client.gui.open_vehicle_gui_clone_share ? CcCloneVehicle : NULL);
} else {
/* Copy-clone, open viewport for new vehicle, and deselect the tool (assume player wants to changs things on new vehicle) */
if (DoCommandP(this->window_number, v->index, 0, CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type), CcCloneVehicle)) {

@ -1342,6 +1342,8 @@ STR_CONFIG_SETTING_DISABLE_TOP_VEH_LIST_MASS_ACTIONS :Disable mass ac
STR_CONFIG_SETTING_DISABLE_TOP_VEH_LIST_MASS_ACTIONS_HELPTEXT :This disables depot/service and start/stop buttons for all vehicle and all ungrouped vehicle lists. This is intended to help avoid the negative impact of accidentally pressing one of these buttons.
STR_CONFIG_SETTING_SHOW_DEPOT_SELL_GUI :Show go to depot/hangar and sell feature: {STRING2}
STR_CONFIG_SETTING_SHOW_DEPOT_SELL_GUI_HELPTEXT :Show go to depot/hangar and sell vehicle on arrival feature. When enabled, the behaviour of the vehicle go to depot button is changed.
STR_CONFIG_SETTING_OPEN_VEHICLE_GUI_CLONE_SHARE :Open new vehicle window when share-cloning: {STRING2}
STR_CONFIG_SETTING_OPEN_VEHICLE_GUI_CLONE_SHARE_HELPTEXT :When enabled, open the newly cloned vehicle's window when cloning a vehicle with shared orders from the depot window.
STR_CONFIG_SETTING_ADV_SIG_BRIDGE_TUN_MODES :Enable signals on bridges/tunnels advanced modes: {STRING2}
STR_CONFIG_SETTING_ADV_SIG_BRIDGE_TUN_MODES_HELPTEXT :Enables use of advanced modes of signal simulation on bridges and tunnels. When disabled, bridges/tunnels which are not already in an advanced mode cannot be changed to an advanced mode, however other players may choose to enable this setting and use an advanced mode.

@ -1620,6 +1620,7 @@ static SettingsContainer &GetSettingsTree()
interface->Add(new SettingEntry("gui.disable_top_veh_list_mass_actions"));
interface->Add(new SettingEntry("gui.adv_sig_bridge_tun_modes"));
interface->Add(new SettingEntry("gui.show_depot_sell_gui"));
interface->Add(new SettingEntry("gui.open_vehicle_gui_clone_share"));
}
SettingsPage *advisors = main->Add(new SettingsPage(STR_CONFIG_SETTING_ADVISORS));

@ -194,6 +194,7 @@ struct GUISettings {
bool disable_top_veh_list_mass_actions; ///< disable mass actions buttons for non-group vehicle lists
bool adv_sig_bridge_tun_modes; ///< Enable advanced modes for signals on bridges/tunnels.
bool show_depot_sell_gui; ///< Show go to depot and sell in UI
bool open_vehicle_gui_clone_share; ///< Open vehicle GUI when share-cloning vehicle from depot GUI
uint16 console_backlog_timeout; ///< the minimum amount of time items should be in the console backlog before they will be removed in ~3 seconds granularity.
uint16 console_backlog_length; ///< the minimum amount of items in the console backlog before items will be removed.

@ -4300,6 +4300,14 @@ str = STR_CONFIG_SETTING_SHOW_DEPOT_SELL_GUI
strhelp = STR_CONFIG_SETTING_SHOW_DEPOT_SELL_GUI_HELPTEXT
cat = SC_EXPERT
[SDTC_BOOL]
var = gui.open_vehicle_gui_clone_share
flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
def = false
str = STR_CONFIG_SETTING_OPEN_VEHICLE_GUI_CLONE_SHARE
strhelp = STR_CONFIG_SETTING_OPEN_VEHICLE_GUI_CLONE_SHARE_HELPTEXT
cat = SC_EXPERT
; For the dedicated build we'll enable dates in logs by default.
[SDTC_BOOL]
ifdef = DEDICATED

Loading…
Cancel
Save