From 11efa0c408c9f8ec985d7796c5ae23c28bd87e92 Mon Sep 17 00:00:00 2001 From: FruitieX Date: Wed, 13 Apr 2011 17:19:27 +0300 Subject: [PATCH] smooth alpha fade clientside from 1500 to 2500 units distance, now a hard cut can be enabled serverside at 2500 whenever code for it works --- defaultXonotic.cfg | 10 ++++------ qcsrc/client/autocvars.qh | 2 ++ qcsrc/client/shownames.qc | 7 +++++++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 78727aca7..68a3acb70 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -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 diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 0fdea2961..50db35411 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -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; diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index 61ae8452c..bd3e7fd05 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -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; -- 2.39.2