From: MirceaKitsune Date: Mon, 30 Jan 2012 15:12:39 +0000 (+0200) Subject: Limit name length for portraits, so they don't exceed the bounds of the image X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ffb4e0315bf3d8717131a5fc7e85613383be004e;p=voretournament%2Fvoretournament.git Limit name length for portraits, so they don't exceed the bounds of the image --- diff --git a/data/qcsrc/client/hud.qc b/data/qcsrc/client/hud.qc index 787a80ff..ea52cda3 100644 --- a/data/qcsrc/client/hud.qc +++ b/data/qcsrc/client/hud.qc @@ -1711,7 +1711,7 @@ void Sbar_Portrait() if(portrait_image && portrait_name) // prevent using bad strings { drawpic(left - '120 80 0' - fade_pos, portrait_image, '120 160 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); - drawcolorcodedstring(left - '120 -80 0' - fade_pos, portrait_name, '12 12 0', sbar_alpha_fg, DRAWFLAG_NORMAL); + drawcolorcodedstring(left - '120 -80 0' - fade_pos, textShortenToWidth(portrait_name, 120, '12 12 0', stringwidth_colors), '12 12 0', sbar_alpha_fg, DRAWFLAG_NORMAL); } }