projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
cf4113a
)
fixed text positions and fonts when typing player name
author
Holger Schemel
<info@artsoft.org>
Tue, 27 Oct 2020 23:22:48 +0000
(
00:22
+0100)
committer
Holger Schemel
<info@artsoft.org>
Sun, 13 Dec 2020 23:58:00 +0000
(
00:58
+0100)
src/screens.c
patch
|
blob
|
history
diff --git
a/src/screens.c
b/src/screens.c
index a0c1805e3e4d611f4d9e7cf79d007be823d67543..c37ca97933325565571fa739398b4c2321ff836a 100644
(file)
--- a/
src/screens.c
+++ b/
src/screens.c
@@
-4024,8
+4024,9
@@
static void drawTypeNameText(char *name, struct TextPosInfo *pos,
boolean active)
{
char text[MAX_PLAYER_NAME_LEN + 2] = { 0 };
boolean active)
{
char text[MAX_PLAYER_NAME_LEN + 2] = { 0 };
- int sx = mSX + ALIGNED_TEXT_XPOS(pos);
- int sy = mSY + ALIGNED_TEXT_YPOS(pos);
+ boolean multiple_users = (game_status == GAME_MODE_PSEUDO_TYPENAMES);
+ int sx = (multiple_users ? amSX + pos->x : mSX + ALIGNED_TEXT_XPOS(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 font_nr = (active ? FONT_ACTIVE(pos->font) : pos->font);
int font_width = getFontWidth(font_nr);
@@
-4034,7
+4035,7
@@
static void drawTypeNameText(char *name, struct TextPosInfo *pos,
sprintf(text, "%s%c", name, (active ? '_' : '\0'));
pos->width = strlen(text) * font_width;
sprintf(text, "%s%c", name, (active ? '_' : '\0'));
pos->width = strlen(text) * font_width;
- sx =
mSX + ALIGNED_TEXT_XPOS(pos
);
+ sx =
(multiple_users ? amSX + pos->x : mSX + ALIGNED_TEXT_XPOS(pos)
);
DrawText(sx, sy, text, font_nr);
}
DrawText(sx, sy, text, font_nr);
}
@@
-4053,16
+4054,15
@@
static void getTypeNameValues(char *name, struct TextPosInfo *pos, int *xpos)
TreeInfo *node_first = getTreeInfoFirstGroupEntry(ti);
int xpos = MENU_SCREEN_START_XPOS;
int ypos = MENU_SCREEN_START_YPOS + ti->cl_cursor;
TreeInfo *node_first = getTreeInfoFirstGroupEntry(ti);
int xpos = MENU_SCREEN_START_XPOS;
int ypos = MENU_SCREEN_START_YPOS + ti->cl_cursor;
- int font_width = getFontWidth(pos->font);
type_name_node = getTreeInfoFromPos(node_first, entry_pos);
type_name_nr = entry_pos;
strcpy(name, type_name_node->name);
type_name_node = getTreeInfoFromPos(node_first, entry_pos);
type_name_nr = entry_pos;
strcpy(name, type_name_node->name);
- pos->x = xpos *
font_width
;
- pos->y = ypos *
font_width
;
- pos->width = MAX_PLAYER_NAME_LEN *
font_width
;
+ pos->x = xpos *
32
;
+ pos->y = ypos *
32
;
+ pos->width = MAX_PLAYER_NAME_LEN *
32
;
}
else
{
}
else
{
@@
-4093,7
+4093,7
@@
static void setTypeNameValues_Name(char *name, struct TextPosInfo *pos)
setString(&node->name_sorting, name);
node->color = (strEqual(name, EMPTY_PLAYER_NAME) ? FC_BLUE : FC_RED);
setString(&node->name_sorting, name);
node->color = (strEqual(name, EMPTY_PLAYER_NAME) ? FC_BLUE : FC_RED);
- pos->font =
(node->color == FC_RED ? FONT_INPUT_1 : FONT_VALUE_OLD)
;
+ pos->font =
FONT_TEXT_1 + node->color
;
}
}
}
}