]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
i forgot to center the names, lol
authorFruitieX <fruitiex@gmail.com>
Wed, 13 Apr 2011 12:23:16 +0000 (15:23 +0300)
committerFruitieX <fruitiex@gmail.com>
Wed, 13 Apr 2011 12:23:16 +0000 (15:23 +0300)
qcsrc/client/shownames.qc

index 5492512d7738d82bda6da23207e46f6ce2e9be31..60110251d5821c79fcaf99009324c7d657093c49 100644 (file)
@@ -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);
         }
     }