From: terencehill Date: Mon, 1 Aug 2022 23:23:54 +0000 (+0200) Subject: Make scoreboard team selection on spacebar press work for old clients. While at it... X-Git-Tag: xonotic-v0.8.6~389^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=11a57eac56c4684708b9eadf125eaf8f7d7b635d;p=xonotic%2Fxonotic-data.pk3dir.git Make scoreboard team selection on spacebar press work for old clients. While at it give team selection aliases more consistent names --- diff --git a/binds-xonotic.cfg b/binds-xonotic.cfg index 8796d8cdd..2a81e7069 100644 --- a/binds-xonotic.cfg +++ b/binds-xonotic.cfg @@ -57,7 +57,7 @@ bind F1 vyes bind F2 vno bind F3 spec bind F4 ready -bind F5 scoreboard_team_selection +bind F5 team_selection_show bind F6 team_auto bind F7 menu_showsandboxtools bind F8 "quickmenu" @@ -75,7 +75,7 @@ bind JOY5 "+fire2" bind JOY6 "+fire" bind JOY7 "+zoom" bind JOY8 "dropweapon" -bind JOY9 "scoreboard_team_selection" +bind JOY9 team_selection_show bind JOY10 "+show_info" bind JOY11 "+showscores" bind JOY12 "+con_chat_maximize" diff --git a/commands.cfg b/commands.cfg index 9dd270012..28c7e8063 100644 --- a/commands.cfg +++ b/commands.cfg @@ -151,9 +151,9 @@ alias scoreboard_columns_help "qc_cmd_cl hud scoreboard_columns_help" alias scoreboard_columns_set "qc_cmd_cl hud scoreboard_columns_set ${* ?}" set _scoreboard_team_selection_available 0 // set to 1 by CSQC -alias _menu_showteamselect1 "_scoreboard_team_selection 1" -alias _menu_showteamselect0 "menu_showteamselect" -alias scoreboard_team_selection "_menu_showteamselect$_scoreboard_team_selection_available" +alias _team_selection_show1 "_scoreboard_team_selection 1" +alias _team_selection_show0 menu_showteamselect +alias team_selection_show "_team_selection_show$_scoreboard_team_selection_available" // ======================================================== // cmd (client-to-server command) - server/command/cmd.qc diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index b2825bc82..22f0438f4 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -44,9 +44,6 @@ void CSQC_Init() { - cvar_set("_scoreboard_team_selection_available", "1"); - cvar_set("_scoreboard_team_selection", "0"); // in case it has been left set to 1 - prvm_language = strzone(cvar_string("prvm_language")); #ifdef WATERMARK @@ -103,6 +100,10 @@ void CSQC_Init() if(autocvar_cl_lockview) cvar_set("cl_lockview", "0"); + if (cvar_type("_scoreboard_team_selection_available") & CVAR_TYPEFLAG_EXISTS) + cvar_settemp("_scoreboard_team_selection_available", "1"); + cvar_set("_scoreboard_team_selection", "0"); // in case it has been left set to 1 + gametype = NULL; postinit = false; @@ -152,7 +153,6 @@ void CSQC_Init() // CSQC_Shutdown : Called every time the CSQC code is shutdown (changing maps, quitting, etc) void Shutdown() { - cvar_set("_scoreboard_team_selection_available", "0"); WarpZone_Shutdown(); delete(teams); diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index cf93e4e7a..e9955b407 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -1939,7 +1939,7 @@ bool ShowTeamSelection(entity this) if (!teamplay || autocvar_g_campaign || autocvar_g_balance_teams || this.team_selected || (CS(this).wasplayer && autocvar_g_changeteam_banned) || Player_HasRealForcedTeam(this)) return false; if (frametime) // once per frame is more than enough - stuffcmd(this, "scoreboard_team_selection\n"); + stuffcmd(this, "_scoreboard_team_selection 1\n"); return true; } void Join(entity this)