From: FruitieX Date: Wed, 13 Apr 2011 13:18:42 +0000 (+0300) Subject: make them fade out/in :o X-Git-Tag: xonotic-v0.5.0~282 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a3d3f9042b24ba2a22b41264b1e67538a053fe90;p=xonotic%2Fxonotic-data.pk3dir.git make them fade out/in :o --- diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index 2e351fe42..b1e971f35 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -11,16 +11,20 @@ void Draw_ShowNames() if(self.sameteam || (!self.sameteam && autocvar_hud_shownames_enemies)) { - float a; - a = autocvar_hud_panel_fg_alpha; - InterpolateOrigin_Do(); if(!self.sameteam) { traceline(self.origin, view_origin, 1, self); - if(trace_endpos != view_origin) - return; + if(trace_endpos != view_origin) // fade out + { + self.alpha = max(0, self.alpha - 4 * frametime); + if(!self.alpha) + return; + } + else // fade in + self.alpha = min(1, self.alpha + 4 * frametime); + /* 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 @@ -32,6 +36,11 @@ void Draw_ShowNames() }*/ } + // otherwise, increase alpha until 1 + + float a; + a = autocvar_hud_panel_fg_alpha * self.alpha; + // draw the sprite image vector o; o = project_3d_to_2d(self.origin);