seta sbar_vote_alreadyvoted_alpha 0.75 "alpha of the vote dialog after you have voted"\r
seta sbar_portrait 1 "enables portraits"\r
seta sbar_portrait_time 5 "how long a portrait lasts on the screen"\r
+seta sbar_portrait_fade 0.25 "amount of time fading the portrait takes from total time"\r
\r
// for menu server list (eventually make them have engine support?)\r
seta menu_slist_showfull 1 "show servers even if they are full and have no slots to join"\r
\r
void Sbar_Portrait()\r
{\r
+ float fade_time;\r
+ float fade1_start, fade1_end, fade2_start, fade2_end;\r
+ float fade_in, fade_out;\r
+\r
+ fade_time = cvar("sbar_portrait_time") * bound(0, cvar("sbar_portrait_fade"), 0.5);\r
+\r
+ fade1_start = portrait_time + cvar("sbar_portrait_time") - fade_time;\r
+ fade1_end = portrait_time + cvar("sbar_portrait_time");\r
+ fade2_start = portrait_time;\r
+ fade2_end = portrait_time + fade_time;\r
+\r
+ fade_in = bound(0, (time / fade1_end - 1) / (fade1_start / fade1_end - 1), 1);\r
+ fade_out = 1 - bound(0, (time / fade2_end - 1) / (fade2_start / fade2_end - 1), 1);\r
+\r
+ dprint(strcat(ftos(fade_in), " IN --------\n"));\r
+ dprint(strcat(ftos(fade_out), " OUT --------\n"));\r
+ dprint("________________\n");\r
+\r
// draws the portrait, using the values set in Ent_ReadPortrait\r
\r
vector left;\r