OpenTTD Source: GUIBadgeClasses Class Reference

OpenTTD Source 15.3

Data Structures | Public Member Functions | Private Attributes
GUIBadgeClasses Class Reference
Inheritance diagram for GUIBadgeClasses:

## Data Structures
struct | Element

## Public Member Functions
| GUIBadgeClasses (GrfSpecFeature feature)
| Construct of list of badge classes and column groups to display.
std::span< const Element > | GetClasses () const
std::span< const uint > | GetColumnWidths () const
uint | GetTotalColumnsWidth () const
| Get total width of all columns.
Public Member Functions inherited from UsedBadgeClasses
| UsedBadgeClasses (GrfSpecFeature feature)
| Create a list of used badge classes for a feature.
GrfSpecFeature | GetFeature () const
std::span< const BadgeClassID > | Classes () const

## Private Attributes
std::vector< Element > | gui_classes {}
std::vector< uint > | column_widths {}

## Detailed Description

Definition at line 19 of file newgrf_badge_gui.h.

## Constructor & Destructor Documentation

## ◆ GUIBadgeClasses()

GUIBadgeClasses::GUIBadgeClasses | ( | GrfSpecFeature | feature | ) |
| explicit

Construct of list of badge classes and column groups to display.

Parameters

  feature | feature being used.

Definition at line 71 of file newgrf_badge_gui.cpp.

References GetBadgeClassConfigItem(), GetClassBadge(), WidgetDimensions::hsep_normal, WidgetDimensions::hsep_wide, Badge::label, Badge::name, WidgetDimensions::scaled, and ScaleGUITrad().

## Member Function Documentation

## ◆ GetClasses()

std::span< const Element > GUIBadgeClasses::GetClasses | ( |  | ) | const
| inline

Definition at line 33 of file newgrf_badge_gui.h.

## ◆ GetColumnWidths()

std::span< const uint > GUIBadgeClasses::GetColumnWidths | ( |  | ) | const
| inline

Definition at line 38 of file newgrf_badge_gui.h.

## ◆ GetTotalColumnsWidth()

uint GUIBadgeClasses::GetTotalColumnsWidth | ( |  | ) | const

Get total width of all columns.

Returns
  sum of all column widths.

Definition at line 108 of file newgrf_badge_gui.cpp.

Referenced by BuildIndustryWindow::UpdateWidgetSize().

## Field Documentation

## ◆ column_widths

std::vector<uint> GUIBadgeClasses::column_widths {}
| private

Definition at line 47 of file newgrf_badge_gui.h.

## ◆ gui_classes

std::vector<Element> GUIBadgeClasses::gui_classes {}
| private

Definition at line 46 of file newgrf_badge_gui.h.

The documentation for this class was generated from the following files:

- src/newgrf_badge_gui.h
- src/newgrf_badge_gui.cpp