OpenTTD Source  20240919-master-gdf0233f4c2
group_gui.h File Reference
#include "company_type.h"
#include "vehicle_type.h"

Go to the source code of this file.

Data Structures

struct  GUIGroupListItem
 

Typedefs

using GUIGroupList = GUIList< GUIGroupListItem >
 

Functions

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. More...
 
void ShowCompanyGroupForVehicle (const Vehicle *v)
 Show the group window for the given vehicle. More...
 
void DeleteGroupHighlightOfVehicle (const Vehicle *v)
 Removes the highlight of a vehicle in a group window. More...
 
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. More...
 

Detailed Description

Functions/definitions that have something to do with groups.

Definition in file group_gui.h.

Function Documentation

◆ 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.

Parameters
dstDestination list, owned by the caller.
foldWhether to handle group folding/hiding.
ownerOwner of groups.
veh_typeVehicle type of groups.

Definition at line 156 of file group_gui.cpp.

References GUIList< T, P, F >::ForceResort(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_group_pool >::Iterate(), and GUIList< T, P, F >::Sort().

Referenced by VehicleGroupWindow::BuildGroupList().

◆ DeleteGroupHighlightOfVehicle()

void DeleteGroupHighlightOfVehicle ( const Vehicle v)

◆ ShowCompanyGroup()

void ShowCompanyGroup ( CompanyID  company,
VehicleType  vehicle_type,
GroupID  group,
bool  need_existing_window 
)

Show the group window for the given company and vehicle type.

Parameters
companyThe company to show the window for.
vehicle_typeThe type of vehicle to show it for.
groupThe group to be selected. Defaults to INVALID_GROUP.
need_existing_windowWhether the existing window is needed. Defaults to false.

Definition at line 1166 of file group_gui.cpp.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID().

Referenced by ShowCompanyGroupForVehicle().

◆ ShowCompanyGroupForVehicle()

void ShowCompanyGroupForVehicle ( const Vehicle v)

Show the group window for the given vehicle.

Parameters
vThe vehicle to show the window for.

Definition at line 1185 of file group_gui.cpp.

References Vehicle::group_id, Vehicle::owner, ShowCompanyGroup(), and BaseVehicle::type.