From 3c523b6347a90f38e8debe7f1e17f7101b5e6e30 Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 5 Jul 2021 23:22:18 +0200 Subject: [PATCH] Fix spacing after the spectator list and before the Rankings panel --- _hud_common.cfg | 2 +- qcsrc/client/hud/panel/scoreboard.qc | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/_hud_common.cfg b/_hud_common.cfg index 7d697464a..2d5aa2cfa 100644 --- a/_hud_common.cfg +++ b/_hud_common.cfg @@ -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" diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 13319d3a9..6133b18de 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -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) -- 2.39.2