From: Holger Schemel Date: Mon, 19 Oct 2020 21:10:58 +0000 (+0200) Subject: changed setting font for player name after typing X-Git-Tag: 4.2.1.0~27 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=46117e2d3c0ed234252e1e39a62617e6e77c09b5;p=rocksndiamonds.git changed setting font for player name after typing --- diff --git a/src/screens.c b/src/screens.c index c62ffec9..5bbe467e 100644 --- a/src/screens.c +++ b/src/screens.c @@ -4056,7 +4056,8 @@ static void getTypeNameValues(char *name, struct TextPosInfo *pos, int *xpos) *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; @@ -4074,7 +4075,7 @@ static void setTypeNameValues(char *name, int *font, boolean success) 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) @@ -4162,13 +4163,13 @@ static void HandleTypeNameExt(boolean initialize, Key key) } 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; } @@ -4188,7 +4189,7 @@ static void HandleTypeNameExt(boolean initialize, Key key) 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(); }