41struct CHTSChunkHandler : ChunkHandler {
42 CHTSChunkHandler() : ChunkHandler(
'CHTS', CH_TABLE) {}
58 std::vector<SaveLoad> oslt;
64 for (
auto &sld : slt) {
68 if (count == 0)
break;
70 slt = std::move(oslt);
Cheats _cheats
All the cheats.
static WindowDesc _cheats_desc(WDP_AUTO, "cheats", 0, 0, WC_CHEATS, WC_NONE, {}, _nested_cheat_widgets)
Window description of the cheats GUI.
Loading for cheat chunks before table headers were added.
const SaveLoadCompat _cheats_sl_compat[]
Original field order for _cheats_desc.
Types related to cheating.
A number of safeguards to prevent using unsafe methods.
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.
size_t SlGetFieldLength()
Get the length of the current object.
void SlErrorCorrupt(const std::string &msg)
Error handler for corrupt savegames.
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.
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.
@ SLV_RIFF_TO_ARRAY
294 PR#9375 Changed many CH_RIFF chunks to CH_ARRAY chunks.
@ SL_MAX_VERSION
Highest possible saveload version.
@ SLV_STATION_RATING_CHEAT
320 PR#11346 Add cheat to fix station ratings at 100%.
@ SLV_TABLE_CHUNKS
295 PR#9322 Introduction of CH_TABLE and CH_SPARSE_TABLE.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition of base types and functions in a cross-platform compatible way.
void Save() const override
Save the chunk.
void Load() const override
Load the chunk.