mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-18 02:21:47 +00:00
Server page (and splitscreen server page) started.
http://i.imgur.com/jJ3YZUd.png Will be discussing what to do with the space freed under "server options" the heading on IRC tomorrow. (MI, if you're looking - the mistake was that I set up an IT_CALL menu line as IT_CVAR by mistake, which of course caused a crash when trying to get ((consvar_t *)M_GameTypeChange)->string. ;P )
This commit is contained in:
parent
3cb2f178c6
commit
873e768a44
1 changed files with 88 additions and 51 deletions
97
src/m_menu.c
97
src/m_menu.c
|
@ -406,7 +406,7 @@ CV_PossibleValue_t gametype_cons_t[] =
|
|||
{GT_TEAMMATCH, "Team Match"},
|
||||
|
||||
{GT_TAG, "Tag"},
|
||||
{GT_HIDEANDSEEK, "Hide and Seek"},
|
||||
{GT_HIDEANDSEEK, "Hide & Seek"},
|
||||
|
||||
{GT_CTF, "CTF"},
|
||||
{0, NULL}
|
||||
|
@ -507,7 +507,7 @@ typedef enum
|
|||
static menuitem_t MPauseMenu[] =
|
||||
{
|
||||
{IT_STRING | IT_SUBMENU, NULL, "Scramble Teams...", &MISC_ScrambleTeamDef, 16},
|
||||
{IT_STRING | IT_CALL, NULL, "Switch Map..." , M_GameTypeChange, 24},
|
||||
{IT_STRING | IT_CALL, NULL, "Switch Gametype/Level...", M_GameTypeChange, 24},
|
||||
|
||||
{IT_CALL | IT_STRING, NULL, "Continue", M_SelectableClearMenus,40},
|
||||
{IT_CALL | IT_STRING, NULL, "Player 1 Setup", M_SetupMultiPlayer, 48}, // splitscreen
|
||||
|
@ -599,7 +599,7 @@ static menuitem_t MISC_ChangeGameTypeMenu[] =
|
|||
{IT_STRING|IT_CALL, NULL, "Team Match", M_MapChange, 40},
|
||||
|
||||
{IT_STRING|IT_CALL, NULL, "Tag", M_MapChange, 52},
|
||||
{IT_STRING|IT_CALL, NULL, "Hide and Seek", M_MapChange, 60},
|
||||
{IT_STRING|IT_CALL, NULL, "Hide & Seek", M_MapChange, 60},
|
||||
|
||||
{IT_STRING|IT_CALL, NULL, "Capture the Flag", M_MapChange, 72},
|
||||
};
|
||||
|
@ -924,28 +924,33 @@ static menuitem_t MP_MainMenu[] =
|
|||
|
||||
static menuitem_t MP_ServerMenu[] =
|
||||
{
|
||||
{IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 10},
|
||||
{IT_DISABLED|IT_NOTHING, NULL, "", NULL, 0},
|
||||
#ifndef NONET
|
||||
{IT_STRING|IT_CALL, NULL, "Room...", M_RoomMenu, 20},
|
||||
{IT_STRING|IT_CVAR|IT_CV_STRING, NULL, "Server Name", &cv_servername, 30},
|
||||
{IT_STRING|IT_CALL, NULL, "Room...", M_RoomMenu, 10},
|
||||
{IT_STRING|IT_CVAR|IT_CV_STRING, NULL, "Server Name", &cv_servername, 20},
|
||||
#endif
|
||||
|
||||
{IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 80},
|
||||
|
||||
{IT_STRING|IT_CALL, NULL, "Select Gametype/Level", M_GameTypeChange, 90},
|
||||
{IT_WHITESTRING|IT_CALL, NULL, "Start", M_StartServer, 130},
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
mp_server_gametype = 0,
|
||||
mp_server_dummy = 0, // exists solely so numbering is consistent between NONET and not NONET
|
||||
#ifndef NONET
|
||||
mp_server_room,
|
||||
mp_server_name,
|
||||
#endif
|
||||
mp_server_level,
|
||||
mp_server_levelgt,
|
||||
mp_server_start
|
||||
};
|
||||
|
||||
// Separated splitscreen and normal servers.
|
||||
static menuitem_t MP_SplitServerMenu[] =
|
||||
{
|
||||
{IT_STRING|IT_CALL, NULL, "Select Gametype/Level", M_GameTypeChange, 90},
|
||||
{IT_WHITESTRING|IT_CALL, NULL, "Start", M_StartServer, 130},
|
||||
};
|
||||
|
||||
#ifndef NONET
|
||||
static menuitem_t MP_ConnectMenu[] =
|
||||
{
|
||||
|
@ -1004,14 +1009,6 @@ static menuitem_t MP_ConnectIPMenu[] =
|
|||
};
|
||||
#endif
|
||||
|
||||
// Separated splitscreen and normal servers.
|
||||
static menuitem_t MP_SplitServerMenu[] =
|
||||
{
|
||||
{IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 10},
|
||||
{IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 80},
|
||||
{IT_WHITESTRING|IT_CALL, NULL, "Start", M_StartServer, 130},
|
||||
};
|
||||
|
||||
static menuitem_t MP_PlayerSetupMenu[] =
|
||||
{
|
||||
{IT_KEYHANDLER | IT_STRING, NULL, "Your name", M_HandleSetupMultiPlayer, 0},
|
||||
|
@ -1708,7 +1705,31 @@ menu_t SP_PlayerDef =
|
|||
|
||||
// Multiplayer
|
||||
menu_t MP_MainDef = DEFAULTMENUSTYLE("M_MULTI", MP_MainMenu, &MainDef, 60, 40);
|
||||
menu_t MP_ServerDef = MAPICONMENUSTYLE("M_MULTI", MP_ServerMenu, &MP_MainDef);
|
||||
|
||||
menu_t MP_ServerDef =
|
||||
{
|
||||
"M_MULTI",
|
||||
sizeof (MP_ServerMenu)/sizeof (menuitem_t),
|
||||
&MP_MainDef,
|
||||
MP_ServerMenu,
|
||||
M_DrawServerMenu,
|
||||
27, 40,
|
||||
0,
|
||||
NULL
|
||||
};
|
||||
|
||||
menu_t MP_SplitServerDef =
|
||||
{
|
||||
"M_MULTI",
|
||||
sizeof (MP_SplitServerMenu)/sizeof (menuitem_t),
|
||||
&MP_MainDef,
|
||||
MP_SplitServerMenu,
|
||||
M_DrawServerMenu,
|
||||
27, 40,
|
||||
0,
|
||||
NULL
|
||||
};
|
||||
|
||||
#ifndef NONET
|
||||
menu_t MP_ConnectDef =
|
||||
{
|
||||
|
@ -1744,7 +1765,7 @@ menu_t MP_RoomDef =
|
|||
NULL
|
||||
};
|
||||
#endif
|
||||
menu_t MP_SplitServerDef = MAPICONMENUSTYLE("M_MULTI", MP_SplitServerMenu, &MP_MainDef);
|
||||
|
||||
menu_t MP_PlayerSetupDef =
|
||||
{
|
||||
"M_SPLAYR",
|
||||
|
@ -3926,7 +3947,12 @@ static void M_HandleLevelPlatter(INT32 choice)
|
|||
M_NightsAttack(-1);
|
||||
}
|
||||
else if (currentMenu == &MISC_ChangeLevelDef)
|
||||
{
|
||||
if (currentMenu->prevMenu && currentMenu->prevMenu->prevMenu != &MPauseDef)
|
||||
M_SetupNextMenu(currentMenu->prevMenu->prevMenu);
|
||||
else
|
||||
M_ChangeLevel(0);
|
||||
}
|
||||
else
|
||||
M_LevelSelectWarp(0);
|
||||
}
|
||||
|
@ -6858,11 +6884,10 @@ static void M_StartServer(INT32 choice)
|
|||
|
||||
static void M_DrawServerMenu(void)
|
||||
{
|
||||
lumpnum_t lumpnum;
|
||||
patch_t *PictureOfLevel;
|
||||
|
||||
M_DrawGenericMenu();
|
||||
|
||||
M_DrawLevelPlatterHeader(currentMenu->y - lsheadingheight/2, "Server settings", true);
|
||||
|
||||
#ifndef NONET
|
||||
// Room name
|
||||
if (currentMenu == &MP_ServerDef)
|
||||
|
@ -6876,6 +6901,16 @@ static void M_DrawServerMenu(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (cv_nextmap.value)
|
||||
{
|
||||
patch_t *PictureOfLevel;
|
||||
lumpnum_t lumpnum;
|
||||
char headerstr[40];
|
||||
|
||||
sprintf(headerstr, "%s - %s", cv_newgametype.string, cv_nextmap.string);
|
||||
|
||||
M_DrawLevelPlatterHeader(currentMenu->y + 80 - lsheadingheight/2, (const char *)headerstr, true);
|
||||
|
||||
// A 160x100 image of the level as entry MAPxxP
|
||||
lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(cv_nextmap.value)));
|
||||
|
||||
|
@ -6884,7 +6919,8 @@ static void M_DrawServerMenu(void)
|
|||
else
|
||||
PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE);
|
||||
|
||||
V_DrawSmallScaledPatch((BASEVIDWIDTH*3/4)-(SHORT(PictureOfLevel->width)/4), ((BASEVIDHEIGHT*3/4)-(SHORT(PictureOfLevel->height)/4)+10), 0, PictureOfLevel);
|
||||
V_DrawSmallScaledPatch(319 - (currentMenu->x + (SHORT(PictureOfLevel->width)/2)), currentMenu->y + 90, 0, PictureOfLevel);
|
||||
}
|
||||
}
|
||||
|
||||
static void M_GameTypeChange(INT32 choice)
|
||||
|
@ -6893,14 +6929,14 @@ static void M_GameTypeChange(INT32 choice)
|
|||
|
||||
MISC_ChangeGameTypeDef.prevMenu = currentMenu;
|
||||
M_SetupNextMenu(&MISC_ChangeGameTypeDef);
|
||||
if (Playing())
|
||||
itemOn = gametype;
|
||||
}
|
||||
|
||||
// Drawing function for Nights Attack
|
||||
void M_DrawGameTypeMenu(void)
|
||||
{
|
||||
M_DrawGenericMenu();
|
||||
M_DrawLevelPlatterHeader(currentMenu->y - lsheadingheight, "SELECT GAMETYPE", true);
|
||||
M_DrawLevelPlatterHeader(currentMenu->y - lsheadingheight, "Select Gametype", true);
|
||||
}
|
||||
|
||||
static void M_MapChange(INT32 choice)
|
||||
|
@ -6923,7 +6959,7 @@ static void M_StartSplitServerMenu(INT32 choice)
|
|||
{
|
||||
(void)choice;
|
||||
levellistmode = LLM_CREATESERVER;
|
||||
M_PrepareLevelSelect();
|
||||
Newgametype_OnChange();
|
||||
M_SetupNextMenu(&MP_SplitServerDef);
|
||||
}
|
||||
|
||||
|
@ -6931,10 +6967,11 @@ static void M_StartSplitServerMenu(INT32 choice)
|
|||
static void M_StartServerMenu(INT32 choice)
|
||||
{
|
||||
(void)choice;
|
||||
levellistmode = LLM_CREATESERVER;
|
||||
M_PrepareLevelSelect();
|
||||
ms_RoomId = -1;
|
||||
levellistmode = LLM_CREATESERVER;
|
||||
Newgametype_OnChange();
|
||||
M_SetupNextMenu(&MP_ServerDef);
|
||||
itemOn = 1;
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue