]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix spacing after the spectator list and before the Rankings panel
authorterencehill <piuntn@gmail.com>
Mon, 5 Jul 2021 21:22:18 +0000 (23:22 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 5 Jul 2021 21:22:18 +0000 (23:22 +0200)
_hud_common.cfg
qcsrc/client/hud/panel/scoreboard.qc

index 7d697464a76097d608c1c316892cbd7e1cb0620b..2d5aa2cfa1a374d2fbc80ab89328177984611af9 100644 (file)
@@ -120,7 +120,7 @@ seta hud_panel_scoreboard_maxheight 0.6 "max height of the scoreboard; a few pla
 seta hud_panel_scoreboard_others_showscore 1 "show scores of players listed in the last row when the scoreboard reaches the max height"
 seta hud_panel_scoreboard_spectators_showping 1 "show ping of spectators"
 seta hud_panel_scoreboard_spectators_aligned 0 "align spectators in columns"
-seta hud_panel_scoreboard_spectators_position 1 "align spectators panel on scoreboard screen (0 = before accuracy and itemstats, 1 = before rankings, 2 = after rankings, 3 = after map stats)"
+seta hud_panel_scoreboard_spectators_position 1 "spectator list position (0 = before accuracy and itemstats, 1 = before rankings, 2 = after rankings, 3 = after map stats)"
 seta hud_panel_scoreboard_minwidth 0.6 "minimum width of the scoreboard"
 seta hud_panel_scoreboard_team_size_position 0 "where to show the team size (0 = do not show, 1 = left of scoreboard, 2 = right of scoreboard), will move team scores to the other side if necessary"
 seta hud_panel_scoreboard_playerid 0 "show player id (server entity number) next to player's name"
index 13319d3a9d2d69b496e3ce98e3b116de0f75533a..6133b18de6b9b76becf29352123fb32556884912 100644 (file)
@@ -1575,7 +1575,6 @@ vector Scoreboard_Rankings_Draw(vector pos, string ranktitle, entity pl, vector
 
        vector hl_rgb = rgb + '0.5 0.5 0.5';
 
-       pos.y += hud_fontsize.y;
        drawstring(pos + eX * panel_bg_padding, ranktitle, hud_fontsize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
        pos.y += 1.25 * hud_fontsize.y;
        if(panel.current_panel_bg != "0")
@@ -1762,6 +1761,8 @@ vector Scoreboard_Spectators_Draw(vector pos) {
                        break;
                }
        }
+       if (str != "") // if there's at least one spectator
+               pos.y += 0.5 * hud_fontsize.y;
 
        return pos;
 }
@@ -2077,6 +2078,8 @@ void Scoreboard_Draw()
                        drawcolorcodedstring(pos, sprintf(_("All-time fastest: %d%s ^7(%s^7)"), race_speedaward_alltimebest, race_speedaward_alltimebest_unit, ColorTranslateRGB(race_speedaward_alltimebest_holder)), hud_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
                        pos.y += 1.25 * hud_fontsize.y;
                }
+               if (race_speedaward || race_speedaward_alltimebest)
+                       pos.y += 0.25 * hud_fontsize.y;
                pos = Scoreboard_Rankings_Draw(pos, ranktitle, playerslots[player_localnum], panel_bg_color, bg_size);
        }
 
@@ -2131,7 +2134,7 @@ void Scoreboard_Draw()
                drawcolorcodedstring(pos + '0.5 0 0' * (panel_size.x - stringwidth(str, true, hud_fontsize)), str, hud_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
        }
 
-       pos.y += 2 * hud_fontsize.y;
+       pos.y += hud_fontsize.y;
        if (scoreboard_fade_alpha < 1)
                scoreboard_bottom = scoreboard_top + (pos.y - scoreboard_top) * scoreboard_fade_alpha;
        else if (pos.y != scoreboard_bottom)