10#ifndef SAVELOAD_FUNC_H
11#define SAVELOAD_FUNC_H
Container for an encoded string, created by GetEncodedString.
Types for standard in/out file operations.
SaveLoadOperation
Operation performed on the file.
@ Load
File is being loaded.
DetailedFileType
Kinds of files in each AbstractFileType.
Subdirectory
The different kinds of subdirectories OpenTTD uses.
Declarations for savegames operations.
std::string _savegame_format
how to compress savegames
bool _do_autosave
are we doing an autosave at the moment?
SaveLoadResult SaveWithFilter(std::shared_ptr< SaveFilter > writer, bool threaded)
Save the game using a (writer) filter.
FileToSaveLoad _file_to_saveload
File to save or load in the openttd loop.
SaveLoadResult LoadWithFilter(std::shared_ptr< LoadFilter > reader)
Load the game using a (reader) filter.
void ProcessAsyncSaveFinish()
Handle async save finishes.
void DoAutoOrNetsave(FiosNumberedSaveName &counter)
Create an autosave or netsave.
EncodedString GetSaveLoadErrorType()
Return the appropriate initial string for an error depending on whether we are saving or loading.
SaveLoadResult SaveOrLoad(std::string_view filename, SaveLoadOperation fop, DetailedFileType dft, Subdirectory sb, bool threaded=true)
Main Save or Load function where the high-level saveload functions are handled.
bool SaveloadCrashWithMissingNewGRFs()
Did loading the savegame cause a crash?
void DoExitSave()
Do a save when exiting the game (_settings_client.gui.autosave_on_exit).
EncodedString GetSaveLoadErrorMessage()
Return the description of the error.
std::string GenerateDefaultSaveName()
Get the default name for a savegame or screenshot.
Types often used outside the saveload code related to saving and loading games.
SaveLoadResult
Save or load result codes.
Deals with the type of the savegame, independent of extension.
void SetMode(const FiosType &ft, SaveLoadOperation fop=SaveLoadOperation::Load)
Set the mode and file type of the file to save or load.
SaveLoadOperation file_op
File operation to perform.
std::string name
Name of the file.
EncodedString title
Internal name of the game.
void Set(const FiosItem &item)
Set the mode, title and name of the file.
Deals with finding savegames.
A savegame name automatically numbered.
Elements of a file system that are recognized.