]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud.qc
Merge remote branch 'origin/master' into fruitiex/cl_vyes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud.qc
index 7ad148b0cb516edbfe844c2a34b8498bacf7950f..bba9db0b4b886a4af400b8792d7b6981ef809bdc 100644 (file)
@@ -3886,10 +3886,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)
@@ -3930,16 +3932,18 @@ void HUD_VoteWindow(void)
 
        active_panel = HUD_PANEL_VOTE;
        HUD_Panel_UpdateCvars(vote);
-       vector pos, mySize;
-       pos = panel_pos;
-       mySize = panel_size;
 
-       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;
        }
 
+    // these must be below above block
+       vector pos, mySize;
+       pos = panel_pos;
+       mySize = panel_size;
+
        a = vote_alpha * bound(cvar("hud_panel_vote_alreadyvoted_alpha"), 1 - vote_highlighted, 1);
        HUD_Panel_DrawBg(a);
        a = panel_fg_alpha * a;
@@ -3969,7 +3973,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);
@@ -3978,13 +3982,9 @@ void HUD_VoteWindow(void)
        drawcolorcodedstring_aspect(pos + eY * (2/8) * mySize_y, s, eX * mySize_x + eY * (1.75/8) * mySize_y, a, DRAWFLAG_NORMAL);
 
        // print the yes/no counts
-       s = strcat("Yes (", getcommandkey("vyes", "vyes"), "): ", ftos(vote_yescount));
-       if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE))
-               s = strcat("Yes: (press y)");
+    s = strcat("Yes (", getcommandkey("cl_cmd vyes", "cl_cmd vyes"), "): ", ftos(vote_yescount));
        drawstring_aspect(pos + eY * (4/8) * mySize_y, s, eX * 0.5 * mySize_x + eY * (1.5/8) * mySize_y, '0 1 0', a, DRAWFLAG_NORMAL);
-       s = strcat("No (", getcommandkey("vno", "vno"), "): ", ftos(vote_nocount));
-       if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE))
-               s = strcat("No: (press n)");
+    s = strcat("No (", getcommandkey("cl_cmd vno", "cl_cmd vno"), "): ", ftos(vote_nocount));
        drawstring_aspect(pos + eX * 0.5 * mySize_x + eY * (4/8) * mySize_y, s, eX * 0.5 * mySize_x + eY * (1.5/8) * mySize_y, '1 0 0', a, DRAWFLAG_NORMAL);
 
        // draw the progress bar backgrounds