OpenTTD Source 20260206-master-g4d4e37dbf1
WaypointPickerCallbacks Class Reference
Inheritance diagram for WaypointPickerCallbacks:
PickerCallbacksNewGRFClass< StationClass > PickerCallbacks

Public Member Functions

GrfSpecFeature GetFeature () const override
StringID GetClassTooltip () const override
 Get the tooltip string for the class list.
StringID GetTypeTooltip () const override
 Get the tooltip string for the type grid.
StringID GetCollectionTooltip () const override
 Get the tooltip string for the collection list.
bool IsActive () const override
 Should picker class/type selection be enabled?
bool HasClassChoice () const override
 Are there multiple classes to chose from?
void Close (int) override
int GetSelectedClass () const override
 Get the index of the selected class.
void SetSelectedClass (int id) const override
 Set the selected class.
StringID GetClassName (int id) const override
 Get the name of a class.
int GetSelectedType () const override
 Get the selected type.
void SetSelectedType (int id) const override
 Set the selected type.
StringID GetTypeName (int cls_id, int id) const override
 Get the item of a type.
std::span< const BadgeID > GetTypeBadges (int cls_id, int id) const override
 Get the item of a type.
bool IsTypeAvailable (int cls_id, int id) const override
 Test if an item is currently buildable.
void DrawType (int x, int y, int cls_id, int id) const override
 Draw preview image of an item.
void FillUsedItems (std::set< PickerItem > &items) override
 Fill a set with all items that are used by the current player.
Public Member Functions inherited from PickerCallbacksNewGRFClass< StationClass >
 PickerCallbacksNewGRFClass (const std::string &ini_group)
StationClass::index_type GetClassIndex (int cls_id) const
const StationClassGetClass (int cls_id) const
const StationClass::spec_type * GetSpec (int cls_id, int id) const
int GetClassCount () const override
 Get the number of classes.
int GetTypeCount (int cls_id) const override
 Get the number of types in a class.
PickerItem GetPickerItem (const typename StationClass::spec_type *spec, int cls_id=-1, int id=-1) const
std::map< std::string, std::set< PickerItem > > UpdateSavedItems (const std::map< std::string, std::set< PickerItem > > &src) override
 Update link between grfid/localidx and class_index/index in saved items.
Public Member Functions inherited from PickerCallbacks
 PickerCallbacks (const std::string &ini_group)
virtual PickerItem GetPickerItem (int cls_id, int id) const =0
 Get data about an item.
std::set< std::string > InitializeInactiveCollections (const std::map< std::string, std::set< PickerItem > > collections)
 Initialize the list of active collections for sorting purposes.

Static Public Attributes

static WaypointPickerCallbacks instance

Additional Inherited Members

Data Fields inherited from PickerCallbacks
Listing class_last_sorting = { false, 0 }
 Default sorting of PickerClassList.
Filtering class_last_filtering = { false, 0 }
 Default filtering of PickerClassList.
Listing type_last_sorting = { false, 0 }
 Default sorting of PickerTypeList.
Filtering type_last_filtering = { false, 0 }
 Default filtering of PickerTypeList.
Listing collection_last_sorting = { false, 0 }
 Default sorting of PickerCollectionList.
const std::string ini_group
 Ini Group for saving favourites.
uint8_t mode = 0
 Bitmask of PickerFilterModes.
bool rename_collection = false
 Are we renaming a collection?
std::string sel_collection
 Currently selected collection of saved items.
std::string edit_collection
 Collection to rename or delete.
std::set< std::string > rm_collections
 Set of removed or renamed collections for updating ini file.
int preview_height = 0
 Previously adjusted height.
std::set< PickerItemused
 Set of items used in the current game by the current company.
std::map< std::string, std::set< PickerItem > > saved
 Set of saved collections of items.

Detailed Description

Definition at line 1827 of file rail_gui.cpp.

Constructor & Destructor Documentation

◆ WaypointPickerCallbacks()

WaypointPickerCallbacks::WaypointPickerCallbacks ( )
inline

Definition at line 1829 of file rail_gui.cpp.

Member Function Documentation

◆ Close()

void WaypointPickerCallbacks::Close ( int )
inlineoverridevirtual

Reimplemented from PickerCallbacks.

Definition at line 1853 of file rail_gui.cpp.

◆ DrawType()

void WaypointPickerCallbacks::DrawType ( int x,
int y,
int cls_id,
int id ) const
inlineoverridevirtual

Draw preview image of an item.

Implements PickerCallbacks.

Definition at line 1885 of file rail_gui.cpp.

References _cur_railtype, and DrawWaypointSprite().

◆ FillUsedItems()

