projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed setting text size for clearing input on name selection screen
[rocksndiamonds.git]
/
src
/
screens.c
diff --git
a/src/screens.c
b/src/screens.c
index 6378dbb469e0cad970a5f391c06729e16122e0cb..43212e185991dd038c6ee3e8cda27e5c5924b0c0 100644
(file)
--- a/
src/screens.c
+++ b/
src/screens.c
@@
-4007,7
+4007,7
@@
static int getPlayerNameColor(char *name)
}
static void drawTypeNameText(char *name, struct TextPosInfo *pos,
}
static void drawTypeNameText(char *name, struct TextPosInfo *pos,
-
boolean active)
+ boolean active)
{
char text[MAX_PLAYER_NAME_LEN + 2] = { 0 };
boolean multiple_users = (game_status == GAME_MODE_PSEUDO_TYPENAMES);
{
char text[MAX_PLAYER_NAME_LEN + 2] = { 0 };
boolean multiple_users = (game_status == GAME_MODE_PSEUDO_TYPENAMES);
@@
-4015,8
+4015,12
@@
static void drawTypeNameText(char *name, struct TextPosInfo *pos,
int sy = (multiple_users ? amSY + pos->y : mSY + ALIGNED_TEXT_YPOS(pos));
int font_nr = (active ? FONT_ACTIVE(pos->font) : pos->font);
int font_width = getFontWidth(font_nr);
int sy = (multiple_users ? amSY + pos->y : mSY + ALIGNED_TEXT_YPOS(pos));
int font_nr = (active ? FONT_ACTIVE(pos->font) : pos->font);
int font_width = getFontWidth(font_nr);
+ int font_xoffset = getFontDrawOffsetX(font_nr);
+ int font_yoffset = getFontDrawOffsetY(font_nr);
+ int font_sx = sx + font_xoffset;
+ int font_sy = sy + font_yoffset;
- DrawBackgroundForFont(
sx,
sy, pos->width, pos->height, font_nr);
+ DrawBackgroundForFont(
font_sx, font_
sy, pos->width, pos->height, font_nr);
sprintf(text, "%s%c", name, (active ? '_' : '\0'));
sprintf(text, "%s%c", name, (active ? '_' : '\0'));
@@
-5161,6
+5165,9
@@
void DrawChoosePlayerName(void)
if (player_name_current == NULL)
player_name_current = player_name;
if (player_name_current == NULL)
player_name_current = player_name;
+ // set text size for main name input (also used on name selection screen)
+ InitializeMainControls();
+
DrawChooseTree(&player_name_current);
}
DrawChooseTree(&player_name_current);
}