41struct CHTSChunkHandler : ChunkHandler {
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(WindowPosition::Automatic, "cheats", 0, 0, WindowClass::Cheat, WindowClass::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.
@ StationRatingCheat
Saveload version: 320, GitHub pull request: 11346 Add cheat to fix station ratings at 100%.
@ TableChunks
Saveload version: 295, GitHub pull request: 9322 Introduction of ChunkType::Table and ChunkType::Spa...
@ MaxVersion
Highest possible saveload version.
@ RiffToArray
Saveload version: 294, GitHub pull request: 9375 Changed many ChunkType::Riff chunks to ChunkType::A...
@ Table
An Array with a header describing the elements.
#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.
static constexpr VarType BOOL
Store a boolean (as int8).