OpenTTD Source 20260606-master-ga894ddf665
story_base.h File Reference

StoryPage base class. More...

#include "company_type.h"
#include "story_type.h"
#include "strings_type.h"
#include "timer/timer_game_calendar.h"
#include "gfx_type.h"
#include "vehicle_type.h"
#include "core/pool_type.hpp"

Go to the source code of this file.

Data Structures

struct  StoryPageButtonData
 Helper to construct packed "id" values for button-type StoryPageElement. More...
struct  StoryPageElement
 Struct about story page elements. More...
struct  StoryPage
 Struct about stories, current and completed. More...

Typedefs

using StoryPageElementPool = Pool<StoryPageElement, StoryPageElementID, 64>
using StoryPagePool = Pool<StoryPage, StoryPageID, 64>
using StoryPageButtonFlags = EnumBitSet<StoryPageButtonFlag, uint8_t>
 Bitset of StoryPageButtonFlag elements.

Enumerations

enum class  StoryPageElementType : uint8_t {
  Text = 0 , Location , Goal , ButtonPush ,
  ButtonTile , ButtonVehicle , Invalid = 0xFF
}
 Each story page element is one of these types. More...
enum class  StoryPageButtonFlag : uint8_t { FloatLeft , FloatRight }
 Flags available for buttons. More...
enum class  StoryPageButtonCursor : uint8_t {
  Mouse , Zzz , Buoy , Query ,
  HQ , ShipDepot , Sign , Tree ,
  BuyLand , LevelLand , Town , Industry ,
  RockyArea , Desert , Transmitter , Airport ,
  Dock , Canal , Lock , River ,
  Aqueduct , Bridge , RailStation , TunnelRail ,
  TunnelElrail , TunnelMono , TunnelMaglev , AutoRail ,
  AutoElrail , AutoMono , AutoMaglev , Waypoint ,
  RailDepot , ElrailDepot , MonoDepot , MaglevDepot ,
  ConvertRail , ConvertElrail , ConvertMono , ConvertMaglev ,
  AutoRoad , AutoTram , RoadDepot , BusStation ,
  TruckStation , RoadTunnel , CloneTrain , CloneRoadVeh ,
  CloneShip , CloneAirplane , Demolish , LowerLand ,
  RaiseLand , PickStation , BuildSignals , End ,
  Invalid = 0xFF
}
 Mouse cursors usable by story page buttons. More...

Functions

bool IsValidStoryPageButtonCursor (StoryPageButtonCursor cursor)
 Checks if a StoryPageButtonCursor value is valid.

Variables

StoryPageElementPool _story_page_element_pool
StoryPagePool _story_page_pool
uint32_t _story_page_element_next_sort_value
uint32_t _story_page_next_sort_value

Detailed Description

StoryPage base class.

Definition in file story_base.h.

Typedef Documentation

◆ StoryPageButtonFlags

Bitset of StoryPageButtonFlag elements.

Definition at line 46 of file story_base.h.

◆ StoryPageElementPool

using StoryPageElementPool = Pool<StoryPageElement, StoryPageElementID, 64>

Definition at line 21 of file story_base.h.

◆ StoryPagePool

using StoryPagePool = Pool<StoryPage, StoryPageID, 64>

Definition at line 22 of file story_base.h.

Enumeration Type Documentation

◆ StoryPageButtonCursor

enum class StoryPageButtonCursor : uint8_t
strong

Mouse cursors usable by story page buttons.

Enumerator
Mouse 

Use the Mouse cursor.

Zzz 

Use the Zzz cursor.

Buoy 

Use the Buoy cursor.

Query 

Use the Query cursor.

HQ 

Use the HQ cursor.

ShipDepot 

Use the Ship Depot cursor.

Sign 

Use the Sign cursor.

Tree 

Use the Tree cursor.

BuyLand 

Use the Buy Land cursor.

LevelLand 

Use the Level Land cursor.

Town 

Use the Town cursor.

Industry 

