Changeset - r24606:4f53a76a2ce0
[Not reviewed]
master
0 2 0
Patric Stout - 4 years ago 2021-01-08 15:04:44
truebrain@openttd.org
Fix #7972: show invalid orders to stations that don't accept your vehicle (#8516)

Before it was shown as a normal order, but the vehicle was skipping
it. This was rather unclear to the user. Now it is red and contains
text with some hints what is going on.

The text is prefixed rather than post-fixed, as we have many
post-fixes already.
2 files changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -4021,6 +4021,7 @@ STR_ORDER_REFIT_STOP_ORDER              
 
STR_ORDER_STOP_ORDER                                            :(Stop)
 

	
 
STR_ORDER_GO_TO_STATION                                         :{STRING} {STATION} {STRING1}
 
STR_ORDER_GO_TO_STATION_CAN_T_USE_STATION                       :{PUSH_COLOUR}{RED}(Can't use station){POP_COLOUR} {STRING} {STATION} {STRING1}
 

	
 
STR_ORDER_IMPLICIT                                              :(Implicit)
 

	
src/order_gui.cpp
Show inline comments
 
@@ -28,6 +28,7 @@
 
#include "hotkeys.h"
 
#include "aircraft.h"
 
#include "engine_func.h"
 
#include "vehicle_func.h"
 

	
 
#include "widgets/order_widget.h"
 

	
 
@@ -258,8 +259,9 @@ void DrawOrderString(const Vehicle *v, c
 
		case OT_GOTO_STATION: {
 
			OrderLoadFlags load = order->GetLoadType();
 
			OrderUnloadFlags unload = order->GetUnloadType();
 
			bool valid_station = CanVehicleUseStation(v, Station::Get(order->GetDestination()));
 

	
 
			SetDParam(0, STR_ORDER_GO_TO_STATION);
 
			SetDParam(0, valid_station ? STR_ORDER_GO_TO_STATION : STR_ORDER_GO_TO_STATION_CAN_T_USE_STATION);
 
			SetDParam(1, STR_ORDER_GO_TO + (v->IsGroundVehicle() ? order->GetNonStopType() : 0));
 
			SetDParam(2, order->GetDestination());
 

	
0 comments (0 inline, 0 general)