]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Get the portrait to draw on the screen.
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 29 Jan 2012 21:12:35 +0000 (23:12 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 29 Jan 2012 21:12:35 +0000 (23:12 +0200)
data/qcsrc/client/hud.qc

index 976c1ec6a8354eb81366e547f8bd17e7dea54c66..f5d6466fa2eb0904757a354a45b1ac5947677e65 100644 (file)
@@ -25,6 +25,9 @@ float sbar_accuracy_hud;
 float sbar_scoreboard_alpha_name;\r
 float sbar_scoreboard_alpha_name_self;\r
 \r
+string portrait_image;\r
+float portrait_time;\r
+\r
 float ps_primary, ps_secondary;\r
 float ts_primary, ts_secondary;\r
 \r
@@ -1677,6 +1680,19 @@ void Sbar_DrawRaceStatus(vector pos)
        }\r
 }\r
 \r
+void Sbar_Portrait()\r
+{\r
+       vector left;\r
+       left_x = vid_conwidth / 2;\r
+       left_y = vid_conheight / 2;\r
+\r
+dprint(strcat(ftos(portrait_time), " --------\n"));\r
+dprint(strcat(portrait_image, " --------\n"));\r
+\r
+       if(portrait_time)\r
+               drawpic(left + '0 0 0', portrait_image, '192 96 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+}\r
+\r
 void Sbar_Score()\r
 {\r
        float score, distribution, leader;\r
@@ -3207,11 +3223,12 @@ void Sbar_Draw (void)
                        Sbar_PrintStomachboardItemPred(bottomleft - '-76 150 0', pred);\r
                }\r
 \r
-               // draw status, scores, timer, and ring\r
+               // draw status, scores, timer, ring and portrait\r
                Sbar_Status();\r
                Sbar_Score();\r
                Sbar_Timer();\r
                Sbar_Ring();\r
+               Sbar_Portrait();\r
 \r
                // draw strength/invincibility icon and timer\r
                CSQC_Strength_Timer();\r
@@ -3555,10 +3572,13 @@ void Ent_ReadPortrait()
 {\r
        string pl_model, pl_name, img;\r
        float pl_skin;\r
+\r
        pl_model = ReadString();\r
        pl_skin = ReadByte();\r
        pl_name = ReadString();\r
 \r
+       portrait_time = time;\r
+\r
        // obtain the image name from the text file\r
        float glob, i, fh;\r
        string fn;\r
@@ -3577,7 +3597,7 @@ void Ent_ReadPortrait()
                img = fgets(fh);\r
                if(pl_skin == stof(fgets(fh)))\r
                if(pl_model == fgets(fh))\r
-                       dprint(strcat(img, " ----------------\n"));\r
+                       portrait_image = strzone(img);\r
 \r
                fclose(fh);\r
        }\r