|
OpenTTD Source
13.2.1
|
#include "stdafx.h"#include "textbuf_gui.h"#include "command_func.h"#include "vehicle_gui.h"#include "vehicle_base.h"#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 "group_cmd.h"#include "vehicle_cmd.h"#include "gfx_func.h"#include "widgets/group_widget.h"#include "table/sprites.h"#include "safeguards.h"Go to the source code of this file.
Data Structures | |
| class | VehicleGroupWindow |
Typedefs | |
| typedef GUIList< const Group * > | GUIGroupList |
Functions | |
| void | ShowCompanyGroup (CompanyID company, VehicleType vehicle_type, GroupID group=INVALID_GROUP, bool need_existing_window=false) |
| Show the group window for the given company and vehicle type. More... | |
| void | ShowCompanyGroupForVehicle (const Vehicle *v) |
| Show the group window for the given vehicle. More... | |
| static VehicleGroupWindow * | FindVehicleGroupWindow (VehicleType vt, Owner owner) |
| Finds a group list window determined by vehicle type and owner. More... | |
| static void | CcCreateGroup (GroupID gid, VehicleType veh_type) |
| Opens a 'Rename group' window for newly created group. More... | |
| void | CcCreateGroup (Commands cmd, const CommandCost &result, GroupID new_group, VehicleType vt, GroupID parent_group) |
| Opens a 'Rename group' window for newly created group. More... | |
| void | CcAddVehicleNewGroup (Commands cmd, const CommandCost &result, GroupID new_group, GroupID, VehicleID veh_id, bool) |
| Open rename window after adding a vehicle to a new group via drag and drop. More... | |
| void | DeleteGroupHighlightOfVehicle (const Vehicle *v) |
| Removes the highlight of a vehicle in a group window. More... | |
Variables | |
| static const NWidgetPart | _nested_group_widgets [] |
| static WindowDesc | _other_group_desc (WDP_AUTO, "list_groups", 460, 246, WC_INVALID, WC_NONE, 0, _nested_group_widgets, lengthof(_nested_group_widgets)) |
| static WindowDesc | _train_group_desc (WDP_AUTO, "list_groups_train", 525, 246, WC_TRAINS_LIST, WC_NONE, 0, _nested_group_widgets, lengthof(_nested_group_widgets)) |
GUI for the group window.
Definition in file group_gui.cpp.
| void CcAddVehicleNewGroup | ( | Commands | cmd, |
| const CommandCost & | result, | ||
| GroupID | new_group, | ||
| GroupID | , | ||
| VehicleID | veh_id, | ||
| bool | |||
| ) |
Open rename window after adding a vehicle to a new group via drag and drop.
| cmd | Unused. |
| result | Did command succeed? |
| new_group | ID of the created group. |
| veh_id | vehicle to add to a group |
Definition at line 1192 of file group_gui.cpp.
| void CcCreateGroup | ( | Commands | cmd, |
| const CommandCost & | result, | ||
| GroupID | new_group, | ||
| VehicleType | vt, | ||
| GroupID | parent_group | ||
| ) |
Opens a 'Rename group' window for newly created group.
| cmd | Unused. |
| result | Did command succeed? |
| new_group | ID of the created group. |
| vt | Vehicle type. |
| parent_group | Parent group of the new group. |
Definition at line 1177 of file group_gui.cpp.
|
static |
Opens a 'Rename group' window for newly created group.
| veh_type | Vehicle type. |
Definition at line 1162 of file group_gui.cpp.
References _current_company, and FindVehicleGroupWindow().
| void DeleteGroupHighlightOfVehicle | ( | const Vehicle * | v | ) |
Removes the highlight of a vehicle in a group window.
| *v | Vehicle to remove all highlights from |
Definition at line 1204 of file group_gui.cpp.
References _special_mouse_mode, FindVehicleGroupWindow(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, Vehicle::owner, BaseVehicle::type, VehicleGroupWindow::UnselectVehicle(), and WSM_DRAGDROP.
|
inlinestatic |
Finds a group list window determined by vehicle type and owner.
| vt | vehicle type |
| owner | owner of groups |
Definition at line 1153 of file group_gui.cpp.
References FindWindowById(), and GetWindowClassForVehicleType().
Referenced by CcCreateGroup(), and DeleteGroupHighlightOfVehicle().
| void ShowCompanyGroup | ( | CompanyID | company, |
| VehicleType | vehicle_type, | ||
| GroupID | group = INVALID_GROUP, |
||
| bool | need_existing_window = false |
||
| ) |
Show the group window for the given company and vehicle type.
| company | The company to show the window for. |
| vehicle_type | The type of vehicle to show it for. |
| group | The group to be selected. Defaults to INVALID_GROUP. |
| need_existing_window | Whether the existing window is needed. Defaults to false. |
Definition at line 1123 of file group_gui.cpp.
Referenced by ShowCompanyGroupForVehicle().
| void ShowCompanyGroupForVehicle | ( | const Vehicle * | v | ) |
Show the group window for the given vehicle.
| v | The vehicle to show the window for. |
Definition at line 1142 of file group_gui.cpp.
References Vehicle::group_id, Vehicle::owner, ShowCompanyGroup(), and BaseVehicle::type.
Referenced by NewsWindow::OnClick().