From f0a24e98f55def996b0913690736f4c708fc4c55 Mon Sep 17 00:00:00 2001 From: Bernard Teo Date: Wed, 7 Apr 2021 02:30:35 +0800 Subject: Fix #8922: Show vehicle window for single vehicle in shared order grouping (#8926) --- src/group_gui.cpp | 6 +++++- src/vehicle_gui.cpp | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/group_gui.cpp b/src/group_gui.cpp index e711201a6..057383768 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -892,7 +892,11 @@ public: /* We do not support VehicleClicked() here since the contextual action may only make sense for individual vehicles */ if (vindex == v->index) { - ShowVehicleListWindow(v); + if (vehgroup.NumVehicles() == 1) { + ShowVehicleViewWindow(v); + } else { + ShowVehicleListWindow(v); + } } break; } diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 5960f0be9..aa2893824 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1830,12 +1830,18 @@ public: break; } - case GB_SHARED_ORDERS: + case GB_SHARED_ORDERS: { assert(vehgroup.NumVehicles() > 0); + const Vehicle *v = vehgroup.vehicles_begin[0]; /* We do not support VehicleClicked() here since the contextual action may only make sense for individual vehicles */ - ShowVehicleListWindow(vehgroup.vehicles_begin[0]); + if (vehgroup.NumVehicles() == 1) { + ShowVehicleViewWindow(v); + } else { + ShowVehicleListWindow(v); + } break; + } default: NOT_REACHED(); } -- cgit v1.2.3-70-g09d2