From 83107dd6cad1111f3c1a98dde48927209ed68372 Mon Sep 17 00:00:00 2001 From: FruitieX Date: Wed, 13 Apr 2011 15:23:16 +0300 Subject: [PATCH] i forgot to center the names, lol --- qcsrc/client/shownames.qc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index 5492512d7..60110251d 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); } } -- 2.39.2