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