diff options
author | Bernard Teo <btzy1996@hotmail.com> | 2021-11-19 08:03:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-19 00:03:52 +0000 |
commit | 0533b666b7036750ed0b004f22f933625391dd8e (patch) | |
tree | 55ec7ad21edb5d99480c7c4c213fe4a3ee0d74fc /src | |
parent | f6886754ff99420dd4e02b541b94c213ad6f2052 (diff) | |
download | openttd-0533b666b7036750ed0b004f22f933625391dd8e.tar.xz |
Fix #9702: Display order window for vehicle group on ctrl-click only when using shared orders (#9704)
Diffstat (limited to 'src')
-rw-r--r-- | src/group_gui.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/group_gui.cpp b/src/group_gui.cpp index bc6a9aaf2..374ed5700 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -746,17 +746,23 @@ public: NOT_REACHED(); } if (v) { - if (_ctrl_pressed) { - if (this->grouping == GB_NONE) { - this->SelectGroup(v->group_id); - } else { - ShowOrdersWindow(v); - } + if (_ctrl_pressed && this->grouping == GB_SHARED_ORDERS) { + ShowOrdersWindow(v); } else { this->vehicle_sel = v->index; + + if (_ctrl_pressed && this->grouping == GB_NONE) { + /* + * It only makes sense to select a group if not using shared orders + * since two vehicles sharing orders can be from different groups. + */ + this->SelectGroup(v->group_id); + } + SetObjectToPlaceWnd(SPR_CURSOR_MOUSE, PAL_NONE, HT_DRAG, this); SetMouseCursorVehicle(v, EIT_IN_LIST); _cursor.vehchain = true; + this->SetDirty(); } } |