+static int type_name_nr = 0;
+
+static void drawTypeNameText(char *name, struct TextPosInfo *pos,
+ boolean active)
+{
+ char text[MAX_PLAYER_NAME_LEN + 2] = { 0 };
+ int sx = mSX + ALIGNED_TEXT_XPOS(pos);
+ int sy = mSY + ALIGNED_TEXT_YPOS(pos);
+ int font_nr = (active ? FONT_ACTIVE(pos->font) : pos->font);
+ int font_width = getFontWidth(font_nr);
+
+ DrawBackgroundForFont(sx, sy, pos->width, pos->height, font_nr);
+
+ sprintf(text, "%s%c", name, (active ? '_' : '\0'));
+
+ pos->width = strlen(text) * font_width;
+ sx = mSX + ALIGNED_TEXT_XPOS(pos);
+
+ DrawText(sx, sy, text, font_nr);
+}