diff --git a/src/lang/english.txt b/src/lang/english.txt index 420dc45..78a138b 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -3501,7 +3501,7 @@ STR_ORDERS_TIMETABLE_VIEW_TOOLTIP :{BLACK}Switch t STR_ORDERS_LIST_TOOLTIP :{BLACK}Order list - click on an order to highlight it. Ctrl+Click scrolls to the order's destination STR_ORDER_INDEX :{COMMA}:{NBSP} -STR_ORDER_TEXT :{STRING4} {STRING2} {STRING} +STR_ORDER_TEXT :{STRING4} {STRING2} {STRING1} STR_ORDERS_END_OF_ORDERS :- - End of Orders - - STR_ORDERS_END_OF_SHARED_ORDERS :- - End of Shared Orders - - @@ -3642,6 +3642,7 @@ STR_ORDER_STOP_LOCATION_MIDDLE :[middle] STR_ORDER_STOP_LOCATION_FAR_END :[far end] STR_ORDER_OUT_OF_RANGE :{RED} (Next destination is out of range) +STR_ORDER_RANGE_BRACKETS :({NUM} tiles) STR_ORDER_CONDITIONAL_UNCONDITIONAL :Jump to order {COMMA} STR_ORDER_CONDITIONAL_NUM :Jump to order {COMMA} when {STRING} {STRING} {COMMA} diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 965ba48..6c574ba 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -28,6 +28,7 @@ #include "core/geometry_func.hpp" #include "hotkeys.h" #include "aircraft.h" +#include #include "widgets/order_widget.h" @@ -232,11 +233,19 @@ void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int SetDParam(5, STR_EMPTY); SetDParam(8, STR_EMPTY); + SetDParam(9, STR_EMPTY); /* Check range for aircraft. */ if (v->type == VEH_AIRCRAFT && Aircraft::From(v)->GetRange() > 0 && order->IsGotoOrder()) { const Order *next = order->next != NULL ? order->next : v->GetFirstOrder(); - if (GetOrderDistance(order, next, v) > Aircraft::From(v)->acache.cached_max_range_sqr) SetDParam(8, STR_ORDER_OUT_OF_RANGE); + + uint distance_sqr = GetOrderDistance(order, next, v); + if (distance_sqr > Aircraft::From(v)->acache.cached_max_range_sqr) SetDParam(8, STR_ORDER_OUT_OF_RANGE); + else { + uint distance = std::ceil(std::sqrt(distance_sqr)); + SetDParam(8, STR_ORDER_RANGE_BRACKETS); + SetDParam(9, distance); + } } switch (order->GetType()) {