Changeset - r28785:6d8519a18fd4
[Not reviewed]
master
0 3 0
Tyler Trahan - 2 months ago 2024-02-18 15:43:44
tyler@tylertrahan.com
Change: When adding orders, Ctrl+Click on a depot to unbunch, instead of service if required (#12023)
3 files changed with 13 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -4610,13 +4610,13 @@ STR_ORDERS_STOP_SHARING_TOOLTIP         
 

	
 
STR_ORDERS_GO_TO_BUTTON                                         :{BLACK}Go To
 
STR_ORDER_GO_TO_NEAREST_DEPOT                                   :Go to nearest depot
 
STR_ORDER_GO_TO_NEAREST_HANGAR                                  :Go to nearest hangar
 
STR_ORDER_CONDITIONAL                                           :Conditional order jump
 
STR_ORDER_SHARE                                                 :Share orders
 
STR_ORDERS_GO_TO_TOOLTIP                                        :{BLACK}Insert a new order before the highlighted order, or add to end of list. Ctrl+Click on a station for 'full load any cargo', on a waypoint to invert the 'non-stop by default' setting, or on a depot for 'service'. Click on another vehicle to copy its orders or Ctrl+Click to share orders. A depot order disables automatic servicing of the vehicle
 
STR_ORDERS_GO_TO_TOOLTIP                                        :{BLACK}Insert a new order before the highlighted order, or add to end of list. Ctrl+Click on a station for 'full load any cargo', on a waypoint to invert the 'non-stop by default' setting, or on a depot for 'unbunch'. Click on another vehicle to copy its orders or Ctrl+Click to share orders. A depot order disables automatic servicing of the vehicle
 

	
 
STR_ORDERS_VEH_WITH_SHARED_ORDERS_LIST_TOOLTIP                  :{BLACK}Show all vehicles that share this schedule
 

	
 
# String parts to build the order string
 
STR_ORDER_GO_TO_WAYPOINT                                        :Go via {WAYPOINT}
 
STR_ORDER_GO_NON_STOP_TO_WAYPOINT                               :Go non-stop via {WAYPOINT}
src/order_cmd.cpp
Show inline comments
 
@@ -815,13 +815,13 @@ CommandCost CmdInsertOrder(DoCommandFlag
 
					}
 
				}
 
			}
 

	
 
			if (new_order.GetNonStopType() != ONSF_STOP_EVERYWHERE && !v->IsGroundVehicle()) return CMD_ERROR;
 
			if (new_order.GetDepotOrderType() & ~(ODTFB_PART_OF_ORDERS | ((new_order.GetDepotOrderType() & ODTFB_PART_OF_ORDERS) != 0 ? ODTFB_SERVICE : 0))) return CMD_ERROR;
 
			if (new_order.GetDepotActionType() & ~(ODATFB_HALT | ODATFB_NEAREST_DEPOT)) return CMD_ERROR;
 
			if (new_order.GetDepotActionType() & ~(ODATFB_HALT | ODATFB_NEAREST_DEPOT | ODATFB_UNBUNCH)) return CMD_ERROR;
 
			if ((new_order.GetDepotOrderType() & ODTFB_SERVICE) && (new_order.GetDepotActionType() & ODATFB_HALT)) return CMD_ERROR;
 
			break;
 
		}
 

	
 
		case OT_GOTO_WAYPOINT: {
 
			const Waypoint *wp = Waypoint::GetIfValid(new_order.GetDestination());
src/order_gui.cpp
Show inline comments
 
@@ -395,14 +395,23 @@ static Order GetOrderCmdFromTile(const V
 
	/* check depot first */
 
	if (IsDepotTypeTile(tile, (TransportType)(uint)v->type) && IsTileOwner(tile, _local_company)) {
 
		order.MakeGoToDepot(v->type == VEH_AIRCRAFT ? GetStationIndex(tile) : GetDepotIndex(tile),
 
				ODTFB_PART_OF_ORDERS,
 
				(_settings_client.gui.new_nonstop && v->IsGroundVehicle()) ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE);
 

	
 
		if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE));
 

	
 
		if (_ctrl_pressed) {
 
			/* Don't allow a new unbunching order if we already have one. */
 
			if (v->HasUnbunchingOrder()) {
 
				ShowErrorMessage(STR_ERROR_CAN_T_INSERT_NEW_ORDER, STR_ERROR_UNBUNCHING_ONLY_ONE_ALLOWED, WL_ERROR);
 
				/* Return an empty order to bail out. */
 
				order.Free();
 
				return order;
 
			} else {
 
				order.SetDepotActionType(ODATFB_UNBUNCH);
 
			}
 
		}
 
		return order;
 
	}
 

	
 
	/* check rail waypoint */
 
	if (IsRailWaypointTile(tile) &&
 
			v->type == VEH_TRAIN &&
0 comments (0 inline, 0 general)