summaryrefslogtreecommitdiff
path: root/roadveh_gui.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-08-29 21:36:39 +0000
committerbjarni <bjarni@openttd.org>2006-08-29 21:36:39 +0000
commitc820704f11daaba961380aee3c6b81bfc50f2025 (patch)
tree234611243d183da14e1c25351ed48affa3a67365 /roadveh_gui.c
parent9247868696f602d7a7e075e3f16e9b54b8a19133 (diff)
downloadopenttd-c820704f11daaba961380aee3c6b81bfc50f2025.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 'roadveh_gui.c')
-rw-r--r--roadveh_gui.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/roadveh_gui.c b/roadveh_gui.c
index 84003ec03..ac3688df0 100644
--- a/roadveh_gui.c
+++ b/roadveh_gui.c
@@ -967,14 +967,16 @@ static void ShowPlayerRoadVehiclesLocal(PlayerID player, StationID station, Orde
Window *w;
if (show_shared) {
- w = AllocateWindowDescFront(&_player_roadveh_desc, (order << 16) | (VEH_Road << 11) | SHARE_FLAG);
+ w = AllocateWindowDescFront(&_player_roadveh_desc, (order << 16) | (VEH_Road << 11) | VLW_SHARED_ORDERS);
} else {
- if ( player == _local_player) {
- w = AllocateWindowDescFront(&_player_roadveh_desc, (station << 16) | (VEH_Road << 11) | player);
+ uint16 VLW_flag = (station == INVALID_STATION) ? VLW_STANDARD : VLW_STATION_LIST;
+ if (player == _local_player) {
+ w = AllocateWindowDescFront(&_player_roadveh_desc, (station << 16) | (VEH_Road << 11) | VLW_flag | player);
} else {
- w = AllocateWindowDescFront(&_other_player_roadveh_desc, (station << 16) | (VEH_Road << 11) | player);
+ w = AllocateWindowDescFront(&_other_player_roadveh_desc, (station << 16) | (VEH_Road << 11) | VLW_flag | player);
}
}
+
if (w != NULL) {
vehiclelist_d *vl = &WP(w, vehiclelist_d);
vl->flags = VL_REBUILD | (_sorting.roadveh.order << (VL_DESC - 1));