]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
one more feature is WIP (only show enemies when pointed at), other than that it shoul...
authorFruitieX <fruitiex@gmail.com>
Wed, 13 Apr 2011 13:10:06 +0000 (16:10 +0300)
committerFruitieX <fruitiex@gmail.com>
Wed, 13 Apr 2011 13:10:06 +0000 (16:10 +0300)
defaultXonotic.cfg
qcsrc/client/Main.qc
qcsrc/client/shownames.qc

index a314e49b8ea8751a6bb76fe9411d0b67cb202ed4..78727aca71ef7cd8ba01b56e301be0621882bea4 100644 (file)
@@ -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
index ee6d050af02c7beb85483be00e59a0fa2adede8c..e9a4c4017b08496351cbba8a44c263b42c80f0cd 100644 (file)
@@ -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();
 
index 60110251d5821c79fcaf99009324c7d657093c49..2e351fe42c8a27b90795c515400f3eb26f084b80 100644 (file)
@@ -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