OpenTTD Source 20260129-master-g2bb01bd0e4
RoadStopPickerCallbacks< roadstoptype > Class Template Reference
Inheritance diagram for RoadStopPickerCallbacks< roadstoptype >:
PickerCallbacksNewGRFClass< RoadStopClass > PickerCallbacks

Public Member Functions

 RoadStopPickerCallbacks (const std::string &ini_group)
 
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?
 
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 BadgeIDGetTypeBadges (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.
 
StringID GetClassTooltip () const
 Get the tooltip string for the class list.
 
StringID GetTypeTooltip () const
 Get the tooltip string for the type grid.
 
StringID GetCollectionTooltip () const
 Get the tooltip string for the collection list.
 
StringID GetClassTooltip () const
 Get the tooltip string for the class list.
 
StringID GetTypeTooltip () const
 Get the tooltip string for the type grid.
 
StringID GetCollectionTooltip () const
 Get the tooltip string for the collection list.
 
- Public Member Functions inherited from PickerCallbacksNewGRFClass< RoadStopClass >
 PickerCallbacksNewGRFClass (const std::string &ini_group)
 
T::index_type GetClassIndex (int cls_id) const
 
const RoadStopClassGetClass (int cls_id) const
 
const T::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 T::spec_type *spec, int cls_id=-1, int id=-1) const
 
PickerItem GetPickerItem (int cls_id, int id) const override
 Get data about an item.
 
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 void Close (int)
 
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 Member Functions

static bool IsClassChoice (const RoadStopClass &cls)
 

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

template<RoadStopType roadstoptype>
class RoadStopPickerCallbacks< roadstoptype >

Definition at line 1195 of file road_gui.cpp.

Constructor & Destructor Documentation

◆ RoadStopPickerCallbacks()

template<RoadStopType roadstoptype>
RoadStopPickerCallbacks< roadstoptype >::RoadStopPickerCallbacks ( const std::string &  ini_group)
inline

Definition at line 1197 of file road_gui.cpp.

Member Function Documentation

◆ DrawType()

template<RoadStopType roadstoptype>
void RoadStopPickerCallbacks< roadstoptype >::DrawType ( int  x,
int  y,
int  cls_id,
int  id 
) const
inlineoverridevirtual

Draw preview image of an item.

Implements PickerCallbacks.

Definition at line 1263 of file road_gui.cpp.

References Bus, DIAGDIR_END, DrawRoadStopTile(), DriveThroughOnly, INVALID_RAILTYPE, RoadStopPickerSelection::orientation, and Truck.

◆ FillUsedItems()

template<RoadStopType roadstoptype>
void RoadStopPickerCallbacks< roadstoptype >::FillUsedItems ( std::set< PickerItem > &  items)
inlineoverridevirtual

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

Implements PickerCallbacks.

Definition at line 1275 of file road_gui.cpp.

References _local_company, Bus, BusStop, SpecializedStation< Station, false >::Iterate(), ROADSTOP_CLASS_DFLT, ROADSTOPTYPE_ALL, ROADSTOPTYPE_FREIGHT, ROADSTOPTYPE_PASSENGER, Truck, and TruckStop.

◆ GetClassName()

template<RoadStopType roadstoptype>
StringID RoadStopPickerCallbacks< roadstoptype >::GetClassName ( int  id) const
inlineoverridevirtual

Get the name of a class.

Implements PickerCallbacks.

Definition at line 1232 of file road_gui.cpp.

References INVALID_STRING_ID.

◆ GetClassTooltip() [1/3]

StringID RoadStopPickerCallbacks< RoadStopType::Bus >::GetClassTooltip ( ) const
virtual

Get the tooltip string for the class list.

Implements PickerCallbacks.

Definition at line 1292 of file road_gui.cpp.

◆ GetClassTooltip() [2/3]

StringID RoadStopPickerCallbacks< RoadStopType::Truck >::GetClassTooltip ( ) const
virtual

Get the tooltip string for the class list.

Implements PickerCallbacks.

Definition at line 1296 of file road_gui.cpp.

◆ GetClassTooltip() [3/3]

template<RoadStopType roadstoptype>
StringID RoadStopPickerCallbacks< roadstoptype >::GetClassTooltip ( ) const
overridevirtual

Get the tooltip string for the class list.

Implements PickerCallbacks.

◆ GetCollectionTooltip() [1/3]

StringID RoadStopPickerCallbacks< RoadStopType::Bus >::GetCollectionTooltip ( ) const
virtual

Get the tooltip string for the collection list.

Implements PickerCallbacks.

Definition at line 1294 of file road_gui.cpp.

◆ GetCollectionTooltip() [2/3]

StringID RoadStopPickerCallbacks< RoadStopType::Truck >::GetCollectionTooltip ( ) const
virtual

Get the tooltip string for the collection list.

Implements PickerCallbacks.

Definition at line 1298 of file road_gui.cpp.

◆ GetCollectionTooltip() [3/3]

template<RoadStopType roadstoptype>
StringID RoadStopPickerCallbacks< roadstoptype >::GetCollectionTooltip ( ) const
overridevirtual

