From 0250eeb9b9ce4f6b10d817700123d1bfd12f5789 Mon Sep 17 00:00:00 2001 From: FruitieX Date: Tue, 30 Nov 2010 13:18:55 +0200 Subject: [PATCH] fix & cleanup cl_vyes --- defaultXonotic.cfg | 4 ++-- qcsrc/client/Defs.qc | 2 ++ qcsrc/client/Main.qc | 4 ++-- qcsrc/client/hud.qc | 6 ++++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 90f4849d3..7f1ac718d 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1074,8 +1074,8 @@ alias vdoend "vdo endmatch" alias lsmaps "cmd lsmaps" // lists all maps on server (for vmap, suggestmap, vnextmap) alias lsnewmaps "cmd lsnewmaps" // lists all maps on server that do not yet have a record set (race/cts) -bind F1 cl_vyes -bind F2 cl_vno +bind F1 cl_cmd vyes +bind F2 cl_cmd vno //used for spectate/observer mode alias spec "cmd spectate" diff --git a/qcsrc/client/Defs.qc b/qcsrc/client/Defs.qc index 8e47e6fa5..2d780381e 100644 --- a/qcsrc/client/Defs.qc +++ b/qcsrc/client/Defs.qc @@ -271,3 +271,5 @@ string weaponorder_bypriority; float nex_charge_movingavg; float serverflags; + +float uid2name_dialog; diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 1a3608aa3..c3d1afb6f 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -610,7 +610,7 @@ void GameCommand(string msg) } else if(cmd == "vyes") { - if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE) && panel_fg_alpha && !scoreboard_active) // don't lock keys before we actually see what's going on + if(uid2name_dialog) { vote_active = 0; // force the panel to disappear right as we have selected the value (to prevent it from fading out in the normal vote panel pos) vote_prev = 0; @@ -624,7 +624,7 @@ void GameCommand(string msg) } else if(cmd == "vno") { - if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE) && panel_fg_alpha && !scoreboard_active) // don't lock keys before we actually see what's going on + if(uid2name_dialog) { vote_active = 0; vote_prev = 0; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 759435e63..6697b35f2 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -3849,10 +3849,12 @@ float vote_change; // "time" when vote_active changed void HUD_VoteWindow(void) { + uid2name_dialog = 0; if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE)) { vote_active = 1; vote_called_vote = strzone(strcat("^2Name ^7instead of \"^1Unregistered player\"", " ^7in stats")); + uid2name_dialog = 1; } if(!autocvar_hud_panel_vote && !autocvar__hud_configure) @@ -3894,7 +3896,7 @@ void HUD_VoteWindow(void) active_panel = HUD_PANEL_VOTE; HUD_Panel_UpdateCvars(vote); - if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE)) + if(uid2name_dialog) { panel_pos = eX * 0.3 * vid_conwidth + eY * 0.1 * vid_conheight; panel_size = eX * 0.4 * vid_conwidth + eY * 0.3 * vid_conheight; @@ -3934,7 +3936,7 @@ void HUD_VoteWindow(void) mySize = newSize; s = "A vote has been called for:"; - if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE)) + if(uid2name_dialog) s = "Allow servers to store and display your name?"; drawstring_aspect(pos, s, eX * mySize_x + eY * (2/8) * mySize_y, '1 1 1', a, DRAWFLAG_NORMAL); s = textShortenToWidth(vote_called_vote, mySize_x, '1 1 0' * mySize_y * (1/8), stringwidth_colors); -- 2.39.2