mirror of https://github.com/OpenTTD/OpenTTD
(svn r17557) -Codechange: Pass left and right edge to DrawOrderString().
parent
893f1282cb
commit
24e9ee8ab4
|
@ -47,7 +47,7 @@ bool ProcessOrders(Vehicle *v);
|
||||||
bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth = 0);
|
bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth = 0);
|
||||||
VehicleOrderID ProcessConditionalOrder(const Order *order, const Vehicle *v);
|
VehicleOrderID ProcessConditionalOrder(const Order *order, const Vehicle *v);
|
||||||
|
|
||||||
void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int y, bool selected, bool timetable, int width);
|
void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int y, bool selected, bool timetable, int left, int right);
|
||||||
|
|
||||||
#define MIN_SERVINT_PERCENT 5
|
#define MIN_SERVINT_PERCENT 5
|
||||||
#define MAX_SERVINT_PERCENT 90
|
#define MAX_SERVINT_PERCENT 90
|
||||||
|
|
|
@ -183,7 +183,7 @@ static int DepotActionStringIndex(const Order *order)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int y, bool selected, bool timetable, int width)
|
void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int y, bool selected, bool timetable, int left, int right)
|
||||||
{
|
{
|
||||||
StringID str = (v->cur_order_index == order_index) ? STR_ORDER_SELECTED : STR_ORDER;
|
StringID str = (v->cur_order_index == order_index) ? STR_ORDER_SELECTED : STR_ORDER;
|
||||||
SetDParam(6, STR_EMPTY);
|
SetDParam(6, STR_EMPTY);
|
||||||
|
@ -287,7 +287,7 @@ void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int
|
||||||
}
|
}
|
||||||
|
|
||||||
SetDParam(0, order_index + 1);
|
SetDParam(0, order_index + 1);
|
||||||
DrawString(2, width + 2, y, str, selected ? TC_WHITE : TC_BLACK);
|
DrawString(left, right, y, str, selected ? TC_WHITE : TC_BLACK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -842,7 +842,7 @@ public:
|
||||||
/* Don't draw anything if it extends past the end of the window. */
|
/* Don't draw anything if it extends past the end of the window. */
|
||||||
if (!this->vscroll.IsVisible(i)) break;
|
if (!this->vscroll.IsVisible(i)) break;
|
||||||
|
|
||||||
DrawOrderString(this->vehicle, order, i, y, i == this->selected_order, false, this->widget[ORDER_WIDGET_ORDER_LIST].right - 4);
|
DrawOrderString(this->vehicle, order, i, y, i == this->selected_order, false, this->widget[ORDER_WIDGET_ORDER_LIST].left + 2, this->widget[ORDER_WIDGET_ORDER_LIST].right - 2);
|
||||||
y += ORDER_LIST_LINE_HEIGHT;
|
y += ORDER_LIST_LINE_HEIGHT;
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
|
|
|
@ -190,7 +190,7 @@ struct TimetableWindow : Window {
|
||||||
if (!this->vscroll.IsVisible(i)) break;
|
if (!this->vscroll.IsVisible(i)) break;
|
||||||
|
|
||||||
if (i % 2 == 0) {
|
if (i % 2 == 0) {
|
||||||
DrawOrderString(v, order, order_id, y, i == selected, true, this->widget[TTV_TIMETABLE_PANEL].right - 4);
|
DrawOrderString(v, order, order_id, y, i == selected, true, this->widget[TTV_TIMETABLE_PANEL].left + 2, this->widget[TTV_TIMETABLE_PANEL].right - 2);
|
||||||
|
|
||||||
order_id++;
|
order_id++;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue