diff options
author | rubidium <rubidium@openttd.org> | 2008-07-14 20:18:06 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-07-14 20:18:06 +0000 |
commit | 91e317cd1cadb520e0f87188ca4dbabbb8abbc6d (patch) | |
tree | 8bbc36fdfa2142e3d60c0dafd51136970dc379da /src/order_gui.cpp | |
parent | d9d32d3619e97861cc48c17427d20a4a57f52438 (diff) | |
download | openttd-91e317cd1cadb520e0f87188ca4dbabbb8abbc6d.tar.xz |
(svn r13702) -Fix: do not overflow the order/timetable window when 'long' orders are displayed.
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r-- | src/order_gui.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp index ca28ffb9a..c2ed05d8a 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -162,7 +162,7 @@ extern uint ConvertSpeedToDisplaySpeed(uint speed); extern uint ConvertDisplaySpeedToSpeed(uint speed); -void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int y, bool selected, bool timetable) +void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int y, bool selected, bool timetable, int width) { StringID str = (v->cur_order_index == order_index) ? STR_8805 : STR_8804; SetDParam(6, STR_EMPTY); @@ -257,7 +257,7 @@ void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int } SetDParam(0, order_index + 1); - DrawString(2, y, str, selected ? TC_WHITE : TC_BLACK); + DrawStringTruncated(2, y, str, selected ? TC_WHITE : TC_BLACK, width); } @@ -734,7 +734,7 @@ public: /* Don't draw anything if it extends past the end of the window. */ if (i - this->vscroll.pos >= this->vscroll.cap) break; - DrawOrderString(this->vehicle, order, i, y, i == this->selected_order, false); + DrawOrderString(this->vehicle, order, i, y, i == this->selected_order, false, this->widget[ORDER_WIDGET_ORDER_LIST].right - 4); y += 10; i++; |