OpenTTD Source: src/group_gui.h Source File

OpenTTD Source 15.3

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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef GROUP_GUI_H
11#define GROUP_GUI_H
12
13#include "company_type.h"
14#include "group_type.h"
15#include "sortlist_type.h"
16#include "vehicle_type.h"
17
18void ShowCompanyGroup(CompanyID company, VehicleType veh, GroupID group = GroupID::Invalid());
19void ShowCompanyGroupForVehicle(const Vehicle *v);
20void DeleteGroupHighlightOfVehicle(const Vehicle *v);
21
22 struct GUIGroupListItem {
23 const Group *group;
24 uint8_t indent;
25 uint16_t level_mask;
26
27 constexpr GUIGroupListItem(const Group *group, int8_t indent) : group(group), indent(indent), level_mask(0) {}
28};
29
30using GUIGroupList = GUIList<GUIGroupListItem>;
31
32void BuildGuiGroupList(GUIGroupList &dst, bool fold, Owner owner, VehicleType veh_type);
33
34#endif /* GROUP_GUI_H */
GUIList< GUIGroupListItem >
company_type.h
Types related to companies.
ShowCompanyGroup
void ShowCompanyGroup(CompanyID company, VehicleType veh, GroupID group=GroupID::Invalid())
Show the group window for the given company and vehicle type.
Definition group_gui.cpp:1240
DeleteGroupHighlightOfVehicle
void DeleteGroupHighlightOfVehicle(const Vehicle *v)
Removes the highlight of a vehicle in a group window.
Definition group_gui.cpp:1307
ShowCompanyGroupForVehicle
void ShowCompanyGroupForVehicle(const Vehicle *v)
Show the group window for the given vehicle.
Definition group_gui.cpp:1249
BuildGuiGroupList
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:167
group_type.h
Types of a group.
sortlist_type.h
Base types for having sorted lists in GUIs.
GUIGroupListItem
Definition group_gui.h:22
GUIGroupListItem::level_mask
uint16_t level_mask
Bitmask of indentation continuation.
Definition group_gui.h:25
GUIGroupListItem::indent
uint8_t indent
Display indentation level.
Definition group_gui.h:24
Group
Group data.
Definition group.h:73
PoolID< uint8_t, struct CompanyIDTag, 0xF, 0xFF >
Vehicle
Vehicle data structure.
Definition vehicle_base.h:205
vehicle_type.h
Types related to vehicles.
VehicleType
VehicleType
Available vehicle types.
Definition vehicle_type.h:22