Feature: Separate rail/road and sea/air velocity units, and add knots. (#10594)
This is achieved by packing vehicle type along with the velocity so that the string system can decode and pick the appropriate unit.
This commit is contained in:
@@ -408,7 +408,7 @@ struct TimetableWindow : Window {
|
||||
string = order->GetMaxSpeed() != UINT16_MAX ?
|
||||
STR_TIMETABLE_TRAVEL_FOR_SPEED : STR_TIMETABLE_TRAVEL_FOR;
|
||||
}
|
||||
SetDParam(2, order->GetMaxSpeed());
|
||||
SetDParam(2, PackVelocity(order->GetMaxSpeed(), v->type));
|
||||
|
||||
DrawString(rtl ? tr.left : middle, rtl ? middle : tr.right, tr.top, string, colour);
|
||||
|
||||
@@ -568,7 +568,7 @@ struct TimetableWindow : Window {
|
||||
const Order *order = v->GetOrder(real);
|
||||
if (order != nullptr) {
|
||||
if (order->GetMaxSpeed() != UINT16_MAX) {
|
||||
SetDParam(0, ConvertKmhishSpeedToDisplaySpeed(order->GetMaxSpeed()));
|
||||
SetDParam(0, ConvertKmhishSpeedToDisplaySpeed(order->GetMaxSpeed(), v->type));
|
||||
current = STR_JUST_INT;
|
||||
}
|
||||
}
|
||||
@@ -628,7 +628,7 @@ struct TimetableWindow : Window {
|
||||
|
||||
uint64 val = StrEmpty(str) ? 0 : strtoul(str, nullptr, 10);
|
||||
if (this->query_is_speed_query) {
|
||||
val = ConvertDisplaySpeedToKmhishSpeed(val);
|
||||
val = ConvertDisplaySpeedToKmhishSpeed(val, v->type);
|
||||
} else {
|
||||
if (!_settings_client.gui.timetable_in_ticks) val *= DAY_TICKS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user