static void InitializeMainControls()
{
- boolean local_team_mode = (!options.network && setup.team_mode);
+ boolean local_team_mode = (!network.enabled && setup.team_mode);
int i;
/* set main control text values to dynamically determined values */
}
else if (pos == MAIN_CONTROL_GAME)
{
- StartGameActions(options.network, setup.autorecord, level.random_seed);
+ StartGameActions(network.enabled, setup.autorecord, level.random_seed);
}
else if (pos == MAIN_CONTROL_SETUP)
{
TYPE_YES_NO |
TYPE_YES_NO_AUTO |
TYPE_STRING |
+ TYPE_PLAYER |
TYPE_ECS_AGA |
TYPE_KEYTEXT |
TYPE_ENTER_LIST))
if (menu_info[choice].type & menu_navigation_type ||
menu_info[choice].type & TYPE_BOOLEAN_STYLE ||
- menu_info[choice].type & TYPE_YES_NO_AUTO)
+ menu_info[choice].type & TYPE_YES_NO_AUTO ||
+ menu_info[choice].type & TYPE_PLAYER)
button = MB_MENU_CHOICE;
}
else if (dy)
static struct TokenInfo setup_info_game[] =
{
{ TYPE_SWITCH, &setup.team_mode, "Team-Mode (Multi-Player):" },
+ { TYPE_SWITCH, &setup.network_mode, "Network Multi-Player Mode:" },
+ { TYPE_PLAYER, &setup.network_player_nr,"Preferred Network Player:" },
{ TYPE_YES_NO, &setup.input_on_focus, "Only Move Focussed Player:" },
{ TYPE_SWITCH, &setup.time_limit, "Time Limit:" },
{ TYPE_SWITCH, &setup.handicap, "Handicap:" },
else if (type & TYPE_YES_NO_AUTO)
return (*(int *)value == AUTO ? FONT_OPTION_ON :
*(int *)value == FALSE ? FONT_OPTION_OFF : FONT_OPTION_ON);
+ else if (type & TYPE_PLAYER)
+ return FONT_VALUE_1;
else
return FONT_VALUE_1;
}
{
xpos = menu_screen_value_xpos - 1;
}
+ else if (type & TYPE_PLAYER)
+ {
+ int displayed_player_nr = *(int *)value + 1;
+
+ value_string = getSetupValue(TYPE_INTEGER, (void *)&displayed_player_nr);
+ }
startx = mSX + xpos * 32;
starty = mSY + ypos * 32;
DrawText(startx, starty, value_string, font_nr);
+ if (type & TYPE_PLAYER)
+ {
+ int player_nr = *(int *)value;
+ int xoff = getFontWidth(font_nr);
+
+ DrawFixedGraphicThruMaskExt(drawto, startx + xoff, starty,
+ PLAYER_NR_GFX(IMG_PLAYER_1, player_nr), 0);
+ }
+
if (font_draw_xoffset_modified)
getFontBitmapInfo(font_nr)->draw_xoffset = font_draw_xoffset_old;
}
if (key != KSYM_UNDEFINED)
*(Key *)si->value = key;
}
+ else if (si->type & TYPE_PLAYER)
+ {
+ int player_nr = *(int *)si->value;
+
+ if (dx)
+ player_nr += dx;
+ else
+ player_nr = Request("Choose player", REQ_PLAYER) - 1;
+
+ *(int *)si->value = MIN(MAX(0, player_nr), MAX_PLAYERS - 1);
+ }
drawSetupValue(screen_pos, setup_info_pos_raw);
// fullscreen state may have changed at this point
if (si->value == &setup.fullscreen)
ToggleFullscreenOrChangeWindowScalingIfNeeded();
+
+ if (si->value == &setup.network_mode &&
+ setup.network_mode &&
+ !network.enabled)
+ Request("Please restart game to enable network games!", REQ_CONFIRM);
}
static struct TokenInfo *getSetupInfoFinal(struct TokenInfo *setup_info_orig)