]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Limit name lengths in stomach board
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 5 Sep 2010 17:02:28 +0000 (20:02 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 5 Sep 2010 17:02:28 +0000 (20:02 +0300)
data/qcsrc/client/sbar.qc

index 1117408c8ecde8e08c9adb62d06eb56fdd0755c9..bb210996291e90e185ffd6bfd3ef1ab98e3e8bd7 100644 (file)
@@ -963,9 +963,6 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
        for(fieldcounter = 1; fieldcounter <= field_number; ++fieldcounter)\r
        {\r
                field = -fieldcounter;\r
-               if(field == SP_SEPARATOR)\r
-                       break;\r
-\r
                str = Sbar_GetStomachField(pl, field);\r
 \r
                // row highlighting\r
@@ -984,7 +981,7 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
                        drawpic(pos, "gfx/sb_playercolor_pants", '22 11 0', colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
                        pos_x += 24;\r
-                       drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawcolorcodedstring(pos, textShortenToWidth(str, 138, '11 11 0', stringwidth_colors), '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                }\r
 \r
                if(field == ST_HEALTH)\r
@@ -1015,9 +1012,6 @@ void Sbar_PrintStomachboardItemPred(vector pos, entity pl)
        for(fieldcounter2 = 1; fieldcounter2 <= field_number; ++fieldcounter2)\r
        {\r
                field = -fieldcounter2;\r
-               if(field == SP_SEPARATOR)\r
-                       break;\r
-\r
                str = Sbar_GetStomachFieldPred(pl, field);\r
 \r
                if(field == STP_NAME) {\r
@@ -1027,7 +1021,7 @@ void Sbar_PrintStomachboardItemPred(vector pos, entity pl)
                        drawpic(pos, "gfx/sb_playercolor_pants", '22 11 0', colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
                        pos_x += 24;\r
-                       drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawcolorcodedstring(pos, textShortenToWidth(str, 122, '11 11 0', stringwidth_colors), '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                }\r
        }\r
 }\r