From fc9d4e9e9407d9001ffa721bf91ca0252d999eac Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sun, 5 Sep 2010 20:02:28 +0300 Subject: [PATCH] Limit name lengths in stomach board --- data/qcsrc/client/sbar.qc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index 1117408c..bb210996 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -963,9 +963,6 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl) for(fieldcounter = 1; fieldcounter <= field_number; ++fieldcounter) { field = -fieldcounter; - if(field == SP_SEPARATOR) - break; - str = Sbar_GetStomachField(pl, field); // row highlighting @@ -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); pos_x += 24; - drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos, textShortenToWidth(str, 138, '11 11 0', stringwidth_colors), '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL); } if(field == ST_HEALTH) @@ -1015,9 +1012,6 @@ void Sbar_PrintStomachboardItemPred(vector pos, entity pl) for(fieldcounter2 = 1; fieldcounter2 <= field_number; ++fieldcounter2) { field = -fieldcounter2; - if(field == SP_SEPARATOR) - break; - str = Sbar_GetStomachFieldPred(pl, field); if(field == STP_NAME) { @@ -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); pos_x += 24; - drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos, textShortenToWidth(str, 122, '11 11 0', stringwidth_colors), '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL); } } } -- 2.39.2