OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

Functions | Variables
story_sl.cpp File Reference

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

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

## Function Documentation

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(), and IsSavegameVersionBefore().

Referenced by AfterLoadGame().

## Variable Documentation

const ChunkHandler _story_page_chunk_handlers[]

Initial value:
{
{ 'STPE', Save_STORY_PAGE_ELEMENT, Load_STORY_PAGE_ELEMENT, NULL, NULL, CH_ARRAY},
{ 'STPA', Save_STORY_PAGE, Load_STORY_PAGE, NULL, NULL, CH_ARRAY | CH_LAST},
}

const SaveLoad _story_page_elements_desc[]
| static

Initial value:
{
SLE_CONDVAR(StoryPageElement, sort_value, SLE_FILE_U16 | SLE_VAR_U32, 0, 184),
SLE_CONDVAR(StoryPageElement, sort_value, SLE_UINT32, 185, SL_MAX_VERSION),
SLE_VAR(StoryPageElement, page, SLE_UINT16),
SLE_CONDVAR(StoryPageElement, type, SLE_FILE_U16 | SLE_VAR_U8, 0, 184),
SLE_CONDVAR(StoryPageElement, type, SLE_UINT8, 185, SL_MAX_VERSION),
SLE_VAR(StoryPageElement, referenced_id, SLE_UINT32),
SLE_STR(StoryPageElement, text, SLE_STR | SLF_ALLOW_CONTROL, 0),
}

Definition at line 31 of file story_sl.cpp.

const SaveLoad _story_pages_desc[]
| static

Initial value:
{
SLE_CONDVAR(StoryPage, sort_value, SLE_FILE_U16 | SLE_VAR_U32, 0, 184),
SLE_CONDVAR(StoryPage, sort_value, SLE_UINT32, 185, SL_MAX_VERSION),
SLE_VAR(StoryPage, date, SLE_UINT32),
SLE_CONDVAR(StoryPage, company, SLE_FILE_U16 | SLE_VAR_U8, 0, 184),
SLE_CONDVAR(StoryPage, company, SLE_UINT8, 185, SL_MAX_VERSION),
SLE_STR(StoryPage, title, SLE_STR | SLF_ALLOW_CONTROL, 0),
}

Definition at line 68 of file story_sl.cpp.