]> git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Make the portrait slide in and out of the left edge
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 30 Jan 2012 15:01:41 +0000 (17:01 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 30 Jan 2012 15:01:41 +0000 (17:01 +0200)
data/defaultVT.cfg
data/qcsrc/client/hud.qc

index 9246af76aff316b31eaef07623150e51e85d01fe..6f1da7ddff7988210330e1071ecbaf5b7164857b 100644 (file)
@@ -1234,7 +1234,7 @@ seta sbar_ring2_alpha 0.75 "alpha of the second HUD ring"
 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
+seta sbar_portrait_fade 0.1 "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
index 0ccabe927b4c53faf0185f2fcb3bf8c50010539a..75ad88e211ca8b46883a8a49d412e7ed11536143 100644 (file)
@@ -1682,6 +1682,9 @@ void Sbar_DrawRaceStatus(vector pos)
 \r
 void Sbar_Portrait()\r
 {\r
+       // draws the portrait, using the values set in Ent_ReadPortrait\r
+\r
+       // make the portrait slide in and out of the left edge\r
        float fade_time;\r
        float fade1_start, fade1_end, fade2_start, fade2_end;\r
        float fade_in, fade_out;\r
@@ -1696,23 +1699,18 @@ void Sbar_Portrait()
        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
+       vector left, fade_pos;\r
        left_x = 0;\r
        left_y = vid_conheight / 2;\r
+       fade_pos_x = -130 * fade_in * fade_out;\r
 \r
        if(!cvar("sbar_portrait"))\r
                return;\r
 \r
        if(portrait_time + cvar("sbar_portrait_time") >= time)\r
        {\r
-               drawpic(left + '10 -80 0', portrait_image, '120 160 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-               drawcolorcodedstring(left + '10 80 0', portrait_name, '12 12 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+               drawpic(left - '120 80 0' - fade_pos, portrait_image, '120 160 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+               drawcolorcodedstring(left - '120 -80 0' - fade_pos, portrait_name, '12 12 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
        }\r
 }\r
 \r