OpenTTD Source  1.11.2
story_sl.cpp File Reference
#include "../stdafx.h"
#include "../story_base.h"
#include "saveload.h"
#include "../safeguards.h"

Go to the source code of this file.

Functions

void AfterLoadStoryBook ()
 Called after load to trash broken pages.
 
static void Save_STORY_PAGE_ELEMENT ()
 
static void Load_STORY_PAGE_ELEMENT ()
 
static void Save_STORY_PAGE ()
 
static void Load_STORY_PAGE ()
 

Variables

static const SaveLoad _story_page_elements_desc []
 
static const SaveLoad _story_pages_desc []
 
const ChunkHandler _story_page_chunk_handlers []
 

Detailed Description

Code handling saving and loading of story pages

Definition in file story_sl.cpp.

Variable Documentation

◆ _story_page_chunk_handlers

const ChunkHandler _story_page_chunk_handlers[]
Initial value:
= {
{ 'STPE', Save_STORY_PAGE_ELEMENT, Load_STORY_PAGE_ELEMENT, nullptr, nullptr, CH_ARRAY},
{ 'STPA', Save_STORY_PAGE, Load_STORY_PAGE, nullptr, nullptr, CH_ARRAY | CH_LAST},
}

◆ _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),
}

Definition at line 29 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),
}

Definition at line 65 of file story_sl.cpp.

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:552
SLE_STR
#define SLE_STR(base, variable, type, length)
Storage of a string in every savegame version.
Definition: saveload.h:648
CH_LAST
@ CH_LAST
Last chunk in this array.
Definition: saveload.h:411
SLF_ALLOW_CONTROL
@ SLF_ALLOW_CONTROL
allow control codes in the strings
Definition: saveload.h:490
StoryPage
Struct about stories, current and completed.
Definition: story_base.h:159
SL_MAX_VERSION
@ SL_MAX_VERSION
Highest possible saveload version.
Definition: saveload.h:329
SLE_VAR
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:622
StoryPageElement
Struct about story page elements.
Definition: story_base.h:139
SLV_185
@ SLV_185
185 25620 Storybooks
Definition: saveload.h:265