From 943ea31e9c85d8646218e5a65cf020fe07f4e5fc Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sat, 9 Jul 2011 14:34:13 +0300 Subject: [PATCH] Use a different cvar setting for showing enemies or team mates --- data/defaultVT.cfg | 3 +-- data/qcsrc/client/shownames.qc | 13 +------------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index 4d2f97e4..9b32b871 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -1148,8 +1148,7 @@ seta hud_contents_water_color "0.4 0.3 0.3" seta hud_contents_stomach_alpha 0.2 "alpha of the stomach color blend when inside it" seta hud_contents_stomach_color "0.3 0.2 0" -seta hud_shownames 1 "draw names and health/armor of nearby players" -seta hud_shownames_enemies 2 "1 = draw names of enemies you point at (TODO), 2 = draw names of all enemies in view" +seta hud_shownames 2 "1 = draw names of nearby team mates, 2 = also draw names of nearby enemies" seta hud_shownames_status 2 "1 = show when the team mate can be healed, 2 = also show health, 3 = also show armor" seta hud_shownames_aspect 8 "aspect ratio of total drawing area per name" seta hud_shownames_fontsize 12 "font size" diff --git a/data/qcsrc/client/shownames.qc b/data/qcsrc/client/shownames.qc index a1ed5f99..35fdd1a6 100644 --- a/data/qcsrc/client/shownames.qc +++ b/data/qcsrc/client/shownames.qc @@ -20,7 +20,7 @@ void Draw_ShowNames(entity ent) if(teamplay && (GetPlayerColor(player_localentnum - 1) == GetPlayerColor(ent.sv_entnum - 1))) sameteam = TRUE; - if(sameteam || (!sameteam && cvar("hud_shownames_enemies"))) + if(sameteam || (!sameteam && cvar("hud_shownames") > 1)) { ent.origin_z += cvar("hud_shownames_offset"); @@ -29,18 +29,7 @@ void Draw_ShowNames(entity ent) ent.origin_z -= (g_healthsize - ent.healthvalue) * cvar("hud_shownames_offset_healthsize"); if(!sameteam) - { - /* WIP, why does trace_ent != ent not work as intended here? - if(cvar("hud_shownames_enemies") != 2) // player has to point at enemy if so - { - traceline(view_origin, view_origin + view_forward * MAX_SHOT_DISTANCE, MOVETYPE_FLY, world); - print("trace_endpos: ", vtos(trace_endpos), " view_origin: ", vtos(view_origin), "\n"); - if(trace_ent != ent) - return; - }*/ - traceline(ent.origin, view_origin, 1, ent); - } vector o, eo; o = project_3d_to_2d(ent.origin); -- 2.39.2