From 80622ae94bfd6c7c9e102f0195507d310da79361 Mon Sep 17 00:00:00 2001 From: FruitieX Date: Wed, 13 Apr 2011 16:10:06 +0300 Subject: [PATCH] one more feature is WIP (only show enemies when pointed at), other than that it should be done --- defaultXonotic.cfg | 6 +++--- qcsrc/client/Main.qc | 3 +++ qcsrc/client/shownames.qc | 9 +++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index a314e49b8..78727aca7 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1487,11 +1487,11 @@ seta hud_contents_water_alpha 0.5 "alpha of the water color blend when inside it seta hud_contents_water_color "0.4 0.3 0.3" seta hud_shownames 1 "draw names and health/armor of nearby players" -seta hud_shownames_enemies 1 "also draw names of enemies" +seta hud_shownames_enemies 1 "1 = draw names of enemies you point at, 2 = draw names of all enemies in view" seta hud_shownames_status 2 "1 = draw health/armor status of teammates, 2 = same as 1, but draw health/armor icons with a question mark on enemies in teamgames" seta hud_shownames_height 15 "height of icons" -seta hud_shownames_aspect 8 "aspect ratio" -seta hud_shownames_fontsize 8 "aspect ratio" +seta hud_shownames_aspect 8 "aspect ratio of total drawing area per name" +seta hud_shownames_fontsize 8 "font size" // scoreboard seta scoreboard_columns default diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index ee6d050af..e9a4c4017 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -914,6 +914,9 @@ void Ent_ShowNames() // entity init, TODO can this be done only once somehow? self.the_entnum = ReadByte(); // TODO: fixme to only send once somehow self.draw2d = Draw_ShowNames; + //self.movetype = MOVETYPE_FLY; // movetype needed so we can traceline? + self.mins = '-20 -20 -24'; + self.maxs = '20 20 45'; sf = ReadByte(); diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index 60110251d..2e351fe42 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -21,6 +21,15 @@ void Draw_ShowNames() traceline(self.origin, view_origin, 1, self); if(trace_endpos != view_origin) return; + + /* WIP, why does trace_ent != self not work as intended here? + if(autocvar_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 != self) + return; + }*/ } // draw the sprite image -- 2.39.2