Oops! Do this properly and fix an issue. Now it can be merged
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 5 Sep 2010 11:22:44 +0000 (14:22 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 5 Sep 2010 11:22:44 +0000 (14:22 +0300)
data/qcsrc/client/main.qh
data/qcsrc/client/sbar.qc

index e01962667423c10d65bd6373ea328af16d16435b..7353394bbb473229431acab51962c32b32aa8cd0 100644 (file)
@@ -80,6 +80,8 @@ const float COLOR_SPECTATOR = 1337;
 #define ST_NAME -2\r
 #define ST_HEALTH -3\r
 \r
+#define STP_NAME -1\r
+\r
 float sbar_field[MAX_SBAR_FIELDS + 1];\r
 float sbar_size[MAX_SBAR_FIELDS + 1];\r
 string sbar_title[MAX_SBAR_FIELDS + 1];\r
index 0022a7c11e137cc0a1c0a7b0454d09f141038f5b..303b9978e1fbe461f4d63f464015d2c4acfed3dd 100644 (file)
@@ -716,16 +716,6 @@ string Sbar_GetField(entity pl, float field)
 \r
 string Sbar_GetStomachField(entity pl, float field)\r
 {\r
-       sbar_field_rgb = '1 1 1';\r
-       sbar_field_icon0 = "";\r
-       sbar_field_icon1 = "";\r
-       sbar_field_icon2 = "";\r
-       sbar_field_icon0_rgb = '1 1 1';\r
-       sbar_field_icon1_rgb = '1 1 1';\r
-       sbar_field_icon2_rgb = '1 1 1';\r
-       sbar_field_icon0_alpha = 1;\r
-       sbar_field_icon1_alpha = 1;\r
-       sbar_field_icon2_alpha = 1;\r
        switch(field)\r
        {\r
                case ST_HIGHLIGHT:\r
@@ -743,6 +733,18 @@ string Sbar_GetStomachField(entity pl, float field)
        //return "error";\r
 }\r
 \r
+string Sbar_GetStomachFieldPred(entity pl, float field)\r
+{\r
+       switch(field)\r
+       {\r
+               case STP_NAME:\r
+                       return GetPlayerName(pl.sv_entnum);\r
+               default:\r
+                       return "N/A";\r
+       }\r
+       //return "error";\r
+}\r
+\r
 float xmin, xmax, ymin, ymax, sbwidth;\r
 float sbar_fixscoreboardcolumnwidth_len;\r
 float sbar_fixscoreboardcolumnwidth_iconlen;\r
@@ -1016,9 +1018,9 @@ void Sbar_PrintStomachboardItemPred(vector pos, entity pl)
                if(field == SP_SEPARATOR)\r
                        break;\r
 \r
-               str = Sbar_GetStomachField(pl, field);\r
+               str = Sbar_GetStomachFieldPred(pl, field);\r
 \r
-               if(field == ST_NAME) {\r
+               if(field == STP_NAME) {\r
                        f = stof(getplayerkey(pl.sv_entnum, "colors"));\r
                        drawpic(pos, "gfx/sb_playercolor_base", '22 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                        drawpic(pos, "gfx/sb_playercolor_shirt", '22 11 0', colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL);\r