Changeset - r28785:6d8519a18fd4
[Not reviewed]
master
0 3 0
Tyler Trahan - 10 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
 
@@ -4613,7 +4613,7 @@ STR_ORDER_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
 

	
src/order_cmd.cpp
Show inline comments
 
@@ -818,7 +818,7 @@ 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;
 
		}
src/order_gui.cpp
Show inline comments
 
@@ -398,8 +398,17 @@ static Order GetOrderCmdFromTile(const V
 
				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;
 
	}
 

	
0 comments (0 inline, 0 general)