Use the Industry cursor.

RockyArea 

Use the RockyArea cursor.

Desert 

Use the Desert cursor.

Transmitter 

Use the Transmitter cursor.

Airport 

Use the Airport cursor.

Dock 

Use the Dock cursor.

Canal 

Use the Canal cursor.

Lock 

Use the Lock cursor.

River 

Use the River cursor.

Aqueduct 

Use the Aqueduct cursor.

Bridge 

Use the Bridge cursor.

RailStation 

Use the Rail Station cursor.

TunnelRail 

Use the Tunnel Rail cursor.

TunnelElrail 

Use the Tunnel Elrail cursor.

TunnelMono 

Use the Tunnel Mono cursor.

TunnelMaglev 

Use the Tunnel Maglev cursor.

AutoRail 

Use the Auto Rail cursor.

AutoElrail 

Use the Auto Elrail cursor.

AutoMono 

Use the Auto Mono cursor.

AutoMaglev 

Use the Auto Maglev cursor.

Waypoint 

Use the Waypoint cursor.

RailDepot 

Use the Rail Depot cursor.

ElrailDepot 

Use the Elrail Depot cursor.

MonoDepot 

Use the Mono Depot cursor.

MaglevDepot 

Use the Maglev Depot cursor.

ConvertRail 

Use the Convert Rail cursor.

ConvertElrail 

Use the Convert Elrail cursor.

ConvertMono 

Use the Convert Mono cursor.

ConvertMaglev 

Use the Convert Maglev cursor.

AutoRoad 

Use the Auto Road cursor.

AutoTram 

Use the Auto Tram cursor.

RoadDepot 

Use the Road Depot cursor.

BusStation 

Use the Bus Station cursor.

TruckStation 

Use the Truck Station cursor.

RoadTunnel 

Use the Road Tunnel cursor.

CloneTrain 

Use the Clone Train cursor.

CloneRoadVeh 

Use the Clone Road Veh cursor.

CloneShip 

Use the Clone Ship cursor.

CloneAirplane 

Use the Clone Airplane cursor.

Demolish 

Use the Demolish cursor.

LowerLand 

Use the Lower Land cursor.

RaiseLand 

Use the Raise Land cursor.

PickStation 

Use the Pick Station cursor.

BuildSignals 

Use the Build Signals cursor.

End 

End marker.

Invalid 

Invalid story page button cursor.

Definition at line 49 of file story_base.h.

◆ StoryPageButtonFlag

enum class StoryPageButtonFlag : uint8_t
strong

Flags available for buttons.

Enumerator
FloatLeft 

Button will float on the left.

FloatRight 

Button will float on the right.

Definition at line 40 of file story_base.h.

◆ StoryPageElementType

enum class StoryPageElementType : uint8_t
strong

Each story page element is one of these types.

Enumerator
Text 

A text element.

Location 

An element that references a tile along with a one-line text.

Goal 

An element that references a goal.

ButtonPush 

A push button that triggers an immediate event.

ButtonTile 

A button that allows the player to select a tile, and triggers an event with the tile.

ButtonVehicle 

A button that allows the player to select a vehicle, and triggers an event with the vehicle.

Invalid 

Invalid story page element type.

Definition at line 29 of file story_base.h.

Function Documentation

◆ IsValidStoryPageButtonCursor()

bool IsValidStoryPageButtonCursor ( StoryPageButtonCursor cursor)
inline

Checks if a StoryPageButtonCursor value is valid.

Parameters
cursorThe value to check.
Returns
true if the given value is a valid StoryPageButtonCursor.

Definition at line 115 of file story_base.h.

References End.

Referenced by StoryPageButtonData::GetCursor().

Variable Documentation

◆ _story_page_element_next_sort_value

uint32_t _story_page_element_next_sort_value
extern

Definition at line 32 of file story.cpp.

◆ _story_page_next_sort_value

uint32_t _story_page_next_sort_value
extern

Definition at line 33 of file story.cpp.