Change: Only show platform stopping location in orders when other than default (#11102)

pull/603/merge
Tyler Trahan 11 months ago committed by GitHub
parent 536d2cb75b
commit f57296a033
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1383,7 +1383,7 @@ STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT :New orders are
STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT_HELPTEXT :Normally, a vehicle will stop at every station it passes. By enabling this setting, it will drive through all station on the way to its final destination without stopping. Note, that this setting only defines a default value for new orders. Individual orders can be set explicitly to either behaviour nevertheless
STR_CONFIG_SETTING_STOP_LOCATION :New train orders stop by default at the {STRING2} of the platform
STR_CONFIG_SETTING_STOP_LOCATION_HELPTEXT :Place where a train will stop at the platform by default. The 'near end' means close to the entry point, 'middle' means in the middle of the platform, and 'far end' means far away from the entry point. Note, that this setting only defines a default value for new orders. Individual orders can be set explicitly to either behaviour nevertheless
STR_CONFIG_SETTING_STOP_LOCATION_HELPTEXT :Place where a train will stop at the platform by default. The 'near end' means close to the entry point, 'middle' means in the middle of the platform, and 'far end' means far away from the entry point. Note, that this setting only defines a default value for new orders. Individual orders can have their stop location set by clicking on the order text
###length 3
STR_CONFIG_SETTING_STOP_LOCATION_NEAR_END :near end
STR_CONFIG_SETTING_STOP_LOCATION_MIDDLE :middle

@ -287,7 +287,12 @@ void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int
SetDParam(4, order->IsAutoRefit() ? STR_ORDER_AUTO_REFIT_ANY : CargoSpec::Get(order->GetRefitCargo())->name);
}
if (v->type == VEH_TRAIN && (order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION) == 0) {
SetDParam(5, order->GetStopLocation() + STR_ORDER_STOP_LOCATION_NEAR_END);
/* Only show the stopping location if other than the default chosen by the player. */
if (order->GetStopLocation() != (OrderStopLocation)(_settings_client.gui.stop_location)) {
SetDParam(5, order->GetStopLocation() + STR_ORDER_STOP_LOCATION_NEAR_END);
} else {
SetDParam(5, STR_EMPTY);
}
}
}
break;

@ -600,6 +600,7 @@ interval = 1
str = STR_CONFIG_SETTING_STOP_LOCATION
strhelp = STR_CONFIG_SETTING_STOP_LOCATION_HELPTEXT
strval = STR_CONFIG_SETTING_STOP_LOCATION_NEAR_END
post_cb = [](auto) { SetWindowClassesDirty(WC_VEHICLE_ORDERS); }
cat = SC_BASIC
[SDTC_BOOL]

Loading…
Cancel
Save