]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/common/mapinfo.qh
possibly kill the tempstring warnings when saving games, possibly break everything
[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_FEATURE_WEAPONS       = 1; // not defined for minstagib-only maps
14
15 float MapInfo_count;
16
17 // info about a map that MapInfo loads
18 string MapInfo_Map_bspname;
19 string MapInfo_Map_title;
20 string MapInfo_Map_description;
21 string MapInfo_Map_author;
22 float MapInfo_Map_supportedGametypes;
23 float MapInfo_Map_supportedFeatures;
24 float MapInfo_Map_diameter;
25 float MapInfo_Map_spawnpoints;
26
27 // load MapInfo_count; generate mapinfo for maps that miss them, and clear the
28 // cache; you need to call MapInfo_FilterGametype afterwards!
29 void MapInfo_Enumerate();
30
31 // filter the info by game type mask (updates MapInfo_count)
32 float MapInfo_FilterGametype(float gametype, float features, float pAbortOnGenerate); // 1 on success, 0 on temporary failure (call it again next frame then)
33 float MapInfo_CurrentFeatures(); // retrieves currently required features from cvars
34 float MapInfo_CurrentGametype(); // retrieves current gametype from cvars
35
36 // load info about the i-th map into the MapInfo_Map_* globals
37 float MapInfo_Get_ByID(float i); // 1 on success, 0 on failure
38 string MapInfo_BSPName_ByID(float i);
39
40 // load info about a map by name into the MapInfo_Map_* globals
41 float MapInfo_Get_ByName(string s, float allowGenerate, float gametypeToSet); // 1 on success, 0 on failure, 2 if it autogenerated a mapinfo file
42
43 // look for a map by a prefix, returns the actual map name on success, string_null on failure or ambigous match
44 string MapInfo_FindName_match; // the name of the map that was found
45 float MapInfo_FindName_firstResult; // -1 if none were found, index of first one if not unique but found (FindName then returns -1)
46 float MapInfo_FindName(string s);
47 string MapInfo_FixName(string s);
48
49 // play a map
50 float MapInfo_CheckMap(string s); // returns 0 if the map can't be played with the current settings
51 void MapInfo_LoadMap(string s);
52
53 // list all maps for the current game type
54 string MapInfo_ListAllowedMaps();
55
56 // gets a gametype from a string
57 float MapInfo_Type_FromString(string t);
58 void MapInfo_SwitchGameType(float t);
59
60 // to be called from worldspawn to set up cvars
61 void MapInfo_LoadMapSettings(string s);
62
63 void MapInfo_Cache_Destroy(); // disable caching
64 void MapInfo_Cache_Create(); // enable caching
65 void MapInfo_Cache_Invalidate(); // delete cache if any, but keep enabled
66
67 void MapInfo_ClearTemps(); // call this when done with mapinfo for this frame