|
@@ -15,24 +15,25 @@
|
|
|
#include "string_func.h"
|
|
|
#include "strings_func.h"
|
|
|
#include "window_func.h"
|
|
|
#include "vehicle_func.h"
|
|
|
#include "autoreplace_gui.h"
|
|
|
#include "company_func.h"
|
|
|
#include "widgets/dropdown_func.h"
|
|
|
#include "tilehighlight_func.h"
|
|
|
#include "vehicle_gui_base.h"
|
|
|
#include "core/geometry_func.hpp"
|
|
|
#include "company_base.h"
|
|
|
#include "company_gui.h"
|
|
|
#include "gui.h"
|
|
|
|
|
|
#include "widgets/group_widget.h"
|
|
|
|
|
|
#include "table/sprites.h"
|
|
|
|
|
|
#include "safeguards.h"
|
|
|
|
|
|
static const int LEVEL_WIDTH = 10; ///< Indenting width of a sub-group in pixels
|
|
|
|
|
|
typedef GUIList<const Group*> GUIGroupList;
|
|
|
|
|
|
static const NWidgetPart _nested_group_widgets[] = {
|
|
@@ -736,36 +737,38 @@ public:
|
|
|
v = vehgroup.vehicles_begin[0];
|
|
|
/*
|
|
|
* No VehicleClicked(v) support for now, because don't want
|
|
|
* to enable any contextual actions except perhaps clicking/ctrl-clicking to clone orders.
|
|
|
*/
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
default:
|
|
|
NOT_REACHED();
|
|
|
}
|
|
|
if (v) {
|
|
|
if (_ctrl_pressed) {
|
|
|
if (this->grouping == GB_NONE) {
|
|
|
this->SelectGroup(v->group_id);
|
|
|
} else {
|
|
|
ShowOrdersWindow(v);
|
|
|
}
|
|
|
} else {
|
|
|
this->vehicle_sel = v->index;
|
|
|
|
|
|
if (_ctrl_pressed) {
|
|
|
this->SelectGroup(v->group_id);
|
|
|
}
|
|
|
|
|
|
SetObjectToPlaceWnd(SPR_CURSOR_MOUSE, PAL_NONE, HT_DRAG, this);
|
|
|
SetMouseCursorVehicle(v, EIT_IN_LIST);
|
|
|
_cursor.vehchain = true;
|
|
|
|
|
|
this->SetDirty();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
case WID_GL_CREATE_GROUP: { // Create a new group
|
|
|
DoCommandP(0, this->vli.vtype, this->vli.index, CMD_CREATE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_CREATE), CcCreateGroup);
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
case WID_GL_DELETE_GROUP: { // Delete the selected group
|
|
|
this->group_confirm = this->vli.index;
|
|
|
ShowQuery(STR_QUERY_GROUP_DELETE_CAPTION, STR_GROUP_DELETE_QUERY_TEXT, this, DeleteGroupCallback);
|