From: FruitieX Date: Wed, 13 Apr 2011 12:23:16 +0000 (+0300) Subject: i forgot to center the names, lol X-Git-Tag: xonotic-v0.5.0~284 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=83107dd6cad1111f3c1a98dde48927209ed68372;p=xonotic%2Fxonotic-data.pk3dir.git i forgot to center the names, lol --- diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index 5492512d77..60110251d5 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -71,6 +71,12 @@ void Draw_ShowNames() string s; s = GetPlayerName(self.the_entnum-1); s = textShortenToWidth(s, namesize, '1 1 0' * autocvar_hud_shownames_fontsize, stringwidth_colors); + + float width; + width = stringwidth(s, TRUE, '1 1 0' * autocvar_hud_shownames_fontsize); + + if (width != namesize) + namepos_x += (namesize - width) / 2; drawcolorcodedstring(namepos, s, '1 1 0' * autocvar_hud_shownames_fontsize, a, DRAWFLAG_NORMAL); } }