*xpos = strlen(name);
}
-static void setTypeNameValues(char *name, int *font, boolean success)
+static void setTypeNameValues(char *name, struct TextPosInfo *pos,
+ boolean success)
{
TreeInfo *node = type_name_node;
if (success)
node->color = (strEqual(name, EMPTY_PLAYER_NAME) ? FC_BLUE : FC_RED);
- *font = FONT_TEXT_1 + node->color;
+ pos->font = FONT_TEXT_1 + node->color;
}
if (!success)
}
else if (key == KSYM_Return)
{
- setTypeNameValues(name, &font_nr, TRUE);
+ setTypeNameValues(name, pos, TRUE);
is_active = FALSE;
}
else if (key == KSYM_Escape)
{
- setTypeNameValues(name, &font_nr, FALSE);
+ setTypeNameValues(name, pos, FALSE);
is_active = FALSE;
}
pos->width = strlen(name) * font_width;
sx = mSX + ALIGNED_TEXT_XPOS(pos);
- DrawText(sx, sy, name, font_nr);
+ DrawText(sx, sy, name, pos->font);
StopTextInput();
}