void WaypointPickerCallbacks::FillUsedItems ( std::set< PickerItem > & items)
inlineoverridevirtual

Fill a set with all items that are used by the current player.

Implements PickerCallbacks.

Definition at line 1890 of file rail_gui.cpp.

References _local_company, HasBit(), SpecializedStation< Waypoint, true >::Iterate(), STAT_CLASS_WAYP, StationUsesDefaultType(), and WPF_ROAD.

◆ GetClassName()

StringID WaypointPickerCallbacks::GetClassName ( int id) const
inlineoverridevirtual

Get the name of a class.

Implements PickerCallbacks.

Definition at line 1857 of file rail_gui.cpp.

References INVALID_STRING_ID, and IsWaypointClass().

◆ GetClassTooltip()

StringID WaypointPickerCallbacks::GetClassTooltip ( ) const
inlineoverridevirtual

Get the tooltip string for the class list.

Implements PickerCallbacks.

Definition at line 1833 of file rail_gui.cpp.

◆ GetCollectionTooltip()

StringID WaypointPickerCallbacks::GetCollectionTooltip ( ) const
inlineoverridevirtual

Get the tooltip string for the collection list.

Implements PickerCallbacks.

Definition at line 1835 of file rail_gui.cpp.

◆ GetFeature()

GrfSpecFeature WaypointPickerCallbacks::GetFeature ( ) const
inlineoverridevirtual

Implements PickerCallbacks.

Definition at line 1831 of file rail_gui.cpp.

◆ GetSelectedClass()

int WaypointPickerCallbacks::GetSelectedClass ( ) const
inlineoverridevirtual

Get the index of the selected class.

Implements PickerCallbacks.

Definition at line 1854 of file rail_gui.cpp.

References _waypoint_gui.

◆ GetSelectedType()

int WaypointPickerCallbacks::GetSelectedType ( ) const
inlineoverridevirtual

Get the selected type.

Implements PickerCallbacks.

Definition at line 1864 of file rail_gui.cpp.

References _waypoint_gui.

◆ GetTypeBadges()

std::span< const BadgeID > WaypointPickerCallbacks::GetTypeBadges ( int cls_id,
int id ) const
inlineoverridevirtual

Get the item of a type.

Implements PickerCallbacks.

Definition at line 1873 of file rail_gui.cpp.

◆ GetTypeName()

StringID WaypointPickerCallbacks::GetTypeName ( int cls_id,
int id ) const
inlineoverridevirtual

Get the item of a type.

Implements PickerCallbacks.

Definition at line 1867 of file rail_gui.cpp.

◆ GetTypeTooltip()

StringID WaypointPickerCallbacks::GetTypeTooltip ( ) const
inlineoverridevirtual

Get the tooltip string for the type grid.

Implements PickerCallbacks.

Definition at line 1834 of file rail_gui.cpp.

◆ HasClassChoice()

bool WaypointPickerCallbacks::HasClassChoice ( ) const
inlineoverridevirtual

Are there multiple classes to chose from?

Reimplemented from PickerCallbacksNewGRFClass< StationClass >.

Definition at line 1848 of file rail_gui.cpp.

References NewGRFClass< StationSpec, StationClassID, STAT_CLASS_MAX >::Classes(), and IsWaypointClass().

◆ IsActive()

bool WaypointPickerCallbacks::IsActive ( ) const
inlineoverridevirtual

Should picker class/type selection be enabled?

Implements PickerCallbacks.

Definition at line 1837 of file rail_gui.cpp.

References NewGRFClass< StationSpec, StationClassID, STAT_CLASS_MAX >::Classes(), and IsWaypointClass().

◆ IsTypeAvailable()

bool WaypointPickerCallbacks::IsTypeAvailable ( int cls_id,
int id ) const
inlineoverridevirtual

Test if an item is currently buildable.

Implements PickerCallbacks.

Definition at line 1880 of file rail_gui.cpp.

References IsStationAvailable().

◆ SetSelectedClass()

void WaypointPickerCallbacks::SetSelectedClass ( int id) const
inlineoverridevirtual

Set the selected class.

Implements PickerCallbacks.

Definition at line 1855 of file rail_gui.cpp.

References _waypoint_gui.

◆ SetSelectedType()

void WaypointPickerCallbacks::SetSelectedType ( int id) const
inlineoverridevirtual

Set the selected type.

Implements PickerCallbacks.

Definition at line 1865 of file rail_gui.cpp.

References _waypoint_gui.

Field Documentation

◆ instance

WaypointPickerCallbacks WaypointPickerCallbacks::instance
static

Definition at line 1906 of file rail_gui.cpp.


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