projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed wrong variable type
[rocksndiamonds.git]
/
src
/
screens.c
diff --git
a/src/screens.c
b/src/screens.c
index ee1bf704771964d71238f4cd1c4001b8ca7c03b8..ee53e0bff80341528592124d4d84a82899bf5500 100644
(file)
--- a/
src/screens.c
+++ b/
src/screens.c
@@
-4021,6
+4021,11
@@
static TreeInfo *type_name_node = NULL;
static char type_name_last[MAX_PLAYER_NAME_LEN + 1] = { 0 };
static int type_name_nr = 0;
static char type_name_last[MAX_PLAYER_NAME_LEN + 1] = { 0 };
static int type_name_nr = 0;
+static int getPlayerNameColor(char *name)
+{
+ return (strEqual(name, EMPTY_PLAYER_NAME) ? FC_BLUE : FC_RED);
+}
+
static void drawTypeNameText(char *name, struct TextPosInfo *pos,
boolean active)
{
static void drawTypeNameText(char *name, struct TextPosInfo *pos,
boolean active)
{
@@
-4093,7
+4098,7
@@
static void setTypeNameValues_Name(char *name, struct TextPosInfo *pos)
setString(&node->name, name);
setString(&node->name_sorting, name);
setString(&node->name, name);
setString(&node->name_sorting, name);
- node->color =
(strEqual(name, EMPTY_PLAYER_NAME) ? FC_BLUE : FC_RED
);
+ node->color =
getPlayerNameColor(name
);
pos->font = MENU_CHOOSE_TREE_FONT(node->color);
}
}
pos->font = MENU_CHOOSE_TREE_FONT(node->color);
}
}
@@
-4874,18
+4879,13
@@
void DrawChoosePlayerName(void)
for (i = 0; i < MAX_PLAYER_NAMES; i++)
{
for (i = 0; i < MAX_PLAYER_NAMES; i++)
{
- boolean team_mode = (!network.enabled && setup.team_mode);
- int tree_type = (team_mode ? TREE_TYPE_PLAYER_TEAM : TREE_TYPE_PLAYER_NAME);
- TreeInfo *ti = newTreeInfo_setDefaults(tree_type);
+ TreeInfo *ti = newTreeInfo_setDefaults(TREE_TYPE_PLAYER_NAME);
char identifier[32], name[MAX_PLAYER_NAME_LEN + 1];
int value = i;
ti->node_top = &player_name;
ti->sort_priority = 10000 + value;
char identifier[32], name[MAX_PLAYER_NAME_LEN + 1];
int value = i;
ti->node_top = &player_name;
ti->sort_priority = 10000 + value;
- ti->color = FC_RED;
-
- if (strEqual(global.user_names[i], EMPTY_PLAYER_NAME))
- ti->color = FC_BLUE;
+ ti->color = getPlayerNameColor(global.user_names[i]);
snprintf(identifier, sizeof(identifier), "%d", value);
snprintf(name, sizeof(name), "%s", global.user_names[i]);
snprintf(identifier, sizeof(identifier), "%d", value);
snprintf(name, sizeof(name), "%s", global.user_names[i]);