From: terencehill Date: Thu, 8 Sep 2016 15:54:51 +0000 (+0200) Subject: Allow customizing the minimum width of the scoreboard X-Git-Tag: xonotic-v0.8.2~600^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=00e5c8b88164852e94eadb7431fdc1f21a3ad48d;p=xonotic%2Fxonotic-data.pk3dir.git Allow customizing the minimum width of the scoreboard --- diff --git a/_hud_common.cfg b/_hud_common.cfg index 20e188f87..3e120e92c 100644 --- a/_hud_common.cfg +++ b/_hud_common.cfg @@ -107,10 +107,11 @@ seta hud_panel_infomessages_group0 1 "show group 0 messages (showing keys for no seta hud_panel_infomessages_group_time 6 "number of seconds a message of a group lasts before it gets changed" seta hud_panel_infomessages_group_fadetime 0.4 "group message fade in/out time" -seta hud_panel_scoreboard_namesize "15" "size limit of player names and relative column (multiplied by fontsize)" +seta hud_panel_scoreboard_namesize 15 "size limit of player names and relative column (multiplied by fontsize)" seta hud_panel_scoreboard_maxheight 0.5 "max height of the scoreboard; a few players that wouldn't fit into the scoreboard are listed in the last row" 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_minwidth 0.4 "minimum width of the scoreboard" // hud panel aliases alias quickmenu "cl_cmd hud quickmenu ${* ?}" diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 222e4e32b..c6df590b4 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -58,9 +58,10 @@ bool autocvar_hud_panel_scoreboard_accuracy_nocolors = false; bool autocvar_hud_panel_scoreboard_dynamichud = false; -bool autocvar_hud_panel_scoreboard_maxheight = 0.5; +float autocvar_hud_panel_scoreboard_maxheight = 0.5; bool autocvar_hud_panel_scoreboard_others_showscore = true; bool autocvar_hud_panel_scoreboard_spectators_showping = true; +float autocvar_hud_panel_scoreboard_minwidth = 0.4; void drawstringright(vector, string, vector, vector, float, float); @@ -1449,7 +1450,7 @@ void Scoreboard_Draw() panel_pos.y = max((autocvar_con_notify * autocvar_con_notifysize), panel_pos.y); float excess = max(0, max_namesize - autocvar_hud_panel_scoreboard_namesize * hud_fontsize.x); - float fixed_scoreboard_width = bound(vid_conwidth * 0.4, vid_conwidth - excess, vid_conwidth * 0.93); + float fixed_scoreboard_width = bound(vid_conwidth * autocvar_hud_panel_scoreboard_minwidth, vid_conwidth - excess, vid_conwidth * 0.93); panel_pos.x = 0.5 * (vid_conwidth - fixed_scoreboard_width); panel_size.x = fixed_scoreboard_width;