OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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...
 
bool init (int argc, char *argv[])
 Handles the initialization of setting up default options and finding and loading any existing ones. More...
 
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 updateOptions ()
 Updates the game's options with those in the configuation file, if it exists yet, and any supplied on the command line. More...
 
void load (const std::string &filename)
 Loads options from a YAML file. More...
 
void 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...
 
const std::vector< OptionInfo > & getOptionInfo ()
 Returns the game's list of all available option information. 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

void OpenXcom::Options::backupDisplay ( )

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

Backup display options.

void OpenXcom::Options::create ( )

Sets up the options by creating their OptionInfo metadata.

Creates the options info.

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.
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.
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.
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.
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.
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
Was initialized.
void OpenXcom::Options::load ( const std::string &  filename)

Loads options from a YAML file.

Loads options from YAML.

Parameters
filenameYAML filename.
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.
void OpenXcom::Options::resetDefault ( )

Resets the options back to their defaults.

Restores default options.

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

Saves options to a YAML file.

Saves options to YAML.

Parameters
filenameYAML filename.
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.
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.

void OpenXcom::Options::switchDisplay ( )

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

Switches display options.

void OpenXcom::Options::updateOptions ( )

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

Update game options from config file and command line.