Slightly extend underline of normal centerprint titles (it looks better and is consis...
authorterencehill <piuntn@gmail.com>
Sun, 3 Jul 2022 12:41:51 +0000 (14:41 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 3 Jul 2022 12:41:51 +0000 (14:41 +0200)
qcsrc/client/hud/panel/centerprint.qc

index e5144bd74d7c8d7c0da2f0faab64122cab22ba74..1e388c4d8c6dd165a1fbdacc3ccb7d52e7ab63df 100644 (file)
@@ -269,11 +269,9 @@ void HUD_CenterPrint()
        // Show title if available
        if(centerprint_title != "" || centerprint_title_left != "") {
                vector fontsize = cp_fontsize * autocvar_hud_panel_centerprint_fontscale_title;
        // Show title if available
        if(centerprint_title != "" || centerprint_title_left != "") {
                vector fontsize = cp_fontsize * autocvar_hud_panel_centerprint_fontscale_title;
-               float width = 0, right_width = 0, left_width = 0,  max_rl_width = 0;
+               float width = 0, right_width = 0, left_width = 0, max_rl_width = 0;
                if (centerprint_title != "")
                if (centerprint_title != "")
-               {
                        width = stringwidth(centerprint_title, true, fontsize);
                        width = stringwidth(centerprint_title, true, fontsize);
-               }
                else
                {
                        right_width = stringwidth(centerprint_title_right, true, fontsize);
                else
                {
                        right_width = stringwidth(centerprint_title_right, true, fontsize);
@@ -327,7 +325,7 @@ void HUD_CenterPrint()
                        drawfill(pos + vec2(width - max_rl_width - padding * 2, 0), vec2(max_rl_width + padding * 2, 1), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
                }
                else
                        drawfill(pos + vec2(width - max_rl_width - padding * 2, 0), vec2(max_rl_width + padding * 2, 1), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
                }
                else
-                       drawfill(pos, vec2(width, 1), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                       drawfill(pos - eX * padding, vec2(width + 2 * padding, 1), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
 
                if (autocvar_hud_panel_centerprint_flip)
                        pos.y -= cp_fontsize.y * CENTERPRINT_TITLE_SPACING;
 
                if (autocvar_hud_panel_centerprint_flip)
                        pos.y -= cp_fontsize.y * CENTERPRINT_TITLE_SPACING;