From 4675bba7904ba8c2d480fe0087c52a05a9b7a600 Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 25 Jan 2019 19:09:44 +0100 Subject: [PATCH] Highlight values from 0 to 100 of health and armor in the status bar above player's head --- _hud_common.cfg | 1 + qcsrc/client/autocvars.qh | 1 + qcsrc/client/shownames.qc | 2 ++ 3 files changed, 4 insertions(+) diff --git a/_hud_common.cfg b/_hud_common.cfg index 75e8eb8d6f..e31655e258 100644 --- a/_hud_common.cfg +++ b/_hud_common.cfg @@ -186,6 +186,7 @@ seta hud_shownames_crosshairdistance_antioverlap 0 "allow antioverlap to work as seta hud_shownames_self 0 "also include your own name to be shown when third person camera mode is on (chase_active/cl_eventchase)" seta hud_shownames_status 1 "1 = draw health/armor status of teammates" seta hud_shownames_statusbar_height 4 "height of status bar" +seta hud_shownames_statusbar_highlight 1 "Always highlight values of health and armor from 0 to half status bar" seta hud_shownames_aspect 8 "aspect ratio of total drawing area per name" seta hud_shownames_fontsize 12 "font size" seta hud_shownames_decolorize 1 "1 = decolorize name in team games, 2 = decolorize always" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index db756608de..9300293408 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -381,6 +381,7 @@ float autocvar_hud_shownames_crosshairdistance_antioverlap; bool autocvar_hud_shownames_self; bool autocvar_hud_shownames_status; float autocvar_hud_shownames_statusbar_height; +float autocvar_hud_shownames_statusbar_highlight = 1; float autocvar_hud_shownames_aspect; float autocvar_hud_shownames_fontsize; int autocvar_hud_shownames_decolorize; diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index 2fc1559494..53e7ae4a91 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -162,6 +162,8 @@ void Draw_ShowNames(entity this) { vector pos = namepos + eY * autocvar_hud_shownames_fontsize * resize; vector sz = vec2(0.5 * mySize.x, resize * autocvar_hud_shownames_statusbar_height); + if (autocvar_hud_shownames_statusbar_highlight) + drawfill(pos + eX * 0.25 * mySize.x, sz, '0.7 0.7 0.7', a / 2, DRAWFLAG_NORMAL); if (this.healthvalue > 0) { HUD_Panel_DrawProgressBar(pos, sz, "nametag_statusbar", -- 2.39.2