From f0eb018660a3673b9013272577927a77fd8fbdb4 Mon Sep 17 00:00:00 2001 From: FruitieX Date: Sun, 3 Apr 2011 00:37:03 +0300 Subject: [PATCH] panel enable cvar 1 = teammates only, 2 = everyone --- _hud_descriptions.cfg | 2 +- qcsrc/client/Main.qc | 27 +++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/_hud_descriptions.cfg b/_hud_descriptions.cfg index 10066e8d6..4da15d01d 100644 --- a/_hud_descriptions.cfg +++ b/_hud_descriptions.cfg @@ -216,7 +216,7 @@ seta hud_panel_infomessages_bg_border "" "if set to something else than \"\" = o seta hud_panel_infomessages_bg_padding "" "if set to something else than \"\" = override default padding of contents from border" seta hud_panel_infomessages_flip "" "1 = align the items to the right" -seta hud_panel_shownames "" "enable/disable this panel +seta hud_panel_shownames "" "enable/disable this panel, 1 = teammates only, 2 = everyone" seta hud_panel_shownames_pos "" "position of this base of the panel" seta hud_panel_shownames_size "" "size of this panel" seta hud_panel_shownames_bg "" "if set to something else than \"\" = override default background" diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 7d84aa161..ea62c07df 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -1331,12 +1331,31 @@ void Net_WeaponComplain() { void Net_ShowNames() { + string thename; + float thehealth, thearmor; + if(shownames_netname) strunzone(shownames_netname); - shownames_netname = strzone(ReadString()); - shownames_health = ReadByte(); - shownames_armor = ReadByte(); - shownames_time = time + autocvar_hud_panel_shownames_sustain; + thename = strzone(ReadString()); + thehealth = ReadByte(); + thearmor = ReadByte(); + + if(autocvar_hud_panel_shownames == 1 && thehealth > 0) // teammates only + { + shownames_netname = thename; + shownames_health = thehealth; + shownames_armor = thearmor; + + shownames_time = time + autocvar_hud_panel_shownames_sustain; + } + else if(autocvar_hud_panel_shownames == 2) + { + shownames_netname = thename; + shownames_health = thehealth; + shownames_armor = thearmor; + + shownames_time = time + autocvar_hud_panel_shownames_sustain; + } } // CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer. -- 2.39.2