OpenTTD Source 20260311-master-g511d3794ce
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)
void FilterText (StringFilter &string_filter) const override
 Add text from this dropdown item to a string filter.
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< GUIBadgeClassesgui_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 238 of file newgrf_badge_gui.cpp.

◆ FilterText()

template<class TBase, bool TEnd = true, FontSize TFs = FS_NORMAL>
void DropDownBadges< TBase, TEnd, TFs >::FilterText ( StringFilter & string_filter) const
inlineoverride

Add text from this dropdown item to a string filter.

Parameters
string_filterString filter to add text to.

Definition at line 207 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 217 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 228 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 222 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 252 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 256 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 253 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 250 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 254 of file newgrf_badge_gui.cpp.


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