X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Futil.qc;h=cf4139fdeea9c51582fecfdd7d710fb9782b2abb;hb=e6eb6e7fc36a3a243c5171b8cc3db88e823514d4;hp=74b60d30aef98a01243a99b34117b8a19e00ae37;hpb=75f257c5016b7a4bf92a2c737a81273d6b258371;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index 74b60d30a..cf4139fde 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -92,6 +92,8 @@ void saveCvarsMulti(entity me) cvar_set(substring(argv(i), 1, strlen(argv(i))), ((s == "0") ? "1" : "0")); else cvar_set(argv(i), s); + + CheckSendCvars(me, argv(i)); } } void makeMulti(entity e, string otherCvars) @@ -305,17 +307,17 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data) } if(status != 0) { - printf(_("error receiving update notification: status is %d\n"), status); + dprintf("error receiving update notification: status is %d\n", status); return; } if(substring(data, 0, 1) == "<") { - print(_("error: received HTML instead of an update notification\n")); + dprint("error: received HTML instead of an update notification\n"); return; } if(strstrofs(data, "\r", 0) != -1) { - print(_("error: received carriage returns from update notification server\n")); + dprint("error: received carriage returns from update notification server\n"); return; } @@ -343,7 +345,6 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data) switch(substring(argv(i), 0, 1)) { - #define APPEND_TO_STRING(list,sep,add) ((list) = (((list) != "") ? strcat(list, sep, add) : (add))) case "V": { un_version = s; @@ -708,22 +709,6 @@ string GameType_GetIcon(float cnt) return ""; } -/*string GameType_GetTeams(float cnt) // poor implementation, later something else could be done that's better? -{ - float i = GameType_GetID(cnt); - string s = _MapInfo_GetDefaultEx(i); - - if(i) - { - if(strstrofs(s, "teams", 0) >= 0) - return _("teamplay"); - else - return _("free for all"); - } - - return _("tuba for all"); -}*/ - void dialog_hudpanel_common_notoggle(entity me, string panelname) { float i; @@ -782,3 +767,15 @@ void dialog_hudpanel_common_notoggle(entity me, string panelname) e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5))); e.configureXonoticTextSliderValues(e); } + +void CheckSendCvars(entity me, string cvarnamestring) +{ + if(me.sendCvars) + { + printf("Sending cvar: %s -> %s\n", cvarnamestring, cvar_string(cvarnamestring)); + if(gamestatus & (GAME_CONNECTED | GAME_ISSERVER)) + { + cmd(sprintf("\nsendcvar %s\n", cvarnamestring)); + } + } +}