From 6fd078c68ebae15604822372d4d182f82a9de939 Mon Sep 17 00:00:00 2001 From: Samual Date: Sun, 13 Feb 2011 20:16:38 -0500 Subject: [PATCH] Add a cvar to control the font size used in hud_notify (note: Still relative, not in pixels.. could maybe be adjusted later) - this is so that text isn't always cut off all the time with the notify panel, as usually you can barely see a name when it's cut off with its giant text. 1.0 is original size, 0.8 is proposed size. Personally i'm going to use 0.5 though. --- hud_luminos.cfg | 1 + hud_luminos_minimal.cfg | 1 + hud_luminos_xhair_minimal.cfg | 1 + hud_nexuiz.cfg | 1 + qcsrc/client/autocvars.qh | 1 + qcsrc/client/hud.qc | 9 +++++---- 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hud_luminos.cfg b/hud_luminos.cfg index a3f3ed39e..e5b998a1f 100644 --- a/hud_luminos.cfg +++ b/hud_luminos.cfg @@ -108,6 +108,7 @@ seta hud_panel_notify_bg_alpha "" seta hud_panel_notify_bg_border "" seta hud_panel_notify_bg_padding "" seta hud_panel_notify_flip "0" +seta hud_panel_notify_fontsize "0.8" seta hud_panel_notify_print "1" seta hud_panel_timer 1 diff --git a/hud_luminos_minimal.cfg b/hud_luminos_minimal.cfg index 8e3941631..fef69f23f 100644 --- a/hud_luminos_minimal.cfg +++ b/hud_luminos_minimal.cfg @@ -108,6 +108,7 @@ seta hud_panel_notify_bg_alpha "" seta hud_panel_notify_bg_border "" seta hud_panel_notify_bg_padding "" seta hud_panel_notify_flip "1" +seta hud_panel_notify_fontsize "0.8" seta hud_panel_notify_print "0" seta hud_panel_timer 1 diff --git a/hud_luminos_xhair_minimal.cfg b/hud_luminos_xhair_minimal.cfg index 10f7afd14..80fe445e4 100644 --- a/hud_luminos_xhair_minimal.cfg +++ b/hud_luminos_xhair_minimal.cfg @@ -107,6 +107,7 @@ seta hud_panel_notify_bg_alpha "" seta hud_panel_notify_bg_border "" seta hud_panel_notify_bg_padding "" seta hud_panel_notify_flip "1" +seta hud_panel_notify_fontsize "0.8" seta hud_panel_notify_print "0" seta hud_panel_timer 1 diff --git a/hud_nexuiz.cfg b/hud_nexuiz.cfg index 681b7378e..cfa50af89 100644 --- a/hud_nexuiz.cfg +++ b/hud_nexuiz.cfg @@ -108,6 +108,7 @@ seta hud_panel_notify_bg_alpha "0" seta hud_panel_notify_bg_border "" seta hud_panel_notify_bg_padding "" seta hud_panel_notify_flip "0" +seta hud_panel_notify_fontsize "1" seta hud_panel_notify_print "1" seta hud_panel_timer 1 diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index df78b4f35..412ed1a7b 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -206,6 +206,7 @@ float autocvar_hud_panel_modicons; float autocvar_hud_panel_notify; float autocvar_hud_panel_notify_fadetime; float autocvar_hud_panel_notify_flip; +float autocvar_hud_panel_notify_fontsize; float autocvar_hud_panel_notify_print; float autocvar_hud_panel_notify_time; float autocvar_hud_panel_powerups; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index e8309ef4e..d55cfd866 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -3142,7 +3142,8 @@ void HUD_Notify (void) height = mySize_y/entries; vector fontsize; - fontsize = '0.5 0.5 0' * height; + float fontheight = height * autocvar_hud_panel_notify_fontsize; + fontsize = '0.5 0.5 0' * fontheight; float a; float when; @@ -3316,7 +3317,7 @@ void HUD_Notify (void) } attacker = textShortenToWidth(killnotify_attackers[j], 0.48 * mySize_x - height, fontsize, stringwidth_colors); - pos_attacker = pos + eX * (0.52 * mySize_x + height) + eY * (0.5 * fontsize_y + i * height); + pos_attacker = pos + eX * (0.52 * mySize_x + height) + eY * ((0.5 * fontsize_y + i * height) + (0.5 * (height - fontheight))); weap_pos = pos + eX * 0.5 * mySize_x - eX * height + eY * i * height; if(s != "") @@ -3402,8 +3403,8 @@ void HUD_Notify (void) victim = textShortenToWidth(killnotify_victims[j], 0.48 * mySize_x - height, fontsize, stringwidth_colors); :hud_config_notifyprint width_attacker = stringwidth(attacker, TRUE, fontsize); - pos_attacker = pos + eX * (0.48 * mySize_x - height - width_attacker) + eY * (0.5 * fontsize_y + i * height); - pos_victim = pos + eX * (0.52 * mySize_x + height) + eY * (0.5 * fontsize_y + i * height); + pos_attacker = pos + eX * (0.48 * mySize_x - height - width_attacker) + eY * ((0.5 * fontsize_y + i * height) + (0.5 * (height - fontheight))); + pos_victim = pos + eX * (0.52 * mySize_x + height) + eY * ((0.5 * fontsize_y + i * height) + (0.5 * (height - fontheight))); weap_pos = pos + eX * 0.5 * mySize_x - eX * height + eY * i * height; if(s != "") -- 2.39.2