OpenTTD Source: RoadWaypointPickerCallbacks Class Reference

OpenTTD Source 15.3

Public Member Functions | Static Public Attributes
RoadWaypointPickerCallbacks Class Reference
Inheritance diagram for RoadWaypointPickerCallbacks:

## 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.
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< RoadStopClass >
| PickerCallbacksNewGRFClass (const std::string &ini_group)
T::index_type | GetClassIndex (int cls_id) const
const RoadStopClass * | GetClass (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::set< PickerItem > | UpdateSavedItems (const 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)

## Static Public Attributes
static RoadWaypointPickerCallbacks | 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.
const std::string | ini_group
| Ini Group for saving favourites.
uint8_t | mode = 0
| Bitmask of `PickerFilterModes`.
int | preview_height = 0
| Previously adjusted height.
std::set< PickerItem > | used
| Set of items used in the current game by the current company.
std::set< PickerItem > | saved
| Set of saved favourite items.

## Detailed Description

Definition at line 1627 of file road_gui.cpp.

## Constructor & Destructor Documentation

## ◆ RoadWaypointPickerCallbacks()

RoadWaypointPickerCallbacks::RoadWaypointPickerCallbacks | ( |  | ) |
| inline

Definition at line 1629 of file road_gui.cpp.

## Member Function Documentation

## ◆ Close()

void RoadWaypointPickerCallbacks::Close | ( | int |  | ) |
| inlineoverridevirtual

Reimplemented from PickerCallbacks.

Definition at line 1652 of file road_gui.cpp.

## ◆ DrawType()

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

Draw preview image of an item.

Implements PickerCallbacks.

Definition at line 1684 of file road_gui.cpp.

References INVALID_RAILTYPE, and RSV_DRIVE_THROUGH_X.

## ◆ FillUsedItems()

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

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

Implements PickerCallbacks.

Definition at line 1694 of file road_gui.cpp.

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

## ◆ GetClassName()

StringID RoadWaypointPickerCallbacks::GetClassName | ( | int | id | ) | const
| inlineoverridevirtual

Get the name of a class.

Implements PickerCallbacks.

Definition at line 1656 of file road_gui.cpp.

References INVALID_STRING_ID, and IsWaypointClass().

## ◆ GetClassTooltip()

StringID RoadWaypointPickerCallbacks::GetClassTooltip | ( |  | ) | const
| inlineoverridevirtual

Get the tooltip string for the class list.

Implements PickerCallbacks.

Definition at line 1633 of file road_gui.cpp.

## ◆ GetFeature()

GrfSpecFeature RoadWaypointPickerCallbacks::GetFeature | ( |  | ) | const
| inlineoverridevirtual

Implements PickerCallbacks.

Definition at line 1631 of file road_gui.cpp.

## ◆ GetSelectedClass()

int RoadWaypointPickerCallbacks::GetSelectedClass | ( |  | ) | const
| inlineoverridevirtual

Get the index of the selected class.

Implements PickerCallbacks.

Definition at line 1653 of file road_gui.cpp.

References _waypoint_gui, and RoadWaypointPickerSelection::sel_class.

## ◆ GetSelectedType()

int RoadWaypointPickerCallbacks::GetSelectedType | ( |  | ) | const
| inlineoverridevirtual

Get the selected type.

Implements PickerCallbacks.

Definition at line 1663 of file road_gui.cpp.

References _waypoint_gui, and RoadWaypointPickerSelection::sel_type.

## ◆ GetTypeBadges()

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

Get the item of a type.

Implements PickerCallbacks.

Definition at line 1672 of file road_gui.cpp.

## ◆ GetTypeName()

StringID RoadWaypointPickerCallbacks::GetTypeName | ( | int | cls_id,
|  | int | id
| ) |  | const
| inlineoverridevirtual

Get the item of a type.

Implements PickerCallbacks.

Definition at line 1666 of file road_gui.cpp.

## ◆ GetTypeTooltip()

StringID RoadWaypointPickerCallbacks::GetTypeTooltip | ( |  | ) | const
| inlineoverridevirtual

Get the tooltip string for the type grid.

Implements PickerCallbacks.

Definition at line 1634 of file road_gui.cpp.

## ◆ HasClassChoice()

bool RoadWaypointPickerCallbacks::HasClassChoice | ( |  | ) | const
| inlineoverridevirtual

Are there multiple classes to chose from?

Reimplemented from PickerCallbacksNewGRFClass< RoadStopClass >.

Definition at line 1647 of file road_gui.cpp.

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

## ◆ IsActive()

bool RoadWaypointPickerCallbacks::IsActive | ( |  | ) | const
| inlineoverridevirtual

Should picker class/type selection be enabled?

Implements PickerCallbacks.

Definition at line 1636 of file road_gui.cpp.

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

## ◆ IsTypeAvailable()

bool RoadWaypointPickerCallbacks::IsTypeAvailable | ( | int | cls_id,
|  | int | id
| ) |  | const
| inlineoverridevirtual

Test if an item is currently buildable.

Implements PickerCallbacks.

Definition at line 1679 of file road_gui.cpp.

References IsRoadStopAvailable().

## ◆ SetSelectedClass()

void RoadWaypointPickerCallbacks::SetSelectedClass | ( | int | id | ) | const
| inlineoverridevirtual

Set the selected class.

Implements PickerCallbacks.

Definition at line 1654 of file road_gui.cpp.

References _waypoint_gui, and RoadWaypointPickerSelection::sel_class.

## ◆ SetSelectedType()

void RoadWaypointPickerCallbacks::SetSelectedType | ( | int | id | ) | const
| inlineoverridevirtual

Set the selected type.

Implements PickerCallbacks.

Definition at line 1664 of file road_gui.cpp.

References _waypoint_gui, and RoadWaypointPickerSelection::sel_type.

## Field Documentation

## ◆ instance

RoadWaypointPickerCallbacks RoadWaypointPickerCallbacks::instance
| static

Definition at line 1706 of file road_gui.cpp.

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

- src/road_gui.cpp