]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/centerprint.qc
Make the scoreboard a panel
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / centerprint.qc
index e998c0883fdc7cc9904fdedc3cfd4ad23b6ad0b1..7dfaa909e3ae7760ec9af933852354222adf437e 100644 (file)
@@ -155,13 +155,14 @@ void HUD_CenterPrint ()
        }
 
        // this panel fades only when the menu does
-       float hud_fade_alpha_save = 0;
-       if(scoreboard_fade_alpha)
-       {
-               hud_fade_alpha_save = hud_fade_alpha;
+       float hud_fade_alpha_save = hud_fade_alpha;
+       if(menu_enabled == 1)
+               hud_fade_alpha = 1;
+       else
                hud_fade_alpha = 1 - autocvar__menu_alpha;
-       }
+
        HUD_Panel_UpdateCvars();
+       hud_fade_alpha = hud_fade_alpha_save;
 
        if ( HUD_Radar_Clickable() )
        {
@@ -171,17 +172,13 @@ void HUD_CenterPrint ()
                panel_pos = eY * hud_panel_radar_bottom + eX * 0.5 * (vid_conwidth - panel_size_x);
                panel_size_y = min(panel_size_y, vid_conheight - hud_panel_radar_bottom);
        }
-       else if(scoreboard_fade_alpha)
+       else if(!autocvar__hud_configure && scoreboard_fade_alpha)
        {
-               hud_fade_alpha = hud_fade_alpha_save;
-
                // move the panel below the scoreboard
                if (scoreboard_bottom >= 0.96 * vid_conheight)
                        return;
                vector target_pos;
-
                target_pos = eY * scoreboard_bottom + eX * 0.5 * (vid_conwidth - panel_size.x);
-
                if(target_pos.y > panel_pos.y)
                {
                        panel_pos = panel_pos + (target_pos - panel_pos) * sqrt(scoreboard_fade_alpha);
@@ -263,12 +260,14 @@ void HUD_CenterPrint ()
                // also fade it based on positioning
                if(autocvar_hud_panel_centerprint_fade_subsequent)
                {
-                       a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passone_minalpha, (1 - (g / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passone))), 1); // pass one: all messages after the first have half theAlpha
-                       a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passtwo_minalpha, (1 - (g / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passtwo))), 1); // pass two: after that, gradually lower theAlpha even more for each message
+                       // pass one: all messages after the first have half alpha
+                       a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passone_minalpha, (1 - (g / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passone))), 1);
+                       // pass two: after that, gradually lower alpha even more for each message
+                       a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passtwo_minalpha, (1 - (g / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passtwo))), 1);
                }
                a *= panel_fg_alpha;
 
-               // finally set the size based on the new theAlpha from subsequent fading
+               // finally set the size based on the new alpha from subsequent fading
                sz = sz * (autocvar_hud_panel_centerprint_fade_subsequent_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_subsequent_minfontsize));
                drawfontscale = hud_scale * sz;