]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
smooth alpha fade clientside from 1500 to 2500 units distance, now a hard cut can...
authorFruitieX <fruitiex@gmail.com>
Wed, 13 Apr 2011 14:19:27 +0000 (17:19 +0300)
committerFruitieX <fruitiex@gmail.com>
Wed, 13 Apr 2011 14:19:27 +0000 (17:19 +0300)
defaultXonotic.cfg
qcsrc/client/autocvars.qh
qcsrc/client/shownames.qc

index 78727aca71ef7cd8ba01b56e301be0621882bea4..68a3acb70999203bc4ec2b90f8ac6bbbde453b3d 100644 (file)
@@ -402,7 +402,7 @@ net_connecttimeout 30
 sv_jumpstep 1 // step up stairs while jumping, makes it easier to reach ledges
 set ekg 0      "Throw huge amounts of gibs"
 
-sv_shownames_cull_distance 1000 "distance after which to not send origin/health/armor of another player"
+sv_shownames_cull_distance 2500 "distance after which to not send origin/health/armor of another player"
 
 cl_movement 1
 cl_movement_track_canjump 0
@@ -1188,9 +1188,6 @@ set sv_curl_serverpackages_auto 0 "automatically add packs with *.serverpackage
 
 set sv_motd ""
 
-seta cl_shownames 1    "show player names pointed to (0: never, 1: teamplay only, 2: always)"
-set sv_allow_shownames 1
-
 set g_waypoints_for_items 1    "make waypoints out of items, values: 0 = never, 1 = unless the mapper prevents it by worldspawn.spawnflags & 1, 2 = always"
 
 seta g_maplist_votable 6 "number of maps that are shown in the map voting at the end of a match"
@@ -1455,8 +1452,6 @@ seta hud_panel_physics_topspeed_time 4 "how many seconds the top speed takes to
 seta hud_panel_physics_acceleration_max 1.5 "acceleration progressbar gets completely filled up by this value (in g)"
 seta hud_panel_physics_acceleration_vertical 0 "include the acceleration on the Z-axis"
 
-seta hud_panel_shownames_sustain 0.5 "seconds that shownames will sustain after not aiming at a player anymore"
-
 seta hud_showbinds 1   "what to show in the HUD to indicate certain keys to press: 0 display commands, 1 bound keys, 2 both"
 seta hud_showbinds_limit 2     "maximum number of bound keys to show for a command. 0 for unlimited"
 
@@ -1492,6 +1487,9 @@ seta hud_shownames_status 2 "1 = draw health/armor status of teammates, 2 = same
 seta hud_shownames_height 15 "height of icons"
 seta hud_shownames_aspect 8 "aspect ratio of total drawing area per name"
 seta hud_shownames_fontsize 8 "font size"
+seta hud_shownames_mindistance 1000 "start fading alpha at this distance"
+seta hud_shownames_maxdistance 2000 "alpha is 0 at this distance"
+
 
 // scoreboard
 seta scoreboard_columns default
index 0fdea2961da9ee856fc1a2c1218a8ecf3a6f66d0..50db354117b5c82afcb6237bf249d22512c7b377 100644 (file)
@@ -278,6 +278,8 @@ float autocvar_hud_shownames_status;
 float autocvar_hud_shownames_height;
 float autocvar_hud_shownames_aspect;
 float autocvar_hud_shownames_fontsize;
+float autocvar_hud_shownames_mindistance;
+float autocvar_hud_shownames_maxdistance;
 string autocvar_hud_skin;
 float autocvar_loddebug;
 float autocvar_menu_mouse_speed;
index 61ae8452cf515d36ed1796b6daf6209e18a7c892..bd3e7fd052b60a3a12bde9cfdc8dc5147011a7d4 100644 (file)
@@ -42,6 +42,13 @@ void Draw_ShowNames()
         a = autocvar_hud_panel_fg_alpha;
         if(self.alpha)
             a *= self.alpha;
+        if(autocvar_hud_shownames_maxdistance)
+        {
+            float dist;
+            dist = vlen(self.origin - view_origin);
+
+            a *= ((autocvar_hud_shownames_maxdistance - autocvar_hud_shownames_mindistance) - max(0, dist - autocvar_hud_shownames_mindistance)) / (autocvar_hud_shownames_maxdistance - autocvar_hud_shownames_mindistance);
+        }
 
         // draw the sprite image
         vector o;