From d275109e79c191dde34b71f07e5a39cfeb11fba7 Mon Sep 17 00:00:00 2001 From: truelight Date: Sat, 15 Jan 2005 19:06:22 +0000 Subject: (svn r1525) -Codechange: rewrote the _order_array, now it can be made dynamic. -Codechange: renamed all 'schedule' stuff to 'order(list)' -Codechange: moved all order-stuff to order_cmd.c / order.h -Codechange: vehicles that share orders are now linked to eachother with next_shared/prev_shared in Vehicle Developers: please use AssignOrder to assign data to an order. If not, you _WILL_ make the save-routine to assert! --- ship_gui.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'ship_gui.c') diff --git a/ship_gui.c b/ship_gui.c index f7c54a10f..92b6cffd0 100644 --- a/ship_gui.c +++ b/ship_gui.c @@ -863,15 +863,14 @@ void ShowShipDepotWindow(uint tile) } -static void DrawSmallShipSchedule(Vehicle *v, int x, int y) { - Order *sched; - int sel; - Station *st; - int i = 0; +static void DrawSmallOrderList(Vehicle *v, int x, int y) { + const Order *order; + int sel, i = 0; sel = v->cur_order_index; + order = v->orders; - for (sched = v->schedule_ptr; sched->type != OT_NOTHING; ++sched) { + while (order != NULL) { if (sel == 0) { _stringwidth_base = 0xE0; DoDrawString( "\xAF", x-6, y, 16); @@ -879,11 +878,9 @@ static void DrawSmallShipSchedule(Vehicle *v, int x, int y) { } sel--; - if (sched->type == OT_GOTO_STATION) { - st = GetStation(sched->station); - - if (!(st->had_vehicle_of_type & HVOT_BUOY)) { - SetDParam(0, sched->station); + if (order->type == OT_GOTO_STATION) { + if (!(GetStation(order->station)->had_vehicle_of_type & HVOT_BUOY)) { + SetDParam(0, order->station); DrawString(x, y, STR_A036, 0); y += 6; @@ -891,6 +888,8 @@ static void DrawSmallShipSchedule(Vehicle *v, int x, int y) { break; } } + + order = order->next; } } @@ -998,7 +997,7 @@ static void PlayerShipsWndProc(Window *w, WindowEvent *e) DrawString(x + 12, y, STR_01AB, 0); } - DrawSmallShipSchedule(v, x + 138, y); + DrawSmallOrderList(v, x + 138, y); y += PLY_WND_PRC__SIZE_OF_ROW_BIG; } -- cgit v1.2.3-54-g00ecf