X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=dpdefs%2Fmenudefs.qc;h=36cedec4f2fdfd1b96e935f1f5f91b84b230fd53;hb=0cf91106f5322e5febeea043c0280cf245573f30;hp=0a7bd6ae436fb0fcd9f34215d0e071e5e9900363;hpb=f12d2b241576ee29f33417099602a12913bf2755;p=xonotic%2Fdarkplaces.git diff --git a/dpdefs/menudefs.qc b/dpdefs/menudefs.qc index 0a7bd6ae..36cedec4 100644 --- a/dpdefs/menudefs.qc +++ b/dpdefs/menudefs.qc @@ -15,9 +15,10 @@ void end_sys_fields; void() m_init; void(float keynr, float ascii) m_keydown; -void() m_draw; -void() m_toggle; +void(float width, float height) m_draw; +void(float mode) m_toggle; void() m_shutdown; +// optional: float(float) m_gethostcachecategory; ///////////////////////////////////////////////////////// // sys constants @@ -96,7 +97,7 @@ float ERR_BADFILENAME = -4; // fopen float ERR_NULLSTRING = -1; float ERR_BADDRAWFLAG = -2; float ERR_BADSCALE = -3; -float ERR_BADSIZE = ERR_BADSCALE; +float ERR_BADSIZE = -3; // same as ERR_BADSCALE float ERR_NOTCACHED = -4; // server list stuff @@ -202,7 +203,7 @@ float stof(string val,...) = #21; entity spawn(void) = #22; void remove(entity e) = #23; -entity findstring(entity start, .string field, string match) = #24; +entity find(entity start, .string field, string match) = #24; entity findfloat(entity start, .float field, float match) = #25; entity findentity(entity start, .entity field, entity match) = #25; @@ -253,7 +254,7 @@ vector stov(string s) = #55; string strzone(string s) = #56; void strunzone(string s) = #57; -float tokenize(string s) = #58 +float tokenize(string s) = #58; string argv(float n) = #59; float isserver(void) = #60; @@ -293,7 +294,7 @@ void WriteEntity(entity data, float dest, float desto) = #408; ////////////////////////////////////////////////// float iscachedpic(string name) = #451; -string precache_pic(string name) = #452; +string precache_pic(string name, ...) = #452; void freepic(string name) = #453; float drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag) = #454; @@ -353,9 +354,15 @@ float(string key) stringtokeynum = #341; //field definitions: (MENUQC) string(string serveraddress) crypto_getkeyfp = #633; // retrieves the cached host key's CA fingerprint of a server given by IP address string(string serveraddress) crypto_getidfp = #634; // retrieves the cached host key fingerprint of a server given by IP address +float(string serveraddress) crypto_getidstatus = #643; // retrieves the cached host key's key status. See below for CRYPTO_IDSTATUS_ defines. string(string serveraddress) crypto_getencryptlevel = #635; // 0 if never encrypting, 1 supported, 2 requested, 3 required, appended by list of allowed methods in order of preference ("AES128"), preceded by a space each string(float i) crypto_getmykeyfp = #636; // retrieves the CA key fingerprint of a given CA slot, or "" if slot is unused but more to come, or string_null if end of list string(float i) crypto_getmyidfp = #637; // retrieves the ID fingerprint of a given CA slot, or "" if slot is unused but more to come, or string_null if end of list +float CRYPTO_IDSTATUS_OUTOFRANGE = -1; +float CRYPTO_IDSTATUS_EMPTY = 0; +float CRYPTO_IDSTATUS_UNSIGNED = 1; +float CRYPTO_IDSTATUS_SIGNED = 2; +float(float i) crypto_getmyidstatus = #641; // retrieves the ID's status of a given CA slot, or 0 if slot is unused but more to come, or -1 if end of list float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513; //description: //use -1 as buffer handle to justs end delim as postdata @@ -395,10 +402,20 @@ string(float ccase, float calpha, float cnum, string s, ...) strconv = #224; string(float chars, string s, ...) strpad = #225; string(string info, string key, string value, ...) infoadd = #226; string(string info, string key) infoget = #227; +float(string s1, string s2) strcmp = #228; float(string s1, string s2, float len) strncmp = #228; float(string s1, string s2) strcasecmp = #229; float(string s1, string s2, float len) strncasecmp = #230; +//DP_PRECACHE_PIC_FLAGS +//idea: divVerent +//darkplaces implementation: divVerent +//constant definitions: +float PRECACHE_PIC_FROMWAD = 1; // this one actually is part of EXT_CSQC +float PRECACHE_PIC_NOTPERSISTENT = 2; // picture may get deallocated when unused +float PRECACHE_PIC_MIPMAP = 8; // mipmap the texture for possibly better downscaling at memory expense +//notes: these constants are given as optional second argument to precache_pic() + //DP_QC_CRC16 //idea: div0 //darkplaces implementation: div0 @@ -417,7 +434,7 @@ float CVAR_TYPEFLAG_READONLY = 32; //DP_QC_STRINGBUFFERS //idea: ?? -//darkplaces implementation: LordHavoc +//darkplaces implementation: LadyHavoc //functions to manage string buffer objects - that is, arbitrary length string arrays that are handled by the engine float() buf_create = #440; void(float bufhandle) buf_del = #441; @@ -431,6 +448,15 @@ float(float bufhandle, string str, float order) bufstr_add = #448; void(float bufhandle, float string_index) bufstr_free = #449; void(float bufhandle, string pattern, string antipattern) buf_cvarlist = #517; +//DP_QC_STRING_CASE_FUNCTIONS +//idea: Dresk +//darkplaces implementation: LadyHavoc / Dresk +//builtin definitions: +string(string s) strtolower = #480; // returns the passed in string in pure lowercase form +string(string s) strtoupper = #481; // returns the passed in string in pure uppercase form +//description: +//provides simple string uppercase and lowercase functions + //DP_QC_CVAR_DESCRIPTION //idea: divVerent //DarkPlaces implementation: divVerent @@ -481,9 +507,50 @@ float(string url, float id) uri_get = #513; float(string url, float id, string content_type, string data) uri_post = #513; float(string url, float id, string content_type, string delim, float buf) uri_postbuf = #513; +//DP_QC_ENTITYDATA +//idea: KrimZon +//darkplaces implementation: KrimZon +//builtin definitions: +float() numentityfields = #496; +string(float fieldnum) entityfieldname = #497; +float(float fieldnum) entityfieldtype = #498; +string(float fieldnum, entity ent) getentityfieldstring = #499; +float(float fieldnum, entity ent, string s) putentityfieldstring = #500; +//constants: +//Returned by entityfieldtype +float FIELD_STRING = 1; +float FIELD_FLOAT = 2; +float FIELD_VECTOR = 3; +float FIELD_ENTITY = 4; +float FIELD_FUNCTION = 6; +//description: +//Versatile functions intended for storing data from specific entities between level changes, but can be customized for some kind of partial savegame. +//WARNING: .entity fields cannot be saved and restored between map loads as they will leave dangling pointers. +//numentityfields returns the number of entity fields. NOT offsets. Vectors comprise 4 fields: v, v_x, v_y and v_z. +//entityfieldname returns the name as a string, eg. "origin" or "classname" or whatever. +//entityfieldtype returns a value that the constants represent, but the field may be of another type in more exotic progs.dat formats or compilers. +//getentityfieldstring returns data as would be written to a savegame, eg... "0.05" (float), "0 0 1" (vector), or "Hello World!" (string). Function names can also be returned. +//putentityfieldstring puts the data returned by getentityfieldstring back into the entity. + +//DP_COVERAGE +//idea: divVerent +//darkplaces implementation: divVerent +//function definitions: +void coverage() = #642; // Reports a coverage event. The engine counts for each of the calls to this builtin whether it has been called. + +//DP_QC_FS_SEARCH_PACKFILE +//idea: Mario +//darkplaces implementation: Mario +//builtin definitions: +float(string pattern, float caseinsensitive, float quiet, string packfile) search_packfile_begin = #444; +//description: +//extension to search_begin (DP_QC_FS_SEARCH), performs a filename search with the specified pattern (for example "maps/*.bsp") and stores the results in a search slot (minimum of 128 supported by any engine with this extension), the other functions take this returned search slot number, be sure to search_free when done (they are also freed on progs reload). +//only searches for files within the specified packfile, which is expected to match the results of whichpack(). + // assorted undocumented extensions string(string, float) netaddress_resolve = #625; string(string search, string replace, string subject) strreplace = #484; +string(string search, string replace, string subject) strireplace = #485; string(float uselocaltime, string format, ...) strftime = #478; float(string s) tokenize_console = #514; float(float i) argv_start_index = #515; @@ -513,8 +580,11 @@ void resethostcachemasks(void) = #615; void sethostcachemaskstring(float mask, float fld, string str, float op) = #616; void sethostcachemasknumber(float mask, float fld, float num, float op) = #617; void resorthostcache(void) = #618; -void sethostcachesort(float fld, float descending) = #619; -void refreshhostcache(void) = #620; +float SLSF_DESCENDING = 1; +float SLSF_FAVORITES = 2; +float SLSF_CATEGORIES = 4; +void sethostcachesort(float fld, float slsf) = #619; +void refreshhostcache(...) = #620; // optional boolean argument "clear_list" float gethostcachenumber(float fld, float hostnr) = #621; float gethostcacheindexforkey(string key) = #622; void addwantedhostcachekey(string key) = #623;