OpenTTD Source
20240919-master-gdf0233f4c2
|
Go to the documentation of this file.
10 #include "../stdafx.h"
15 #include "../story_base.h"
17 #include "../safeguards.h"
31 static const SaveLoad _story_page_elements_desc[] = {
49 SlSetArrayIndex(s->index);
50 SlObject(s, _story_page_elements_desc);
59 uint32_t max_sort_value = 0;
70 _story_page_element_next_sort_value = max_sort_value + 1;
74 static const SaveLoad _story_pages_desc[] = {
91 SlSetArrayIndex(s->index);
101 uint32_t max_sort_value = 0;
112 _story_page_next_sort_value = max_sort_value + 1;
123 extern const ChunkHandlerTable _story_page_chunk_handlers(story_page_chunk_handlers);
void AfterLoadStoryBook()
Called after load to trash broken pages.
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
@ SLV_185
185 25620 Storybooks
@ SL_MIN_VERSION
First savegame version.
void Load() const override
Load the chunk.
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Handlers and description of chunk.
const SaveLoadCompat _story_pages_sl_compat[]
Original field order for _story_pages_desc.
const SaveLoadCompat _story_page_elements_sl_compat[]
Original field order for _story_page_elements_desc.
void Save() const override
Save the chunk.
@ SLF_ALLOW_CONTROL
Allow control codes in the strings.
Struct about stories, current and completed.
@ SL_MAX_VERSION
Highest possible saveload version.
void CleanPool() override
Virtual method that deletes all items in the pool.
void Save() const override
Save the chunk.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
static Pool::IterateWrapper< Titem > Iterate(size_t from=0)
Returns an iterable ensemble of all valid Titem.
uint32_t sort_value
A number that increases for every created story page. Used for sorting. The id of a story page is the...
Struct about story page elements.
std::span< const ChunkHandlerRef > ChunkHandlerTable
A table of ChunkHandler entries.
#define SLE_SSTR(base, variable, type)
Storage of a std::string in every savegame version.
std::vector< SaveLoad > SlCompatTableHeader(const SaveLoadTable &slt, const SaveLoadCompatTable &slct)
Load a table header in a savegame compatible way.
void Load() const override
Load the chunk.
void SlObject(void *object, const SaveLoadTable &slt)
Main SaveLoad function.
bool IsSavegameVersionBefore(SaveLoadVersion major, uint8_t minor=0)
Checks whether the savegame is below major.
std::vector< SaveLoad > SlTableHeader(const SaveLoadTable &slt)
Save or Load a table header.
uint32_t sort_value
A number that increases for every created story page element. Used for sorting. The id of a story pag...
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.