OpenTTD Source: src/saveload/story_sl.cpp File Reference

OpenTTD Source 14.1

Data Structures | Functions | Variables
story_sl.cpp File Reference
`#include "../stdafx.h"`
`#include "saveload.h"`
`#include "compat/story_sl_compat.h"`
`#include "../story_base.h"`
`#include "../safeguards.h"`

Go to the source code of this file.

## Data Structures
struct | STPEChunkHandler
struct | STPAChunkHandler

## Functions
void | AfterLoadStoryBook ()
| Called after load to trash broken pages.
const ChunkHandlerTable | _story_page_chunk_handlers (story_page_chunk_handlers)

## Variables
static const SaveLoad | _story_page_elements_desc []
static const SaveLoad | _story_pages_desc []
static const STPEChunkHandler | STPE
static const STPAChunkHandler | STPA
static const ChunkHandlerRef | story_page_chunk_handlers []

## Detailed Description

Code handling saving and loading of story pages

Definition in file story_sl.cpp.

## Variable Documentation

## ◆ _story_page_elements_desc

const SaveLoad _story_page_elements_desc[]
| static

Initial value:
= {
SLE_CONDVAR(StoryPageElement, sort_value, SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_185),
SLE_CONDVAR(StoryPageElement, sort_value, SLE_UINT32, SLV_185, SL_MAX_VERSION),
SLE_VAR(StoryPageElement, page, SLE_UINT16),
SLE_CONDVAR(StoryPageElement, type, SLE_FILE_U16 | SLE_VAR_U8, SL_MIN_VERSION, SLV_185),
SLE_CONDVAR(StoryPageElement, type, SLE_UINT8, SLV_185, SL_MAX_VERSION),
SLE_VAR(StoryPageElement, referenced_id, SLE_UINT32),
SLE_SSTR(StoryPageElement, text, SLE_STR | SLF_ALLOW_CONTROL),
}

Definition at line 31 of file story_sl.cpp.

## ◆ _story_pages_desc

const SaveLoad _story_pages_desc[]
| static

Initial value:
= {
SLE_CONDVAR(StoryPage, sort_value, SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_185),
SLE_CONDVAR(StoryPage, sort_value, SLE_UINT32, SLV_185, SL_MAX_VERSION),
SLE_VAR(StoryPage, date, SLE_UINT32),
SLE_CONDVAR(StoryPage, company, SLE_FILE_U16 | SLE_VAR_U8, SL_MIN_VERSION, SLV_185),
SLE_CONDVAR(StoryPage, company, SLE_UINT8, SLV_185, SL_MAX_VERSION),
SLE_SSTR(StoryPage, title, SLE_STR | SLF_ALLOW_CONTROL),
}

Definition at line 74 of file story_sl.cpp.

## ◆ story_page_chunk_handlers

const ChunkHandlerRef story_page_chunk_handlers[]
| static

Initial value:
= {
STPE,
STPA,
}

Definition at line 118 of file story_sl.cpp.

SLV_185
@ SLV_185
185 25620 Storybooks
Definition: saveload.h:265
SL_MIN_VERSION
@ SL_MIN_VERSION
First savegame version.
Definition: saveload.h:31
SLE_CONDVAR
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition: saveload.h:848
SLF_ALLOW_CONTROL
@ SLF_ALLOW_CONTROL
Allow control codes in the strings.
Definition: saveload.h:670
StoryPage
Struct about stories, current and completed.
Definition: story_base.h:164
SL_MAX_VERSION
@ SL_MAX_VERSION
Highest possible saveload version.
Definition: saveload.h:382
SLE_VAR
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:952
StoryPageElement
Struct about story page elements.
Definition: story_base.h:144
SLE_SSTR
#define SLE_SSTR(base, variable, type)
Storage of a std::string in every savegame version.
Definition: saveload.h:996