Nuclide
Software Development Kit for id Tech
|
Locally-installed games, modification control functions. More...
Classes | |
struct | gameEntry_t |
Data holding Game Library entries. More... | |
Enumerations | |
enum | gameInfo_t { GAMEINFO_TITLE , GAMEINFO_GAMEDIR , GAMEINFO_FALLBACKDIR , GAMEINFO_BASEDIR , GAMEINFO_WEBSITE , GAMEINFO_VERSION , GAMEINFO_SIZE , GAMEINFO_TYPE , GAMEINFO_NOPLAYERMODELS , GAMEINFO_NOSPRAYS , GAMEINFO_STARTMAP , GAMEINFO_TRAININGMAP , GAMEINFO_MINVERSION , GAMEINFO_CHATROOM , GAMEINFO_READMEFILE , GAMEINFO_INTROVIDEO , GAMEINFO_MENUMAP , GAMEINFO_AUTHOR , GAMEINFO_AUTHORSITE , GAMEINFO_PACKAGELIST , GAMEINFO_INSTALLED } |
Options for querying Game Library entry information using GameLibrary_GetInfo() More... | |
enum | gi_type { GAMEINFO_NONE , GAMEINFO_MANIFEST , GAMEINFO_GITXT , GAMEINFO_LIBLIST , GAMEINFO_PACKAGE } |
Functions | |
void | GameLibrary_Init (void) |
Called when initializing the current game. More... | |
void | GameLibrary_InitCustom (void) |
Called when you want to initialize custom games/mods. More... | |
void | GameLibrary_Install (int) |
Install the specified game. More... | |
void | GameLibrary_Activate (int) |
Activate the specified game. More... | |
void | GameLibrary_Deactivate (void) |
Deactivate the currently running mod. More... | |
bool | GameLibrary_IsInstalling (void) |
Returns true/false depending on if a Game installation is in progress. More... | |
float | GameLibrary_InstallProgress (void) |
Returns a 0-100% value of game install progress, tracking across multiple packages. More... | |
int | GameLibrary_GetGameCount (void) |
Returns the total amount of games currently available. More... | |
int | GameLibrary_GetCurrentGame (void) |
Return the ID for the currently active game. More... | |
__variant | GameLibrary_GetGameInfo (int, gameInfo_t) |
Retrieves fields for a given game. More... | |
__variant | GameLibrary_GetInfo (gameInfo_t) |
Retrieves fields for the currently running game. More... | |
void | GameLibrary_DebugList (void) |
Prints debug info about the currently cached games to the console. More... | |
Locally-installed games, modification control functions.
The GameLibrary concerns itself with everything around what a game is, how to install, activate and deactivate it. Mods are included in this, so we'll proceed calling them 'games' or 'custom games'.
A game can be installed through two primary means:
And between these, they can come with different metadata/manifests.
It assumed that every game has either a FTE Manifest description, a gameinfo.txt (Source Engine format) or liblist.gam (GoldSrc format) that describes various aspects of the game. Like which version it is, what map will be loaded when you press 'New Game' and so on.
If that info is not available, some placeholder data will be used instead. However, games installed via the package manager will at least for the custom game menus not use the on-disk manifest file, but information provided by the package manager. Once you switch into said game everything within will be pulled from a file on disk, such as a liblist.gam or gameinfo.txt.
The menu needs to call GameLibrary_Init() once for parsing the currently running game its own metadata. If you want to index custom games, aka mods, you need to do so with GameLibrary_InitCustom() afterwards.
Because indexing mods can take a very long time depending on the amount that is stored on disk, you may want to call GameLibrary_InitCustom() at a later time.
enum gameInfo_t |
Options for querying Game Library entry information using GameLibrary_GetInfo()
enum gi_type |
void GameLibrary_Activate | ( | int | gameID | ) |
Activate the specified game.
Deactivate the currently running mod.
Switching back to the base game.
Prints debug info about the currently cached games to the console.
int GameLibrary_GetCurrentGame | ( | void | ) |
Return the ID for the currently active game.
int GameLibrary_GetGameCount | ( | void | ) |
Returns the total amount of games currently available.
__variant GameLibrary_GetGameInfo | ( | int | gameID, |
gameInfo_t | infoType | ||
) |
Retrieves fields for a given game.
See gameInfo_t for a list of fields you can query.
__variant GameLibrary_GetInfo | ( | gameInfo_t | infoType | ) |
Retrieves fields for the currently running game.
See gameInfo_t for a list of fields you can query.
Called when initializing the current game.
Does not cache custom game/mod info.
Called when you want to initialize custom games/mods.
Might want to call this later if the amount of locally installed mods is overwhelming.
void GameLibrary_Install | ( | int | gameID | ) |
Install the specified game.
Returns a 0-100% value of game install progress, tracking across multiple packages.
bool GameLibrary_IsInstalling | ( | void | ) |
Returns true/false depending on if a Game installation is in progress.