OpenTTD Source 20250531-master-g621c031307
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< GUIBadgeClassesgui_classes
 
const std::span< const BadgeIDbadges
 
const GrfSpecFeature feature
 
const std::optional< TimerGameCalendar::Dateintroduction_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 219 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 203 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 213 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 208 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 231 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 235 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 232 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 229 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 233 of file newgrf_badge_gui.cpp.


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