mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-10 08:00:05 +00:00
Feature: Ctrl-Clicking GB_SHARED_ORDERS vehicle list opens order window
This commit is contained in:
parent
ff6c934916
commit
6a6dbbaad2
@ -24,6 +24,7 @@
|
||||
#include "core/geometry_func.hpp"
|
||||
#include "company_base.h"
|
||||
#include "company_gui.h"
|
||||
#include "gui.h"
|
||||
|
||||
#include "widgets/group_widget.h"
|
||||
|
||||
@ -745,17 +746,19 @@ public:
|
||||
NOT_REACHED();
|
||||
}
|
||||
if (v) {
|
||||
this->vehicle_sel = v->index;
|
||||
|
||||
if (_ctrl_pressed) {
|
||||
this->SelectGroup(v->group_id);
|
||||
if (this->grouping == GB_NONE) {
|
||||
this->SelectGroup(v->group_id);
|
||||
} else {
|
||||
ShowOrdersWindow(v);
|
||||
}
|
||||
} else {
|
||||
this->vehicle_sel = v->index;
|
||||
SetObjectToPlaceWnd(SPR_CURSOR_MOUSE, PAL_NONE, HT_DRAG, this);
|
||||
SetMouseCursorVehicle(v, EIT_IN_LIST);
|
||||
_cursor.vehchain = true;
|
||||
this->SetDirty();
|
||||
}
|
||||
|
||||
SetObjectToPlaceWnd(SPR_CURSOR_MOUSE, PAL_NONE, HT_DRAG, this);
|
||||
SetMouseCursorVehicle(v, EIT_IN_LIST);
|
||||
_cursor.vehchain = true;
|
||||
|
||||
this->SetDirty();
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -1843,10 +1843,14 @@ public:
|
||||
const Vehicle *v = vehgroup.vehicles_begin[0];
|
||||
/* We do not support VehicleClicked() here since the contextual action may only make sense for individual vehicles */
|
||||
|
||||
if (vehgroup.NumVehicles() == 1) {
|
||||
ShowVehicleViewWindow(v);
|
||||
if (_ctrl_pressed) {
|
||||
ShowOrdersWindow(v);
|
||||
} else {
|
||||
ShowVehicleListWindow(v);
|
||||
if (vehgroup.NumVehicles() == 1) {
|
||||
ShowVehicleViewWindow(v);
|
||||
} else {
|
||||
ShowVehicleListWindow(v);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user