OpenTTD Source: DropDownBadges< TBase, TEnd, TFs > Class Template Reference

OpenTTD Source 15.0-RC2

Public Member Functions | Private Attributes
DropDownBadges< TBase, TEnd, TFs > Class Template Reference

Drop down element that draws a list of badges. More...

Inheritance diagram for DropDownBadges< TBase, TEnd, TFs >:

## Public Member Functions
template<typename... Args>
| DropDownBadges (const std::shared_ptr< GUIBadgeClasses > &gui_classes, std::span< const BadgeID > badges, GrfSpecFeature feature, std::optional< TimerGameCalendar::Date > introduction_date, Args &&...args)
uint | Height () const override
uint | Width () const override
int | OnClick (const Rect &r, const Point &pt) const override
void | Draw (const Rect &full, const Rect &r, bool sel, int click_result, Colours bg_colour) const override

## Private Attributes
std::shared_ptr< GUIBadgeClasses > | gui_classes
const std::span< const BadgeID > | badges
const GrfSpecFeature | feature
const std::optional< TimerGameCalendar::Date > | introduction_date
Dimension | dim {}

## Detailed Description

template<class TBase, bool TEnd = true, FontSize TFs = FS_NORMAL>
class DropDownBadges< TBase, TEnd, TFs >

Drop down element that draws a list of badges.

Definition at line 190 of file newgrf_badge_gui.cpp.

## Constructor & Destructor Documentation

## ◆ DropDownBadges()

template<class TBase , bool TEnd = true, FontSize TFs = FS_NORMAL>
template<typename... Args>

DropDownBadges< TBase, TEnd, TFs >::DropDownBadges | ( | const std::shared_ptr< GUIBadgeClasses > & | gui_classes,
|  | std::span< const BadgeID > | badges,
|  | GrfSpecFeature | feature,
|  | std::optional< TimerGameCalendar::Date > | introduction_date,
|  | Args &&... | args
| ) |  |
| inlineexplicit

Definition at line 193 of file newgrf_badge_gui.cpp.

## Member Function Documentation

## ◆ Draw()

template<class TBase , bool TEnd = true, FontSize TFs = FS_NORMAL>

void DropDownBadges< TBase, TEnd, TFs >::Draw | ( | const Rect & | full,
|  | const Rect & | r,
|  | bool | sel,
|  | int | click_result,
|  | Colours | bg_colour
| ) |  | const
| inlineoverride

Definition at line 227 of file newgrf_badge_gui.cpp.

## ◆ Height()

template<class TBase , bool TEnd = true, FontSize TFs = FS_NORMAL>

uint DropDownBadges< TBase, TEnd, TFs >::Height | ( |  | ) | const
| inlineoverride

Definition at line 206 of file newgrf_badge_gui.cpp.

## ◆ OnClick()

template<class TBase , bool TEnd = true, FontSize TFs = FS_NORMAL>

int DropDownBadges< TBase, TEnd, TFs >::OnClick | ( | const Rect & | r,
|  | const Point & | pt
| ) |  | const
| inlineoverride

Definition at line 217 of file newgrf_badge_gui.cpp.

## ◆ Width()

template<class TBase , bool TEnd = true, FontSize TFs = FS_NORMAL>

uint DropDownBadges< TBase, TEnd, TFs >::Width | ( |  | ) | const
| inlineoverride

Definition at line 211 of file newgrf_badge_gui.cpp.

## Field Documentation

## ◆ badges

template<class TBase , bool TEnd = true, FontSize TFs = FS_NORMAL>

const std::span<const BadgeID> DropDownBadges< TBase, TEnd, TFs >::badges
| private

Definition at line 241 of file newgrf_badge_gui.cpp.

## ◆ dim

template<class TBase , bool TEnd = true, FontSize TFs = FS_NORMAL>

Dimension DropDownBadges< TBase, TEnd, TFs >::dim {}
| private

Definition at line 245 of file newgrf_badge_gui.cpp.

## ◆ feature

template<class TBase , bool TEnd = true, FontSize TFs = FS_NORMAL>

const GrfSpecFeature DropDownBadges< TBase, TEnd, TFs >::feature
| private

Definition at line 242 of file newgrf_badge_gui.cpp.

## ◆ gui_classes

template<class TBase , bool TEnd = true, FontSize TFs = FS_NORMAL>

std::shared_ptr<GUIBadgeClasses> DropDownBadges< TBase, TEnd, TFs >::gui_classes
| private

Definition at line 239 of file newgrf_badge_gui.cpp.

## ◆ introduction_date

template<class TBase , bool TEnd = true, FontSize TFs = FS_NORMAL>

const std::optional<TimerGameCalendar::Date> DropDownBadges< TBase, TEnd, TFs >::introduction_date
| private

Definition at line 243 of file newgrf_badge_gui.cpp.

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

- src/newgrf_badge_gui.cpp