OpenTTD Source 20250312-master-gcdcc6b491d
StoryPageButtonData Struct Reference

Helper to construct packed "id" values for button-type StoryPageElement. More...

#include <story_base.h>

Public Member Functions

void SetColour (Colours button_colour)
 Set the button background colour.
 
void SetFlags (StoryPageButtonFlags flags)
 
void SetCursor (StoryPageButtonCursor cursor)
 Set the mouse cursor used while waiting for input for the button.
 
void SetVehicleType (VehicleType vehtype)
 Set the type of vehicles that are accepted by the button.
 
Colours GetColour () const
 Get the button background colour.
 
StoryPageButtonFlags GetFlags () const
 
StoryPageButtonCursor GetCursor () const
 Get the mouse cursor used while waiting for input for the button.
 
VehicleType GetVehicleType () const
 Get the type of vehicles that are accepted by the button.
 
bool ValidateColour () const
 Verify that the data stored a valid Colour value.
 
bool ValidateFlags () const
 
bool ValidateCursor () const
 Verify that the data stores a valid StoryPageButtonCursor value.
 
bool ValidateVehicleType () const
 Verity that the data stored a valid VehicleType value.
 

Data Fields

uint32_t referenced_id = 0
 

Detailed Description

Helper to construct packed "id" values for button-type StoryPageElement.

Definition at line 123 of file story_base.h.

Member Function Documentation

◆ GetColour()

Colours StoryPageButtonData::GetColour ( ) const

Get the button background colour.

Definition at line 156 of file story.cpp.

References GB(), and IsValidColours().

◆ GetCursor()

StoryPageButtonCursor StoryPageButtonData::GetCursor ( ) const

Get the mouse cursor used while waiting for input for the button.

Definition at line 169 of file story.cpp.

References GB(), and IsValidStoryPageButtonCursor().

◆ GetFlags()

StoryPageButtonFlags StoryPageButtonData::GetFlags ( ) const

Definition at line 163 of file story.cpp.

◆ GetVehicleType()

VehicleType StoryPageButtonData::GetVehicleType ( ) const

Get the type of vehicles that are accepted by the button.

Definition at line 177 of file story.cpp.

References GB().

◆ SetColour()

void StoryPageButtonData::SetColour ( Colours  button_colour)

Set the button background colour.

Definition at line 130 of file story.cpp.

References SB().

◆ SetCursor()

void StoryPageButtonData::SetCursor ( StoryPageButtonCursor  cursor)

Set the mouse cursor used while waiting for input for the button.

Definition at line 142 of file story.cpp.

References SB().

◆ SetFlags()

void StoryPageButtonData::SetFlags ( StoryPageButtonFlags  flags)

Definition at line 136 of file story.cpp.

◆ SetVehicleType()

void StoryPageButtonData::SetVehicleType ( VehicleType  vehtype)

Set the type of vehicles that are accepted by the button.

Definition at line 149 of file story.cpp.

References SB(), VEH_COMPANY_END, and VEH_INVALID.

◆ ValidateColour()

bool StoryPageButtonData::ValidateColour ( ) const

Verify that the data stored a valid Colour value.

Definition at line 183 of file story.cpp.

References GB().

◆ ValidateCursor()

bool StoryPageButtonData::ValidateCursor ( ) const

Verify that the data stores a valid StoryPageButtonCursor value.

Definition at line 199 of file story.cpp.

References GB().

◆ ValidateFlags()

bool StoryPageButtonData::ValidateFlags ( ) const

Definition at line 188 of file story.cpp.

◆ ValidateVehicleType()

bool StoryPageButtonData::ValidateVehicleType ( ) const

Verity that the data stored a valid VehicleType value.

Definition at line 205 of file story.cpp.

References GB(), VEH_COMPANY_END, and VEH_INVALID.

Field Documentation

◆ referenced_id

uint32_t StoryPageButtonData::referenced_id = 0

Definition at line 124 of file story_base.h.


The documentation for this struct was generated from the following files: