diff options
author | bjarni <bjarni@openttd.org> | 2006-08-29 21:36:39 +0000 |
---|---|---|
committer | bjarni <bjarni@openttd.org> | 2006-08-29 21:36:39 +0000 |
commit | a73b07561e30e45ba94504d6e7c47cf157ab07c8 (patch) | |
tree | 234611243d183da14e1c25351ed48affa3a67365 /train_gui.c | |
parent | c595c0e6517ed715a88170b3a1a6e606fa39c721 (diff) | |
download | openttd-a73b07561e30e45ba94504d6e7c47cf157ab07c8.tar.xz |
(svn r6227) -Codechange: added window type flags to use with PlayerVehWndProc
this makes the list type detection much easier and allowed an if cascade to be turned into a switch case
this also makes it easier to add more list types
Diffstat (limited to 'train_gui.c')
-rw-r--r-- | train_gui.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/train_gui.c b/train_gui.c index 2aef94fc6..f09feb623 100644 --- a/train_gui.c +++ b/train_gui.c @@ -1425,14 +1425,16 @@ static void ShowPlayerTrainsLocal(PlayerID player, StationID station, OrderID or Window *w; if (show_shared) { - w = AllocateWindowDescFront(&_player_trains_desc, (order << 16) | (VEH_Train << 11) | SHARE_FLAG); + w = AllocateWindowDescFront(&_player_trains_desc, (order << 16) | (VEH_Train << 11) | VLW_SHARED_ORDERS); } else { + uint16 VLW_flag = (station == INVALID_STATION) ? VLW_STANDARD : VLW_STATION_LIST; if (player == _local_player) { - w = AllocateWindowDescFront(&_player_trains_desc, (station << 16) | (VEH_Train << 11) | player); - } else { - w = AllocateWindowDescFront(&_other_player_trains_desc, (station << 16) | (VEH_Train << 11) | player); + w = AllocateWindowDescFront(&_player_trains_desc, (station << 16) | (VEH_Train << 11) | VLW_flag | player); + } else { + w = AllocateWindowDescFront(&_other_player_trains_desc, (station << 16) | (VEH_Train << 11) | VLW_flag | player); } } + if (w != NULL) { vehiclelist_d *vl = &WP(w, vehiclelist_d); vl->flags = VL_REBUILD | (_sorting.train.order << (VL_DESC - 1)); |