OpenTTD Source 20241224-master-gf74b0cf984
story_sl.cpp File Reference

Code handling saving and loading of story pages. More...

#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.

Function Documentation

◆ AfterLoadStoryBook()

void AfterLoadStoryBook ( )

Called after load to trash broken pages.

Definition at line 20 of file story_sl.cpp.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::CleanPool(), IsSavegameVersionBefore(), and SLV_185.

Referenced by AfterLoadGame().

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_VAR(StoryPageElement, referenced_id, SLE_UINT32),
}
@ SLF_ALLOW_CONTROL
Allow control codes in the strings.
Definition saveload.h:688
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition saveload.h:868
#define SLE_SSTR(base, variable, type)
Storage of a std::string in every savegame version.
Definition saveload.h:1046
@ SL_MAX_VERSION
Highest possible saveload version.
Definition saveload.h:399
@ SL_MIN_VERSION
First savegame version.
Definition saveload.h:31
@ SLV_185
185 25620 Storybooks
Definition saveload.h:265
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition saveload.h:1002
Struct about story page elements.
Definition story_base.h:144

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),
}
Struct about stories, current and completed.
Definition story_base.h:164

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.

◆ STPA

const STPAChunkHandler STPA
static

Definition at line 117 of file story_sl.cpp.

◆ STPE

const STPEChunkHandler STPE
static

Definition at line 116 of file story_sl.cpp.