Get the tooltip string for the collection list.

Implements PickerCallbacks.

◆ GetFeature()

template<RoadStopType roadstoptype>
GrfSpecFeature RoadStopPickerCallbacks< roadstoptype >::GetFeature ( ) const
inlineoverridevirtual

Implements PickerCallbacks.

Definition at line 1199 of file road_gui.cpp.

◆ GetSelectedClass()

template<RoadStopType roadstoptype>
int RoadStopPickerCallbacks< roadstoptype >::GetSelectedClass ( ) const
inlineoverridevirtual

Get the index of the selected class.

Implements PickerCallbacks.

Definition at line 1229 of file road_gui.cpp.

References RoadStopPickerSelection::sel_class.

◆ GetSelectedType()

template<RoadStopType roadstoptype>
int RoadStopPickerCallbacks< roadstoptype >::GetSelectedType ( ) const
inlineoverridevirtual

Get the selected type.

Implements PickerCallbacks.

Definition at line 1239 of file road_gui.cpp.

References RoadStopPickerSelection::sel_type.

◆ GetTypeBadges()

template<RoadStopType roadstoptype>
std::span< const BadgeID > RoadStopPickerCallbacks< roadstoptype >::GetTypeBadges ( int  cls_id,
int  id 
) const
inlineoverridevirtual

Get the item of a type.

Implements PickerCallbacks.

Definition at line 1249 of file road_gui.cpp.

References Bus, and Truck.

◆ GetTypeName()

template<RoadStopType roadstoptype>
StringID RoadStopPickerCallbacks< roadstoptype >::GetTypeName ( int  cls_id,
int  id 
) const
inlineoverridevirtual

Get the item of a type.

Implements PickerCallbacks.

Definition at line 1242 of file road_gui.cpp.

References Bus, INVALID_STRING_ID, and Truck.

◆ GetTypeTooltip() [1/3]

StringID RoadStopPickerCallbacks< RoadStopType::Bus >::GetTypeTooltip ( ) const
virtual

Get the tooltip string for the type grid.

Implements PickerCallbacks.

Definition at line 1293 of file road_gui.cpp.

◆ GetTypeTooltip() [2/3]

StringID RoadStopPickerCallbacks< RoadStopType::Truck >::GetTypeTooltip ( ) const
virtual

Get the tooltip string for the type grid.

Implements PickerCallbacks.

Definition at line 1297 of file road_gui.cpp.

◆ GetTypeTooltip() [3/3]

template<RoadStopType roadstoptype>
StringID RoadStopPickerCallbacks< roadstoptype >::GetTypeTooltip ( ) const
overridevirtual

Get the tooltip string for the type grid.

Implements PickerCallbacks.

◆ HasClassChoice()

template<RoadStopType roadstoptype>
bool RoadStopPickerCallbacks< roadstoptype >::HasClassChoice ( ) const
inlineoverridevirtual

Are there multiple classes to chose from?

Reimplemented from PickerCallbacksNewGRFClass< RoadStopClass >.

Definition at line 1224 of file road_gui.cpp.

References NewGRFClass< Tspec, Tindex, Tmax >::Classes().

◆ IsActive()

template<RoadStopType roadstoptype>
bool RoadStopPickerCallbacks< roadstoptype >::IsActive ( ) const
inlineoverridevirtual

Should picker class/type selection be enabled?

Implements PickerCallbacks.

Definition at line 1205 of file road_gui.cpp.

References Bus, NewGRFClass< Tspec, Tindex, Tmax >::Classes(), IsWaypointClass(), ROADSTOPTYPE_ALL, ROADSTOPTYPE_FREIGHT, ROADSTOPTYPE_PASSENGER, and Truck.

◆ IsClassChoice()

template<RoadStopType roadstoptype>
static bool RoadStopPickerCallbacks< roadstoptype >::IsClassChoice ( const RoadStopClass cls)
inlinestatic

Definition at line 1219 of file road_gui.cpp.

◆ IsTypeAvailable()

template<RoadStopType roadstoptype>
bool RoadStopPickerCallbacks< roadstoptype >::IsTypeAvailable ( int  cls_id,
int  id 
) const
inlineoverridevirtual

Test if an item is currently buildable.

Implements PickerCallbacks.

Definition at line 1257 of file road_gui.cpp.

References Bus, IsRoadStopAvailable(), and Truck.

◆ SetSelectedClass()

template<RoadStopType roadstoptype>
void RoadStopPickerCallbacks< roadstoptype >::SetSelectedClass ( int  id) const
inlineoverridevirtual

Set the selected class.

Implements PickerCallbacks.

Definition at line 1230 of file road_gui.cpp.

References RoadStopPickerSelection::sel_class.

◆ SetSelectedType()

template<RoadStopType roadstoptype>
void RoadStopPickerCallbacks< roadstoptype >::SetSelectedType ( int  id) const
inlineoverridevirtual

Set the selected type.

Implements PickerCallbacks.

Definition at line 1240 of file road_gui.cpp.

References RoadStopPickerSelection::sel_type.


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