57 .void(
entity me) saveCvars_Multi;
60 if (me.controlledCvars_Multi)
61 return me.controlledCvars_Multi;
69 me.saveCvars_Multi(me);
73 for(i = 0; i < n; ++i)
79 cvar_set(cvarname, ((s ==
"0") ?
"1" :
"0"));
92 e.controlledCvars_Multi = otherCvars;
93 e.saveCvars_Multi = e.saveCvars;
97 .void(
entity me) saveCvars_Callback;
102 me.saveCvars_Callback(me);
103 me.saveCvars_Callback_func(me.saveCvars_Callback_ent, me);
107 e.saveCvars_Callback = e.saveCvars;
109 e.saveCvars_Callback_ent = cbent;
110 e.saveCvars_Callback_func = cbfunc;
113 .void(
entity) draw_setDependent;
126 .float(
entity) func_setDependent;
130 bool disabled_prev = e.disabled;
133 if(e.func_setDependent)
135 e.disabled = !(e.func_setDependent(e));
137 else if(e.cvarString_setDependent)
140 e.disabled = (
cvar_string(e.cvarString_setDependent) == e.cvarValue_setDependent);
144 if(e.cvar_setDependent)
146 f =
cvar(e.cvar_setDependent);
147 if(e.cvarMin_setDependent <= e.cvarMax_setDependent)
148 e.disabled = ((f < e.cvarMin_setDependent) || (f > e.cvarMax_setDependent));
150 e.disabled = ((f >= e.cvarMax_setDependent) && (f <= e.cvarMin_setDependent));
152 if(e.cvar2_setDependent)
154 f =
cvar(e.cvar2_setDependent);
155 if(e.cvar2Min_setDependent <= e.cvar2Max_setDependent)
156 e.disabled = (e.disabled + ((f < e.cvar2Min_setDependent) || (f > e.cvar2Max_setDependent)) > e.op_setDependent);
158 e.disabled = (e.disabled + ((f >= e.cvar2Max_setDependent) && (f <= e.cvar2Min_setDependent)) > e.op_setDependent);
160 if(e.cvar3_setDependent)
162 f =
cvar(e.cvar3_setDependent);
163 if(e.cvar3Min_setDependent <= e.cvar3Max_setDependent)
164 e.disabled = (e.disabled + ((f < e.cvar3Min_setDependent) || (f > e.cvar3Max_setDependent)) > e.op_setDependent);
166 e.disabled = (e.disabled + ((f >= e.cvar3Max_setDependent) && (f <= e.cvar3Min_setDependent)) > e.op_setDependent);
169 if (disabled_prev != e.disabled && e.loadCvars)
175 e.draw_setDependent(e);
180 e.draw_setDependent = e.draw;
181 e.cvar_setDependent = theCvarName;
182 e.cvarMin_setDependent = theCvarMin;
183 e.cvarMax_setDependent = theCvarMax;
192 e.draw_setDependent = e.draw;
193 e.cvarString_setDependent = theCvarName;
194 e.cvarValue_setDependent = theCvarValue;
202 void setDependentAND(
entity e,
string theCvarName,
float theCvarMin,
float theCvarMax,
string theCvar2Name,
float theCvar2Min,
float theCvar2Max)
204 e.draw_setDependent = e.draw;
205 e.cvar_setDependent = theCvarName;
206 e.cvarMin_setDependent = theCvarMin;
207 e.cvarMax_setDependent = theCvarMax;
208 e.cvar2_setDependent = theCvar2Name;
209 e.cvar2Min_setDependent = theCvar2Min;
210 e.cvar2Max_setDependent = theCvar2Max;
212 e.op_setDependent = 0;
217 void setDependentOR(
entity e,
string theCvarName,
float theCvarMin,
float theCvarMax,
string theCvar2Name,
float theCvar2Min,
float theCvar2Max)
219 e.draw_setDependent = e.draw;
220 e.cvar_setDependent = theCvarName;
221 e.cvarMin_setDependent = theCvarMin;
222 e.cvarMax_setDependent = theCvarMax;
223 e.cvar2_setDependent = theCvar2Name;
224 e.cvar2Min_setDependent = theCvar2Min;
225 e.cvar2Max_setDependent = theCvar2Max;
227 e.op_setDependent = 1;
232 void setDependentAND3(
entity e,
string theCvarName,
float theCvarMin,
float theCvarMax,
string theCvar2Name,
float theCvar2Min,
float theCvar2Max,
string theCvar3Name,
float theCvar3Min,
float theCvar3Max)
234 e.draw_setDependent = e.draw;
235 e.cvar_setDependent = theCvarName;
236 e.cvarMin_setDependent = theCvarMin;
237 e.cvarMax_setDependent = theCvarMax;
238 e.cvar2_setDependent = theCvar2Name;
239 e.cvar2Min_setDependent = theCvar2Min;
240 e.cvar2Max_setDependent = theCvar2Max;
241 e.cvar3_setDependent = theCvar3Name;
242 e.cvar3Min_setDependent = theCvar3Min;
243 e.cvar3Max_setDependent = theCvar3Max;
244 e.op_setDependent = 0;
251 e.draw_setDependent = e.draw;
252 e.func_setDependent = func;
263 string t = cvar_description(theCvar);
264 if(t !=
"" && t !=
"custom cvar")
268 else if(theTooltip ==
"-")
312 LOG_INFOF(
"Received HTTP request data for an invalid id %d.",
id);
325 if(_Nex_ExtResponseSystem_UpdateTo)
327 LOG_TRACE(
"error: UpdateNotification_URI_Get_Callback has been called before");
332 LOG_TRACEF(
"error receiving update notification: status is %d", status);
337 LOG_TRACE(
"error: received HTML instead of an update notification");
342 LOG_TRACE(
"error: received carriage returns from update notification server");
354 string un_version =
"";
355 string un_tosversion =
"";
356 string un_download =
"";
358 string un_bannedservers =
"";
359 string un_emergency_pk3s =
"";
360 string un_promoted =
"";
361 string un_recommended =
"";
362 string un_compatexpire =
"";
364 for(i = 0; i < n; ++i)
367 if(s ==
"") {
continue; }
403 if(
cvar(
"menu_updatecheck_getpacks"))
425 _Nex_ExtResponseSystem_UpdateTo =
strzone(un_version);
426 if(un_download) {
LOG_INFO(_(
"Update can be downloaded at:"),
"\n", un_download); }
427 if(un_url) { _Nex_ExtResponseSystem_UpdateToURL =
strzone(un_url); }
430 else if(
cvar_string(
"g_xonoticversion") == un_version)
432 if(un_compatexpire !=
"")
434 string curdate = strftime(
false,
"%Y%m%d%H%M%S");
435 if (
strcmp(curdate, un_compatexpire) >= 0)
441 if(un_tosversion !=
"")
446 if(un_bannedservers !=
"")
452 if(un_emergency_pk3s !=
"")
454 _Nex_ExtResponseSystem_Packs =
strzone(un_emergency_pk3s);
455 _Nex_ExtResponseSystem_PacksStep = 1;
458 if(un_promoted !=
"")
464 if(un_recommended !=
"")
475 if(!_Nex_ExtResponseSystem_Queried)
477 _Nex_ExtResponseSystem_Queried = 1;
485 uri = sprintf(
"http://update.xonotic.org/checkupdate.txt?version=%s&cnt=%d", uri_escape(
cvar_string(
"g_xonoticversion")), startcnt);
489 if(_Nex_ExtResponseSystem_PacksStep > 0)
495 for(i = 0; i+1 < n; i += 2)
500 if(_Nex_ExtResponseSystem_PacksStep == 1)
505 if(_Nex_ExtResponseSystem_PacksStep == 2)
512 _Nex_ExtResponseSystem_PacksStep = 0;
515 _Nex_ExtResponseSystem_PacksStep = 2;
528 show_propermenu =
true;
539 draw_CenterText(
'0.5 0.5 0' - 1.25 * sz.y *
eY, _(
"Autogenerating mapinfo for newly added maps..."), sz,
'1 1 1', 1, 0);
541 boxA =
'0.05 0.5 0' + 0.25 * sz.y *
eY;
542 boxB =
'0.95 0.5 0' + 1.25 * sz.y *
eY;
543 draw_Fill(boxA, boxB - boxA,
'1 1 1', 1);
547 draw_Fill(boxA, boxB - boxA,
'0.1 0.1 0.1', 1);
550 draw_Fill(boxA, boxB - boxA,
'0 0 1', 1);
564 vector fs, sz =
'0 0 0', line, mid;
575 l1 = sprintf(
"Jeff pay 4 new weapons for %s", _Nex_ExtResponseSystem_UpdateTo);
577 l1 = sprintf(_(
"Update to %s now!"), _Nex_ExtResponseSystem_UpdateTo);
578 l2 =
"http://www.xonotic.org/";
579 if(_Nex_ExtResponseSystem_UpdateToURL)
589 mid =
eX * (0.5 + 0.5 * (1 - sz.x) *
cos(
time * 0.071))
590 +
eY * (0.5 + 0.5 * (1 - sz.y) *
sin(
time * 0.071));
592 draw_Fill(mid - 0.5 * sz, sz,
'1 1 0', 1);
597 if (!campaign_name_previous)
603 if(!campaign_won_previous)
608 campaign_won_previous = 1;
611 campaign_won_previous = 0;
630 float have_dds, have_jpg, have_tga;
632 have_dds = (
fexists(
"dds/particles/particlefont.dds"));
633 have_jpg = (
fexists(
"particles/particlefont.jpg"));
634 have_tga = (
fexists(
"particles/particlefont.tga"));
636 if(have_dds && (have_jpg || have_tga))
643 cvar_set(
"gl_texturecompression",
"0");
651 cvar_set(
"gl_texturecompression",
"0");
652 cvar_set(
"r_texture_dds_load",
"0");
659 cvar_set(
"gl_texturecompression",
"1");
660 cvar_set(
"r_texture_dds_load",
"1");
662 LOG_INFO(_(
"^1ERROR: Texture compression is required but not supported.\n^1Expect visual problems."));
675 cvar_set(
"gl_texturecompression",
"0");
676 cvar_set(
"r_texture_dds_load",
"0");
684 GAMETYPE(MAPINFO_TYPE_DEATHMATCH) \ 685 GAMETYPE(MAPINFO_TYPE_TEAM_DEATHMATCH) \ 686 GAMETYPE(MAPINFO_TYPE_CTF) \ 687 GAMETYPE(MAPINFO_TYPE_CA) \ 688 GAMETYPE(MAPINFO_TYPE_FREEZETAG) \ 689 GAMETYPE(MAPINFO_TYPE_KEEPAWAY) \ 690 GAMETYPE(MAPINFO_TYPE_KEYHUNT) \ 691 GAMETYPE(MAPINFO_TYPE_LMS) \ 692 GAMETYPE(MAPINFO_TYPE_DOMINATION) \ 693 GAMETYPE(MAPINFO_TYPE_NEXBALL) \ 694 GAMETYPE(MAPINFO_TYPE_ONSLAUGHT) \ 695 GAMETYPE(MAPINFO_TYPE_ASSAULT) \ 701 #define HIDDEN_GAMETYPES \ 702 GAMETYPE(MAPINFO_TYPE_RACE) \ 703 GAMETYPE(MAPINFO_TYPE_CTS) \ 709 #define GAMETYPE(it) { if (i++ == cnt) return it; } 719 int dev =
cvar(
"developer");
720 #define GAMETYPE(id) ++i; 723 #define GAMETYPE(it) { if (dev > 0) ++i; } 732 #define GAMETYPE(id) ++i; 753 .void(
entity,
float) TDempty;
754 .void(
entity,
float,
float) gotoRC;
757 .void(
entity,
string,
string) addValue;
758 .void(
entity) configureXonoticTextSliderValues;
778 me.gotoRC(me, me.currentRow + 1.5, 0);
781 e.addValue(e, _(
"Default"),
"");
782 e.addValue(e, _(
"Disable"),
"0");
784 e.configureXonoticTextSliderValues(e);
797 e.addValue(e, _(
"Default"),
"");
798 e.addValue(e, _(
"Disable"),
"0");
799 for(i = 1; i <= 10; ++i)
801 e.configureXonoticTextSliderValues(e);
806 e.addValue(e, _(
"Default"),
"");
807 for(i = 1; i <= 10; ++i)
809 e.configureXonoticTextSliderValues(e);
814 e.addValue(e, _(
"Default"),
"");
815 e.addValue(e, _(
"Disable"),
"0");
816 for(i = 1; i <= 10; ++i)
818 e.configureXonoticTextSliderValues(e);
821 me.TD(me, 1, 3.6, e =
makeXonoticCheckBox(0,
"hud_configure_teamcolorforced", _(
"Test team color in configure mode")));
826 e.addValue(e, _(
"Default"),
"");
827 for(i = 0; i <= 10; ++i)
829 e.configureXonoticTextSliderValues(e);
832 float getFadedAlpha(
float currentAlpha,
float startAlpha,
float targetAlpha)
834 if(startAlpha < targetAlpha)
835 currentAlpha =
min(currentAlpha +
frametime * 0.5, targetAlpha);
837 currentAlpha =
max(currentAlpha -
frametime * 0.5, targetAlpha);
848 cmd(sprintf(
"\nsendcvar %s\n", cvarnamestring));
string MapInfo_Type_ToString(Gametype t)
ERASEABLE string ftos_decimals(float number, int decimals)
converts a number to a string with the indicated number of decimals
void Curl_URI_Get_Callback(int id, float status, string data)
void depthfirst(entity start,.entity up,.entity downleft,.entity right, void(entity, entity) funcPre, void(entity, entity) funcPost, entity pass)
string MapInfo_Type_ToText(Gametype t)
ERASEABLE float url_URI_Get_Callback(int id, float status, string data)
const int URI_GET_DISCARD
void MapInfo_Cache_Create()
#define APPEND_TO_STRING(list, sep, add)
const int URI_GET_UPDATENOTIFICATION
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
ERASEABLE int vercmp(string v1, string v2)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
const int URI_GET_CURL_END
#define tokenizebyseparator
float _MapInfo_FilterGametype(int pGametype, int pFeatures, int pFlagsRequired, int pFlagsForbidden, bool pAbortOnGenerate)
#define pass(name, colormin, colormax)
ERASEABLE bool fexists(string f)