]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/common/mapinfo.qh
work around fteqcc bug
[divverent/nexuiz.git] / data / qcsrc / common / mapinfo.qh
1 float MAPINFO_TYPE_CTF                          = 1;
2 float MAPINFO_TYPE_ASSAULT                      = 2;
3 float MAPINFO_TYPE_ONSLAUGHT            = 4;
4 float MAPINFO_TYPE_RACE                         = 8;
5 float MAPINFO_TYPE_DEATHMATCH           = 16;
6 float MAPINFO_TYPE_TEAM_DEATHMATCH      = 32;
7 float MAPINFO_TYPE_DOMINATION           = 64;
8 float MAPINFO_TYPE_RUNEMATCH            = 128;
9 float MAPINFO_TYPE_LMS                          = 256;
10 float MAPINFO_TYPE_ARENA                        = 512;
11 float MAPINFO_TYPE_KEYHUNT                      = 1024;
12 float MAPINFO_TYPE_NEXBALL          = 2048;
13 float MAPINFO_TYPE_CTS              = 4096;
14 float MAPINFO_TYPE_ALL              = 65535; // this has to include all above bits
15
16 float MAPINFO_FEATURE_WEAPONS       = 1; // not defined for minstagib-only maps
17
18 float MAPINFO_FLAG_HIDDEN           = 1; // not in lsmaps/menu/vcall/etc., can just be changed to manually
19 float MAPINFO_FLAG_FORBIDDEN        = 2; // don't even allow the map by a cvar setting that allows hidden maps
20 float MAPINFO_FLAG_FRUSTRATING      = 4; // this map is near impossible to play, enable at your own risk
21
22 float MapInfo_count;
23
24 // info about a map that MapInfo loads
25 string MapInfo_Map_bspname;
26 string MapInfo_Map_title;
27 string MapInfo_Map_description;
28 string MapInfo_Map_author;
29 string MapInfo_Map_clientstuff; // not in cache, only for map load
30 string MapInfo_Map_fog; // not in cache, only for map load
31 float MapInfo_Map_supportedGametypes;
32 float MapInfo_Map_supportedFeatures;
33 float MapInfo_Map_flags;
34 vector MapInfo_Map_mins; // these are '0 0 0' if not supported!
35 vector MapInfo_Map_maxs; // these are '0 0 0' if not specified!
36
37 // load MapInfo_count; generate mapinfo for maps that miss them, and clear the
38 // cache; you need to call MapInfo_FilterGametype afterwards!
39 void MapInfo_Enumerate();
40
41 // filter the info by game type mask (updates MapInfo_count)
42 float MapInfo_progress;
43 float MapInfo_FilterGametype(float gametype, float features, float pFlagsRequired, float pFlagsForbidden, float pAbortOnGenerate); // 1 on success, 0 on temporary failure (call it again next frame then; use MapInfo_progress as progress indicator)
44 float MapInfo_CurrentFeatures(); // retrieves currently required features from cvars
45 float MapInfo_CurrentGametype(); // retrieves current gametype from cvars
46 float MapInfo_ForbiddenFlags(); // retrieves current flags from cvars
47 float MapInfo_RequiredFlags(); // retrieves current flags from cvars
48
49 // load info about the i-th map into the MapInfo_Map_* globals
50 float MapInfo_Get_ByID(float i); // 1 on success, 0 on failure
51 string MapInfo_BSPName_ByID(float i);
52
53 // load info about a map by name into the MapInfo_Map_* globals
54 float MapInfo_Get_ByName(string s, float allowGenerate, float gametypeToSet); // 1 on success, 0 on failure, 2 if it autogenerated a mapinfo file
55
56 // look for a map by a prefix, returns the actual map name on success, string_null on failure or ambigous match
57 string MapInfo_FindName_match; // the name of the map that was found
58 float MapInfo_FindName_firstResult; // -1 if none were found, index of first one if not unique but found (FindName then returns -1)
59 float MapInfo_FindName(string s);
60 string MapInfo_FixName(string s);
61
62 // play a map
63 float MapInfo_CheckMap(string s); // returns 0 if the map can't be played with the current settings
64 void MapInfo_LoadMap(string s);
65
66 // list all maps for the current game type
67 string MapInfo_ListAllowedMaps(float pFlagsRequired, float pFlagsForbidden);
68
69 // gets a gametype from a string
70 float MapInfo_Type_FromString(string t);
71 string MapInfo_GetGameTypeCvar(float t);
72 void MapInfo_SwitchGameType(float t);
73
74 // to be called from worldspawn to set up cvars
75 void MapInfo_LoadMapSettings(string s);
76
77 void MapInfo_Cache_Destroy(); // disable caching
78 void MapInfo_Cache_Create(); // enable caching
79 void MapInfo_Cache_Invalidate(); // delete cache if any, but keep enabled
80
81 void MapInfo_ClearTemps(); // call this when done with mapinfo for this frame
82
83 void MapInfo_Shutdown(); // call this in the shutdown handler