From: FruitieX Date: Sat, 2 Apr 2011 21:37:03 +0000 (+0300) Subject: panel enable cvar 1 = teammates only, 2 = everyone X-Git-Tag: xonotic-v0.5.0~305^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f0eb018660a3673b9013272577927a77fd8fbdb4;p=xonotic%2Fxonotic-data.pk3dir.git panel enable cvar 1 = teammates only, 2 = everyone --- 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.