From bae2936491e4bc39b45d24db0e9934426ea93be1 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Fri, 8 Dec 2023 20:55:57 +0000 Subject: [PATCH] Routing restrictions: Slots are no longer considered "advanced" --- src/order_gui.cpp | 3 +-- src/tracerestrict_gui.cpp | 17 ++++++++--------- src/vehicle_gui.cpp | 4 ++-- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 03f9d0c462..99968541aa 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -3006,8 +3006,7 @@ public: continue; } if (ocv != _order_conditional_variable[i]) { - if ((_order_conditional_variable[i] == OCV_VEH_IN_SLOT || _order_conditional_variable[i] == OCV_SLOT_OCCUPANCY || - _order_conditional_variable[i] == OCV_COUNTER_VALUE) && !_settings_client.gui.show_adv_tracerestrict_features) { + if (_order_conditional_variable[i] == OCV_COUNTER_VALUE && !_settings_client.gui.show_adv_tracerestrict_features) { continue; } if ((_order_conditional_variable[i] == OCV_DISPATCH_SLOT) && this->vehicle->orders->GetScheduledDispatchScheduleCount() == 0) { diff --git a/src/tracerestrict_gui.cpp b/src/tracerestrict_gui.cpp index d15cb15199..d8ac7a566a 100644 --- a/src/tracerestrict_gui.cpp +++ b/src/tracerestrict_gui.cpp @@ -162,8 +162,8 @@ static const StringID _program_insert_str[] = { STR_TRACE_RESTRICT_PF_PENALTY, STR_TRACE_RESTRICT_RESERVE_THROUGH, STR_TRACE_RESTRICT_LONG_RESERVE, - STR_TRACE_RESTRICT_WAIT_AT_PBS, STR_TRACE_RESTRICT_SLOT_OP, + STR_TRACE_RESTRICT_WAIT_AT_PBS, STR_TRACE_RESTRICT_REVERSE, STR_TRACE_RESTRICT_SPEED_RESTRICTION, STR_TRACE_RESTRICT_NEWS_CONTROL, @@ -176,8 +176,7 @@ static const StringID _program_insert_str[] = { static const uint32 _program_insert_else_hide_mask = 8; ///< disable bitmask for else static const uint32 _program_insert_or_if_hide_mask = 4; ///< disable bitmask for orif static const uint32 _program_insert_else_if_hide_mask = 2; ///< disable bitmask for elif -static const uint32 _program_wait_pbs_hide_mask = 0x100; ///< disable bitmask for wait at PBS -static const uint32 _program_slot_hide_mask = 0x200; ///< disable bitmask for slot +static const uint32 _program_wait_pbs_hide_mask = 0x200; ///< disable bitmask for wait at PBS static const uint32 _program_reverse_hide_mask = 0x400; ///< disable bitmask for reverse static const uint32 _program_speed_res_hide_mask = 0x800; ///< disable bitmask for speed restriction static const uint32 _program_counter_hide_mask = 0x2000; ///< disable bitmask for counter @@ -193,8 +192,8 @@ static const uint _program_insert_val[] = { TRIT_PF_PENALTY, // penalty TRIT_RESERVE_THROUGH, // reserve through TRIT_LONG_RESERVE, // long reserve - TRIT_WAIT_AT_PBS, // wait at PBS signal TRIT_SLOT, // slot operation + TRIT_WAIT_AT_PBS, // wait at PBS signal TRIT_REVERSE, // reverse TRIT_SPEED_RESTRICTION, // speed restriction TRIT_NEWS_CONTROL, // news control @@ -559,8 +558,8 @@ static span GetTypeDropDownListItems(TraceR { TRIT_RESERVE_THROUGH, STR_TRACE_RESTRICT_RESERVE_THROUGH, TRDDLIF_NONE }, { TRIT_LONG_RESERVE, STR_TRACE_RESTRICT_LONG_RESERVE, TRDDLIF_NONE }, { TRIT_NEWS_CONTROL, STR_TRACE_RESTRICT_NEWS_CONTROL, TRDDLIF_NONE }, + { TRIT_SLOT, STR_TRACE_RESTRICT_SLOT_OP, TRDDLIF_NONE }, { TRIT_WAIT_AT_PBS, STR_TRACE_RESTRICT_WAIT_AT_PBS, TRDDLIF_ADVANCED }, - { TRIT_SLOT, STR_TRACE_RESTRICT_SLOT_OP, TRDDLIF_ADVANCED }, { TRIT_REVERSE, STR_TRACE_RESTRICT_REVERSE, TRDDLIF_ADVANCED }, { TRIT_SPEED_RESTRICTION, STR_TRACE_RESTRICT_SPEED_RESTRICTION, TRDDLIF_ADVANCED }, { TRIT_COUNTER, STR_TRACE_RESTRICT_COUNTER_OP, TRDDLIF_ADVANCED }, @@ -589,9 +588,9 @@ static span GetTypeDropDownListItems(TraceR { TRIT_COND_PHYS_RATIO | (TRPPRCAF_MAX_TE_WEIGHT << 16), STR_TRACE_RESTRICT_VARIABLE_TRAIN_MAX_TE_WEIGHT_RATIO, TRDDLIF_NONE }, { TRIT_COND_CATEGORY | (TRCCAF_ENGINE_CLASS << 16), STR_TRACE_RESTRICT_VARIABLE_TRAIN_ENGINE_CLASS, TRDDLIF_NONE }, { TRIT_COND_TARGET_DIRECTION, STR_TRACE_RESTRICT_VARIABLE_ORDER_TARGET_DIRECTION, TRDDLIF_NONE }, - { TRIT_COND_TRAIN_IN_SLOT, STR_TRACE_RESTRICT_VARIABLE_TRAIN_SLOT, TRDDLIF_ADVANCED }, - { TRIT_COND_SLOT_OCCUPANCY | (TRSOCAF_OCCUPANTS << 16), STR_TRACE_RESTRICT_VARIABLE_SLOT_OCCUPANCY, TRDDLIF_ADVANCED }, - { TRIT_COND_SLOT_OCCUPANCY | (TRSOCAF_REMAINING << 16), STR_TRACE_RESTRICT_VARIABLE_SLOT_OCCUPANCY_REMAINING, TRDDLIF_ADVANCED }, + { TRIT_COND_TRAIN_IN_SLOT, STR_TRACE_RESTRICT_VARIABLE_TRAIN_SLOT, TRDDLIF_NONE }, + { TRIT_COND_SLOT_OCCUPANCY | (TRSOCAF_OCCUPANTS << 16), STR_TRACE_RESTRICT_VARIABLE_SLOT_OCCUPANCY, TRDDLIF_NONE }, + { TRIT_COND_SLOT_OCCUPANCY | (TRSOCAF_REMAINING << 16), STR_TRACE_RESTRICT_VARIABLE_SLOT_OCCUPANCY_REMAINING, TRDDLIF_NONE }, { TRIT_COND_COUNTER_VALUE, STR_TRACE_RESTRICT_VARIABLE_COUNTER_VALUE, TRDDLIF_ADVANCED }, { TRIT_COND_TIME_DATE_VALUE, STR_TRACE_RESTRICT_VARIABLE_TIME_DATE_VALUE, TRDDLIF_ADVANCED }, { TRIT_COND_RESERVED_TILES, STR_TRACE_RESTRICT_VARIABLE_RESERVED_TILES_AHEAD, TRDDLIF_ADVANCED | TRDDLIF_REALISTIC_BRAKING }, @@ -1894,7 +1893,7 @@ public: } } if (!_settings_client.gui.show_adv_tracerestrict_features) { - hidden |= _program_slot_hide_mask | _program_wait_pbs_hide_mask | _program_reverse_hide_mask | + hidden |= _program_wait_pbs_hide_mask | _program_reverse_hide_mask | _program_speed_res_hide_mask | _program_counter_hide_mask | _program_penalty_adj_hide_mask; } if (!_settings_client.gui.show_adv_tracerestrict_features || !_settings_game.vehicle.train_speed_adaptation) { diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index aab806cf12..ca62ac4f8f 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -402,7 +402,7 @@ void BaseVehicleListWindow::OnInit() */ bool BaseVehicleListWindow::ShouldShowActionDropdownList() const { - return this->own_vehicles != 0 || (this->vli.vtype == VEH_TRAIN && _settings_client.gui.show_adv_tracerestrict_features); + return true; } /** @@ -431,8 +431,8 @@ DropDownList BaseVehicleListWindow::BuildActionDropdownList(bool show_autoreplac list.push_back(std::make_unique(STR_GROUP_ADD_SHARED_VEHICLE, ADI_ADD_SHARED, disable)); list.push_back(std::make_unique(STR_GROUP_REMOVE_ALL_VEHICLES, ADI_REMOVE_ALL, disable)); } + list.push_back(std::make_unique(STR_TRACE_RESTRICT_SLOT_MANAGE, ADI_TRACERESTRICT_SLOT_MGMT, false)); if (_settings_client.gui.show_adv_tracerestrict_features) { - list.push_back(std::make_unique(STR_TRACE_RESTRICT_SLOT_MANAGE, ADI_TRACERESTRICT_SLOT_MGMT, false)); list.push_back(std::make_unique(STR_TRACE_RESTRICT_COUNTER_MANAGE, ADI_TRACERESTRICT_COUNTER_MGMT, false)); } if (change_order_str != 0) {