OpenTTD Source  20241108-master-g80f628063a
group_gui.h
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6  */
7 
10 #ifndef GROUP_GUI_H
11 #define GROUP_GUI_H
12 
13 #include "company_type.h"
14 #include "vehicle_type.h"
15 
16 void ShowCompanyGroup(CompanyID company, VehicleType veh, GroupID group = INVALID_GROUP, bool need_existing_window = false);
17 void ShowCompanyGroupForVehicle(const Vehicle *v);
19 
21  const Group *group;
22  uint8_t indent;
23  uint16_t level_mask;
24 
25  constexpr GUIGroupListItem(const Group *group, int8_t indent) : group(group), indent(indent), level_mask(0) {}
26 };
27 
29 
30 void BuildGuiGroupList(GUIGroupList &dst, bool fold, Owner owner, VehicleType veh_type);
31 
32 #endif /* GROUP_GUI_H */
Types related to companies.
Owner
Enum for all companies/owners.
Definition: company_type.h:18
void ShowCompanyGroup(CompanyID company, VehicleType veh, GroupID group=INVALID_GROUP, bool need_existing_window=false)
Show the group window for the given company and vehicle type.
Definition: group_gui.cpp:1175
void DeleteGroupHighlightOfVehicle(const Vehicle *v)
Removes the highlight of a vehicle in a group window.
Definition: group_gui.cpp:1252
void ShowCompanyGroupForVehicle(const Vehicle *v)
Show the group window for the given vehicle.
Definition: group_gui.cpp:1194
void BuildGuiGroupList(GUIGroupList &dst, bool fold, Owner owner, VehicleType veh_type)
Build GUI group list, a sorted hierarchical list of groups for owner and vehicle type.
Definition: group_gui.cpp:156
uint16_t GroupID
Type for all group identifiers.
Definition: group_type.h:13
static const GroupID INVALID_GROUP
Sentinel for invalid groups.
Definition: group_type.h:18
uint16_t level_mask
Bitmask of indentation continuation.
Definition: group_gui.h:23
uint8_t indent
Display indentation level.
Definition: group_gui.h:22
Group data.
Definition: group.h:72
Vehicle data structure.
Definition: vehicle_base.h:244
Types related to vehicles.
VehicleType
Available vehicle types.
Definition: vehicle_type.h:21