]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Improve spect HUD CVAR names
authorz411 <z411@omaera.org>
Wed, 21 Apr 2021 22:46:29 +0000 (18:46 -0400)
committerz411 <z411@omaera.org>
Wed, 21 Apr 2021 22:46:29 +0000 (18:46 -0400)
qcsrc/client/hud/hud.qh
qcsrc/client/hud/panel/infomessages.qc
qcsrc/client/hud/panel/score.qc
qcsrc/client/hud/panel/spect.qc

index 132f61e20c0b9c59890c87d22555f8a2e517a74a..79c4edd41a83ae7a16f28db3b6ed49b779c78751 100644 (file)
@@ -211,9 +211,8 @@ vector hud_dynamic_shake_realofs;
 float hud_dynamic_shake_factor;
 float hud_dynamic_shake_time;
 
-bool autocvar_hud_spectatordueldisplay = true;
-bool autocvar_hud_spectatorteamdisplay = true; //LegendGuard adds a bool to enable/disable team display HUD 06-04-2021
-bool autocvar_hud_spectatorplayernamedisplay = true; //LegendGuard adds a bool to enable/disable player name display HUD 06-04-2021
+bool autocvar_hud_panel_spect_scores = true; //LegendGuard adds a bool to enable/disable score display HUD 06-04-2021
+bool autocvar_hud_panel_spect_playername = true; //LegendGuard adds a bool to enable/disable player name display HUD 06-04-2021
 
 // shared across viewmodel effects and dynamic hud code
 vector cl_followmodel_ofs;
index 3e0d46379e6c8126f4b207a66ca82fb95d856b47..62dbc619618d71ff5ea77189742a18ddde73ae8c 100644 (file)
@@ -88,11 +88,14 @@ void HUD_InfoMessages()
        {
                if(spectatee_status)
                {
-                       /*if(spectatee_status == -1)
-                               s = _("^1Observing");
-                       else
-                               s = sprintf(_("^1Spectating: ^7%s"), entcs_GetName(current_player));
-                       InfoMessage(s);*/
+                       // z411 : Show the observed played if we have the spectator HUD disabled
+                       if(!autocvar_hud_panel_spect_playername) {
+                               if(spectatee_status == -1)
+                                       s = _("^1Observing");
+                               else
+                                       s = sprintf(_("^1Spectating: ^7%s"), entcs_GetName(current_player));
+                               InfoMessage(s);
+                       }
 
                        /*if(autocvar_hud_panel_infomessages_group0)
                        {
@@ -123,11 +126,8 @@ void HUD_InfoMessages()
                        //pos = M_ARGV(0, vector);
                        //img_curr_group = M_ARGV(2, int);
 
-                       //if(!mutator_returnvalue)
-                       //{
-                               s = sprintf(_("^1Press ^3%s^1 to join"), getcommandkey(_("jump"), "+jump"));
-                               InfoMessage(s);
-                       //}
+                       s = sprintf(_("^1Press ^3%s^1 to join"), getcommandkey(_("jump"), "+jump"));
+                       InfoMessage(s);
                }
 
                if (time < STAT(GAMESTARTTIME))
index 3046335ca6ced612cc99a364384444121c650e79..dca00c4cb015aa4e8e6245dbc7bcf02a776779ed 100644 (file)
@@ -214,10 +214,8 @@ void HUD_Score()
        if (!scoreboard_fade_alpha) // the scoreboard too calls Scoreboard_UpdatePlayerTeams
                Scoreboard_UpdatePlayerTeams();
        
-       if(spectatee_status) {
-               if(teamplay && autocvar_hud_spectatorteamdisplay) return;
-               if(gametype == MAPINFO_TYPE_DUEL && autocvar_hud_spectatordueldisplay) return;
-       }
+       // z411 : Don't display if we have the spectator HUD scores enabled
+       if(spectatee_status && autocvar_hud_panel_spect_scores) return;
 
        HUD_Panel_LoadCvars();
        vector pos, mySize;
index 3bdede227026d96ed8e5518e0bad761f20e95066..6929539e1a42eb2c251c1ff39b34cde4213dea57 100644 (file)
@@ -259,7 +259,7 @@ void HUD_SpectHUD()
        hud_fontsize = HUD_GetFontsize("hud_fontsize");
        
        // Spectator name
-       if (autocvar_hud_spectatorplayernamedisplay)
+       if (autocvar_hud_panel_spect_playername)
        {
                if(spectatee_status != -1) {
                        ammo_y = stov(cvar_string("hud_panel_ammo_pos")).y * vid_conheight;
@@ -268,7 +268,9 @@ void HUD_SpectHUD()
                }
        }
        
-       if (teamplay && autocvar_hud_spectatorteamdisplay)
+       // Scores
+       if (!autocvar_hud_panel_spect_scores) return;
+       if (teamplay)
        {
                // Set vars
                teamscore_fontsize = hud_fontsize * 3;
@@ -315,7 +317,7 @@ void HUD_SpectHUD()
                
                pos = panel_pos + vec2(vid_conwidth - 1, (vid_conheight + 450) / 4 + hud_fontsize.y);
                HUD_SpectHUD_drawTeamPlayers(pos, tm, rgb, true);
-       } else if(gametype == MAPINFO_TYPE_DUEL && autocvar_hud_spectatordueldisplay) {
+       } else if(gametype == MAPINFO_TYPE_DUEL) {
                // Set vars
                teamscore_fontsize = hud_fontsize * 3;
                teamname_fontsize = hud_fontsize * 1.5;