OpenXcom  1.0
Open-source clone of the original X-Com
Functions
OpenXcom::Options Namespace Reference

Container for all the various global game options and customizable settings. More...

Functions

void create ()
 Sets up the options by creating their OptionInfo metadata. More...
 
void resetDefault ()
 Resets the options back to their defaults. More...
 
void loadArgs (int argc, char *argv[])
 Loads options from a set of command line arguments, in the format "-option value". More...
 
const std::map< std::string, ModInfo > & getModInfos ()
 Gets the map of mod ids to mod infos.
 
bool init (int argc, char *argv[])
 Handles the initialization of setting up default options and finding and loading any existing ones. More...
 
void updateMods ()
 Refreshes the mods and filemaps.
 
std::string getActiveMaster ()
 Gets the currently active master mod. More...
 
void updateReservedSpace ()
 Updates the reservedSpace for master mods if necessary.
 
void mapResources ()
 Maps resources in active mods to the virtual file system.
 
void setFolders ()
 Sets up the game's Data folder where the data files are loaded from and the User folder and Config folder where settings and saves are stored in. More...
 
void userSplitMasters ()
 Splits the game's User folder by master mod, creating a subfolder for each one and moving the apppropriate user data among them. More...
 
void updateOptions ()
 Updates the game's options with those in the configuration file, if it exists yet, and any supplied on the command line. More...
 
bool load (const std::string &filename)
 Loads options from a YAML file. More...
 
bool save (const std::string &filename)
 Saves options to a YAML file. More...
 
std::string getDataFolder ()
 Returns the game's current Data folder where resources and X-Com files are loaded from. More...
 
void setDataFolder (const std::string &folder)
 Changes the game's current Data folder where resources and X-Com files are loaded from. More...
 
const std::vector< std::string > & getDataList ()
 Returns the game's list of possible Data folders. More...
 
std::string getUserFolder ()
 Returns the game's User folder where saves are stored in. More...
 
std::string getConfigFolder ()
 Returns the game's Config folder where settings are stored in. More...
 
std::string getMasterUserFolder ()
 Returns the game's User folder for the currently loaded master mod. More...
 
const std::vector< OptionInfo > & getOptionInfo ()
 Returns the game's list of all available option information. More...
 
std::vector< const ModInfo * > getActiveMods ()
 Returns a list of currently active mods. More...
 
void backupDisplay ()
 Saves display settings temporarily to be able to revert to old ones. More...
 
void switchDisplay ()
 Switches old/new display options for temporarily testing a new display setup. More...
 

Detailed Description

Container for all the various global game options and customizable settings.

Function Documentation

◆ backupDisplay()

void OpenXcom::Options::backupDisplay ( )

Saves display settings temporarily to be able to revert to old ones.

Backup display options.

◆ create()

void OpenXcom::Options::create ( )

Sets up the options by creating their OptionInfo metadata.

Creates the options info.

◆ getActiveMaster()

std::string OpenXcom::Options::getActiveMaster ( )

Gets the currently active master mod.

returns the id of the active master mod

Returns
Mod id.

◆ getActiveMods()

std::vector< const ModInfo * > OpenXcom::Options::getActiveMods ( )

Returns a list of currently active mods.

Gets the list of currently active mods.

They must be enabled and activable.

See also
ModInfo::canActivate
Returns
List of info for the active mods.

◆ getConfigFolder()

std::string OpenXcom::Options::getConfigFolder ( )

Returns the game's Config folder where settings are stored in.

Gets the game's config folder.

Normally the same as the User folder.

Returns
Full path to Config folder.

◆ getDataFolder()

std::string OpenXcom::Options::getDataFolder ( )

Returns the game's current Data folder where resources and X-Com files are loaded from.

Gets the game's data folder.

Returns
Full path to Data folder.

◆ getDataList()

const std::vector< std::string > & OpenXcom::Options::getDataList ( )

Returns the game's list of possible Data folders.

Gets the game's data list.

Returns
List of Data paths.

◆ getMasterUserFolder()

std::string OpenXcom::Options::getMasterUserFolder ( )

Returns the game's User folder for the currently loaded master mod.

Gets the game's master mod user folder.

Returns
Full path to User folder.

◆ getOptionInfo()

const std::vector< OptionInfo > & OpenXcom::Options::getOptionInfo ( )

Returns the game's list of all available option information.

Gets the game's options.

Returns
List of OptionInfo's.

◆ getUserFolder()

std::string OpenXcom::Options::getUserFolder ( )

Returns the game's User folder where saves are stored in.

Gets the game's user folder.

Returns
Full path to User folder.

◆ init()

bool OpenXcom::Options::init ( int  argc,
char *  argv[] 
)

Handles the initialization of setting up default options and finding and loading any existing ones.

Initializes the options settings.

Parameters
argcNumber of arguments.
argvArray of argument strings.
Returns
Do we start the game?

◆ load()

bool OpenXcom::Options::load ( const std::string &  filename)

Loads options from a YAML file.

Loads options from YAML.

Parameters
filenameYAML filename.
Returns
Was the loading successful?

◆ loadArgs()

void OpenXcom::Options::loadArgs ( int  argc,
char *  argv[] 
)

Loads options from a set of command line arguments, in the format "-option value".

Parameters
argcNumber of arguments.
argvArray of argument strings.

◆ resetDefault()

void OpenXcom::Options::resetDefault ( )

Resets the options back to their defaults.

Restores default options.

◆ save()

bool OpenXcom::Options::save ( const std::string &  filename)

Saves options to a YAML file.

Saves options to YAML.

Parameters
filenameYAML filename.
Returns
Was the saving successful?

◆ setDataFolder()

void OpenXcom::Options::setDataFolder ( const std::string &  folder)

Changes the game's current Data folder where resources and X-Com files are loaded from.

Sets the game's data folder.

Parameters
folderFull path to Data folder.

◆ setFolders()

void OpenXcom::Options::setFolders ( )

Sets up the game's Data folder where the data files are loaded from and the User folder and Config folder where settings and saves are stored in.

Sets the game's data, user and config folders.

◆ switchDisplay()

void OpenXcom::Options::switchDisplay ( )

Switches old/new display options for temporarily testing a new display setup.

Switches display options.

◆ updateOptions()

void OpenXcom::Options::updateOptions ( )

Updates the game's options with those in the configuration file, if it exists yet, and any supplied on the command line.

Update game options from config file and command line.

◆ userSplitMasters()

void OpenXcom::Options::userSplitMasters ( )

Splits the game's User folder by master mod, creating a subfolder for each one and moving the apppropriate user data among them.

Sets the game's user master folders.