]> git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Limit name length for portraits, so they don't exceed the bounds of the image
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 30 Jan 2012 15:12:39 +0000 (17:12 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 30 Jan 2012 15:12:39 +0000 (17:12 +0200)
data/qcsrc/client/hud.qc

index 787a80ff929a56e698a68881501599aff56ce71d..ea52cda39bde653e9989428d84eb031fd283bba0 100644 (file)
@@ -1711,7 +1711,7 @@ void Sbar_Portrait()
        if(portrait_image && portrait_name) // prevent using bad strings\r
        {\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
+               drawcolorcodedstring(left - '120 -80 0' - fade_pos, textShortenToWidth(portrait_name, 120, '12 12 0', stringwidth_colors), '12 12 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
        }\r
 }\r
 \r