Add setting for whether non-leading train engines keep custom names
This commit is contained in:
@@ -201,6 +201,9 @@ STR_CONFIG_SETTING_THROUGH_LOAD_SPEED_LIMIT_HELPTEXT :The maximum per
|
||||
STR_CONFIG_SETTING_RAIL_DEPOT_SPEED_LIMIT :Rail depot maximum speed: {STRING2}
|
||||
STR_CONFIG_SETTING_RAIL_DEPOT_SPEED_LIMIT_HELPTEXT :The maximum permitted speed for trains when entering or exiting a rail depot
|
||||
|
||||
STR_CONFIG_SETTING_NON_LEADING_ENGINES_KEEP_NAME :Non-leading train engines keep custom names: {STRING2}
|
||||
STR_CONFIG_SETTING_NON_LEADING_ENGINES_KEEP_NAME_HELPTEXT :Whether train engines with a custom name should keep their custom name when moved to a non-leading position in a train consist
|
||||
|
||||
STR_CONFIG_SETTING_BACK_ONE_WAY_PBS_SAFE_WAITING :Pathfind up to back of one-way path signals: {STRING2}
|
||||
STR_CONFIG_SETTING_BACK_ONE_WAY_PBS_SAFE_WAITING_HELPTEXT :When enabled, the YAPF train pathfinder may pathfind up to the back of a one-way path signal.
|
||||
|
||||
|
@@ -2267,6 +2267,7 @@ static SettingsContainer &GetSettingsTree()
|
||||
vehicles->Add(new SettingEntry("order.nonstop_only"));
|
||||
vehicles->Add(new SettingEntry("vehicle.adjacent_crossings"));
|
||||
vehicles->Add(new SettingEntry("vehicle.safer_crossings"));
|
||||
vehicles->Add(new SettingEntry("vehicle.non_leading_engines_keep_name"));
|
||||
}
|
||||
|
||||
SettingsPage *limitations = main->Add(new SettingsPage(STR_CONFIG_SETTING_LIMITATIONS));
|
||||
|
@@ -677,6 +677,7 @@ struct VehicleSettings {
|
||||
bool drive_through_train_depot; ///< enable drive-through train depot emulation
|
||||
uint16 through_load_speed_limit; ///< maximum speed for through load
|
||||
uint16 rail_depot_speed_limit; ///< maximum speed entering/existing rail depots
|
||||
bool non_leading_engines_keep_name; ///< allow engines moved to a non-leading position to retain their custom name
|
||||
};
|
||||
|
||||
/** Settings related to the economy. */
|
||||
|
@@ -1503,6 +1503,14 @@ strval = STR_JUST_VELOCITY
|
||||
cat = SC_EXPERT
|
||||
patxname = ""vehicle.rail_depot_speed_limit""
|
||||
|
||||
[SDT_BOOL]
|
||||
var = vehicle.non_leading_engines_keep_name
|
||||
def = false
|
||||
str = STR_CONFIG_SETTING_NON_LEADING_ENGINES_KEEP_NAME
|
||||
strhelp = STR_CONFIG_SETTING_NON_LEADING_ENGINES_KEEP_NAME_HELPTEXT
|
||||
cat = SC_ADVANCED
|
||||
patxname = ""vehicle.non_leading_engines_keep_name""
|
||||
|
||||
[SDT_BOOL]
|
||||
var = pf.forbid_90_deg
|
||||
def = true
|
||||
|
@@ -2219,7 +2219,9 @@ CommandCost CmdMoveRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, u
|
||||
/* Remove stuff not valid anymore for non-front engines. */
|
||||
DeleteVehicleOrders(src);
|
||||
src->unitnumber = 0;
|
||||
if (!_settings_game.vehicle.non_leading_engines_keep_name) {
|
||||
src->name.clear();
|
||||
}
|
||||
if (HasBit(src->vehicle_flags, VF_HAVE_SLOT)) {
|
||||
TraceRestrictRemoveVehicleFromAllSlots(src->index);
|
||||
ClrBit(src->vehicle_flags, VF_HAVE_SLOT);
|
||||
|
Reference in New Issue
Block a user