Nuclide
Software Development Kit for id Technology
gamelibrary.h
1/*
2 * Copyright (c) 2016-2023 Vera Visions LLC.
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16
56typedef enum
57{
82
84void GameLibrary_Init(void);
87void GameLibrary_InitCustom(void);
88
90void GameLibrary_Install(int);
92void GameLibrary_Activate(int);
94void GameLibrary_Deactivate(void);
95
105__variant GameLibrary_GetGameInfo(int, gameInfo_t);
108
110void GameLibrary_DebugList(void);
111
112typedef enum
113{
119} gi_type;
120
122typedef struct
123{
124 string game;
125 string title;
126 string subtitle;
127 string gamedir;
128 string base_dir;
129 string url_info;
130 string url_dl;
131 string version;
132 string readme;
133 int size;
135 int cldll;
136 string type;
138 string pkgname;
139 string pkgfile;
140 int pkgid;
144 string mpentity;
145 string gamedll;
146 string startmap;
149 string chatroom;
150 string menumap;
154
155#ifndef DOXYGEN
156int gameinfo_count;
157gameEntry_t *games;
158#endif
159 // end of gamelibrary
void GameLibrary_Activate(int)
Activate the specified game.
Definition: gamelibrary.qc:726
__variant GameLibrary_GetInfo(gameInfo_t)
Retrieves fields for the currently running game.
Definition: gamelibrary.qc:776
gameInfo_t
Options for querying Game Library entry information using GameLibrary_GetInfo()
Definition: gamelibrary.h:57
void GameLibrary_DebugList(void)
Prints debug info about the currently cached games to the console.
Definition: gamelibrary.qc:864
__variant GameLibrary_GetGameInfo(int, gameInfo_t)
Retrieves fields for a given game.
Definition: gamelibrary.qc:782
float GameLibrary_InstallProgress(void)
Returns a 0-100% value of game install progress, tracking across multiple packages.
Definition: gamelibrary.qc:633
bool GameLibrary_IsInstalling(void)
Returns true/false depending on if a Game installation is in progress.
Definition: gamelibrary.qc:627
gi_type
Definition: gamelibrary.h:113
void GameLibrary_InitCustom(void)
Called when you want to initialize custom games/mods.
Definition: gamelibrary.qc:454
int GameLibrary_GetCurrentGame(void)
Return the ID for the currently active game.
Definition: gamelibrary.qc:764
void GameLibrary_Install(int)
Install the specified game.
Definition: gamelibrary.qc:704
void GameLibrary_Init(void)
Called when initializing the current game.
Definition: gamelibrary.qc:575
int GameLibrary_GetGameCount(void)
Returns the total amount of games currently available.
Definition: gamelibrary.qc:770
void GameLibrary_Deactivate(void)
Deactivate the currently running mod.
Definition: gamelibrary.qc:754
@ GAMEINFO_AUTHOR
(string) Name of the author.
Definition: gamelibrary.h:77
@ GAMEINFO_STARTMAP
(string) The command for starting a new game.
Definition: gamelibrary.h:70
@ GAMEINFO_INTROVIDEO
(string) File name of the intro video to play.
Definition: gamelibrary.h:75
@ GAMEINFO_TRAININGMAP
(string) The command for starting the training.
Definition: gamelibrary.h:71
@ GAMEINFO_NOPLAYERMODELS
(bool) If the game allows player model selection.
Definition: gamelibrary.h:68
@ GAMEINFO_MINVERSION
(string) The minimum base game version.
Definition: gamelibrary.h:72
@ GAMEINFO_NOSPRAYS
(bool) If the game allows custom spray logos.
Definition: gamelibrary.h:69
@ GAMEINFO_WEBSITE
(string) The game its official website.
Definition: gamelibrary.h:62
@ GAMEINFO_FALLBACKDIR
(string) The directory to be loaded before the game directory.
Definition: gamelibrary.h:60
@ GAMEINFO_TITLE
(string) The title of the game in the main menu.
Definition: gamelibrary.h:65
@ GAMEINFO_NAME
(string) The name of the game.
Definition: gamelibrary.h:58
@ GAMEINFO_GAMEDIR
(string) The game directory name.
Definition: gamelibrary.h:59
@ GAMEINFO_INSTALLED
(bool) Whether the game is installed.
Definition: gamelibrary.h:80
@ GAMEINFO_PACKAGELIST
(string) List of packages, separated by white-space.
Definition: gamelibrary.h:79
@ GAMEINFO_CHATROOM
(string) The chatroom for this game.
Definition: gamelibrary.h:73
@ GAMEINFO_VERSION
(string) Version number string.
Definition: gamelibrary.h:63
@ GAMEINFO_SIZE
(int) The size of the game, in bytes.
Definition: gamelibrary.h:64
@ GAMEINFO_READMEFILE
(string) File name of the readme documentation.
Definition: gamelibrary.h:74
@ GAMEINFO_TYPE
(string) The game type.
Definition: gamelibrary.h:67
@ GAMEINFO_AUTHORSITE
(string) The author their website.
Definition: gamelibrary.h:78
@ GAMEINFO_MENUMAP
(string) Name of the map to be used as a background.
Definition: gamelibrary.h:76
@ GAMEINFO_SUBTITLE
(string) The sub-title of the game in the main menu.
Definition: gamelibrary.h:66
@ GAMEINFO_BASEDIR
(string) The first game directory to be loaded.
Definition: gamelibrary.h:61
@ GAMEINFO_MANIFEST
Game info was read from a manifest within the path.
Definition: gamelibrary.h:115
@ GAMEINFO_PACKAGE
Definition: gamelibrary.h:118
@ GAMEINFO_GITXT
Game info stems from a Source Engine style gameinfo.txt file.
Definition: gamelibrary.h:116
@ GAMEINFO_LIBLIST
Game info stems from a GoldSrc style liblist.gam file.
Definition: gamelibrary.h:117
@ GAMEINFO_NONE
No gameinfo available.
Definition: gamelibrary.h:114
Data holding Game Library entries.
Definition: gamelibrary.h:123
string subtitle
Definition: gamelibrary.h:126
string type
Definition: gamelibrary.h:136
string title
Definition: gamelibrary.h:125
string gamedir
Definition: gamelibrary.h:127
gi_type info_type
Definition: gamelibrary.h:152
int svonly
Definition: gamelibrary.h:134
string game
Definition: gamelibrary.h:124
int nomodels
Definition: gamelibrary.h:141
string menumap
Definition: gamelibrary.h:150
string introvideo
Definition: gamelibrary.h:151
string readme
Definition: gamelibrary.h:132
string pkgname
Definition: gamelibrary.h:138
string version
Definition: gamelibrary.h:131
int nosprays
Definition: gamelibrary.h:142
string mpentity
Definition: gamelibrary.h:144
string chatroom
Definition: gamelibrary.h:149
int pkgid
Definition: gamelibrary.h:140
string base_dir
Definition: gamelibrary.h:128
int size
Definition: gamelibrary.h:133
string minversion
Definition: gamelibrary.h:137
string pkgfile
Definition: gamelibrary.h:139
string url_dl
Definition: gamelibrary.h:130
string startmap
Definition: gamelibrary.h:146
string trainingmap
Definition: gamelibrary.h:147
string gamedll
Definition: gamelibrary.h:145
int installed
Definition: gamelibrary.h:143
int cldll
Definition: gamelibrary.h:135
string fallback_dir
Definition: gamelibrary.h:148
string url_info
Definition: gamelibrary.h:129