]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/common/mapinfo.qh
mapinfo: add a search function to find a map with a given unique prefix
[divverent/nexuiz.git] / data / qcsrc / common / mapinfo.qh
1 float MAPINFO_TYPE_DEATHMATCH           = 1;
2 float MAPINFO_TYPE_TEAM_DEATHMATCH      = 2;
3 float MAPINFO_TYPE_DOMINATION           = 4;
4 float MAPINFO_TYPE_CTF                          = 8;
5 float MAPINFO_TYPE_RUNEMATCH            = 16;
6 float MAPINFO_TYPE_LMS                          = 32;
7 float MAPINFO_TYPE_ARENA                        = 64;
8 float MAPINFO_TYPE_KEYHUNT                      = 128;
9 float MAPINFO_TYPE_ASSAULT                      = 256;
10 float MAPINFO_TYPE_ONSLAUGHT            = 512;
11 float MAPINFO_TYPE_ALL              = 65535; // this has to include all above bits
12
13 float MapInfo_count;
14
15 // info about a map that MapInfo loads
16 string MapInfo_Map_title;
17 string MapInfo_Map_description;
18 float MapInfo_Map_supportedGametypes;
19 float MapInfo_Map_diameter;
20 float MapInfo_Map_spawnpoints;
21
22 // load MapInfo_count; generate mapinfo for maps that miss them, and clear the
23 // cache; you need to call MapInfo_FilterGametype afterwards!
24 void MapInfo_Enumerate();
25
26 // filter the info by game type mask (updates MapInfo_count)
27 float MapInfo_FilterGametype(float gametype); // 1 on success, 0 on temporary failure (call it again next frame then)
28
29 // load info about the i-th map into the MapInfo_Map_* globals
30 float MapInfo_Get_ByID(float i); // 1 on success, 0 on failure
31
32 // load info about a map by name into the MapInfo_Map_* globals
33 float MapInfo_Get_ByName(string s, float allowGenerate); // 1 on success, 0 on failure, 2 if it autogenerated a mapinfo file
34
35 // look for a map by a prefix, returns the actual map name on success, string_null on failure or ambigous match
36 string MapInfo_FixName(string s);