Getting closer to done.

Updated the mid-game gametype/level select menu! Just need to combine it with the server creation menu, and then I'll be ready to make a merge request...
This commit is contained in:
toasterbabe 2017-01-31 18:48:50 +00:00
parent b5fef5f46a
commit 3cb2f178c6
2 changed files with 80 additions and 19 deletions

View file

@ -313,7 +313,7 @@ enum GameType
NUMGAMETYPES NUMGAMETYPES
}; };
// If you alter this list, update gametype_cons_t in m_menu.c // If you alter this list, update dehacked.c, and gametype_cons_t and MISC_ChangeGameTypeMenu in m_menu.c
extern tic_t totalplaytime; extern tic_t totalplaytime;

View file

@ -242,6 +242,7 @@ static void M_Options(INT32 choice);
static void M_SelectableClearMenus(INT32 choice); static void M_SelectableClearMenus(INT32 choice);
static void M_Retry(INT32 choice); static void M_Retry(INT32 choice);
static void M_EndGame(INT32 choice); static void M_EndGame(INT32 choice);
static void M_GameTypeChange(INT32 choice);
static void M_MapChange(INT32 choice); static void M_MapChange(INT32 choice);
static void M_ChangeLevel(INT32 choice); static void M_ChangeLevel(INT32 choice);
static void M_ConfirmSpectate(INT32 choice); static void M_ConfirmSpectate(INT32 choice);
@ -328,6 +329,7 @@ static void M_DrawSkyRoom(void);
static void M_DrawChecklist(void); static void M_DrawChecklist(void);
static void M_DrawEmblemHints(void); static void M_DrawEmblemHints(void);
static void M_DrawPauseMenu(void); static void M_DrawPauseMenu(void);
static void M_DrawGameTypeMenu(void);
static void M_DrawServerMenu(void); static void M_DrawServerMenu(void);
static void M_DrawLevelPlatterMenu(void); static void M_DrawLevelPlatterMenu(void);
static void M_DrawImageDef(void); static void M_DrawImageDef(void);
@ -392,7 +394,7 @@ static CV_PossibleValue_t skins_cons_t[MAXSKINS+1] = {{1, DEFAULTSKIN}};
consvar_t cv_chooseskin = {"chooseskin", DEFAULTSKIN, CV_HIDEN|CV_CALL, skins_cons_t, Nextmap_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_chooseskin = {"chooseskin", DEFAULTSKIN, CV_HIDEN|CV_CALL, skins_cons_t, Nextmap_OnChange, 0, NULL, NULL, 0, 0, NULL};
// This gametype list is integral for many different reasons. // This gametype list is integral for many different reasons.
// When you add gametypes here, don't forget to update them in CV_AddValue! // When you add gametypes here, don't forget to update them in dehacked.c and doomstat.h!
CV_PossibleValue_t gametype_cons_t[] = CV_PossibleValue_t gametype_cons_t[] =
{ {
{GT_COOP, "Co-op"}, {GT_COOP, "Co-op"},
@ -505,7 +507,7 @@ typedef enum
static menuitem_t MPauseMenu[] = static menuitem_t MPauseMenu[] =
{ {
{IT_STRING | IT_SUBMENU, NULL, "Scramble Teams...", &MISC_ScrambleTeamDef, 16}, {IT_STRING | IT_SUBMENU, NULL, "Scramble Teams...", &MISC_ScrambleTeamDef, 16},
{IT_STRING | IT_CALL, NULL, "Switch Map..." , M_MapChange, 24}, {IT_STRING | IT_CALL, NULL, "Switch Map..." , M_GameTypeChange, 24},
{IT_CALL | IT_STRING, NULL, "Continue", M_SelectableClearMenus,40}, {IT_CALL | IT_STRING, NULL, "Continue", M_SelectableClearMenus,40},
{IT_CALL | IT_STRING, NULL, "Player 1 Setup", M_SetupMultiPlayer, 48}, // splitscreen {IT_CALL | IT_STRING, NULL, "Player 1 Setup", M_SetupMultiPlayer, 48}, // splitscreen
@ -586,11 +588,25 @@ static menuitem_t MISC_ChangeTeamMenu[] =
{IT_WHITESTRING|IT_CALL, NULL, "Confirm", M_ConfirmTeamChange, 90}, {IT_WHITESTRING|IT_CALL, NULL, "Confirm", M_ConfirmTeamChange, 90},
}; };
static menuitem_t MISC_ChangeGameTypeMenu[] =
{
{IT_STRING|IT_CALL, NULL, "Co-op", M_MapChange, 0},
{IT_STRING|IT_CALL, NULL, "Competition", M_MapChange, 12},
{IT_STRING|IT_CALL, NULL, "Race", M_MapChange, 20},
{IT_STRING|IT_CALL, NULL, "Match", M_MapChange, 32},
{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, "Capture the Flag", M_MapChange, 72},
};
static menuitem_t MISC_ChangeLevelMenu[] = static menuitem_t MISC_ChangeLevelMenu[] =
{ {
{IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 30}, {IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleLevelPlatter, 0}, // dummy menuitem for the control func
{IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 60},
{IT_WHITESTRING|IT_CALL, NULL, "Change Level", M_ChangeLevel, 120},
}; };
static menuitem_t MISC_HelpMenu[] = static menuitem_t MISC_HelpMenu[] =
@ -664,7 +680,7 @@ static menuitem_t SR_MainMenu[] =
static menuitem_t SR_LevelSelectMenu[] = static menuitem_t SR_LevelSelectMenu[] =
{ {
{IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleLevelPlatter, '\0'}, // dummy menuitem for the control func {IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleLevelPlatter, 0}, // dummy menuitem for the control func
}; };
static menuitem_t SR_UnlockChecklistMenu[] = static menuitem_t SR_UnlockChecklistMenu[] =
@ -703,19 +719,19 @@ enum
// Single Player Load Game // Single Player Load Game
static menuitem_t SP_LoadGameMenu[] = static menuitem_t SP_LoadGameMenu[] =
{ {
{IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleLoadSave, '\0'}, // dummy menuitem for the control func {IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleLoadSave, 0}, // dummy menuitem for the control func
}; };
// Single Player Level Select // Single Player Level Select
static menuitem_t SP_LevelSelectMenu[] = static menuitem_t SP_LevelSelectMenu[] =
{ {
{IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleLevelPlatter, '\0'}, // dummy menuitem for the control func {IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleLevelPlatter, 0}, // dummy menuitem for the control func
}; };
// Single Player Time Attack Level Select // Single Player Time Attack Level Select
static menuitem_t SP_TimeAttackLevelSelectMenu[] = static menuitem_t SP_TimeAttackLevelSelectMenu[] =
{ {
{IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleLevelPlatter, '\0'}, // dummy menuitem for the control func {IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleLevelPlatter, 0}, // dummy menuitem for the control func
}; };
// Single Player Time Attack // Single Player Time Attack
@ -813,7 +829,7 @@ static menuitem_t SP_NightsGhostMenu[] =
// Single Player Nights Attack Level Select // Single Player Nights Attack Level Select
static menuitem_t SP_NightsAttackLevelSelectMenu[] = static menuitem_t SP_NightsAttackLevelSelectMenu[] =
{ {
{IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleLevelPlatter, '\0'}, // dummy menuitem for the control func {IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleLevelPlatter, 0}, // dummy menuitem for the control func
}; };
// Single Player Nights Attack // Single Player Nights Attack
@ -842,12 +858,12 @@ enum
// Statistics // Statistics
static menuitem_t SP_GameStatsMenu[] = static menuitem_t SP_GameStatsMenu[] =
{ {
{IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleGameStats, '\0'}, // dummy menuitem for the control func {IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleGameStats, 0}, // dummy menuitem for the control func
}; };
static menuitem_t SP_LevelStatsMenu[] = static menuitem_t SP_LevelStatsMenu[] =
{ {
{IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleLevelStats, '\0'}, // dummy menuitem for the control func {IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleLevelStats, 0}, // dummy menuitem for the control func
}; };
// A rare case. // A rare case.
@ -1199,7 +1215,7 @@ static menuitem_t OP_VideoOptionsMenu[] =
static menuitem_t OP_VideoModeMenu[] = static menuitem_t OP_VideoModeMenu[] =
{ {
{IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleVideoMode, '\0'}, // dummy menuitem for the control func {IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleVideoMode, 0}, // dummy menuitem for the control func
}; };
#ifdef HWRENDER #ifdef HWRENDER
@ -1432,7 +1448,31 @@ menu_t MPauseDef = PAUSEMENUSTYLE(MPauseMenu, 40, 72);
// Misc Main Menu // Misc Main Menu
menu_t MISC_ScrambleTeamDef = DEFAULTMENUSTYLE(NULL, MISC_ScrambleTeamMenu, &MPauseDef, 27, 40); menu_t MISC_ScrambleTeamDef = DEFAULTMENUSTYLE(NULL, MISC_ScrambleTeamMenu, &MPauseDef, 27, 40);
menu_t MISC_ChangeTeamDef = DEFAULTMENUSTYLE(NULL, MISC_ChangeTeamMenu, &MPauseDef, 27, 40); menu_t MISC_ChangeTeamDef = DEFAULTMENUSTYLE(NULL, MISC_ChangeTeamMenu, &MPauseDef, 27, 40);
menu_t MISC_ChangeLevelDef = MAPICONMENUSTYLE(NULL, MISC_ChangeLevelMenu, &MPauseDef);
// MP Gametype and map change menu
menu_t MISC_ChangeGameTypeDef =
{
NULL,
sizeof (MISC_ChangeGameTypeMenu)/sizeof (menuitem_t),
&MainDef, // Doesn't matter.
MISC_ChangeGameTypeMenu,
M_DrawGameTypeMenu,
30, 104 - ((80 - lsheadingheight/2)/2), // vertically centering
0,
NULL
};
menu_t MISC_ChangeLevelDef =
{
NULL,
sizeof (MISC_ChangeLevelMenu)/sizeof (menuitem_t),
&MISC_ChangeGameTypeDef,
MISC_ChangeLevelMenu,
M_DrawLevelPlatterMenu,
0, 0,
0,
NULL
};
menu_t MISC_HelpDef = IMAGEDEF(MISC_HelpMenu); menu_t MISC_HelpDef = IMAGEDEF(MISC_HelpMenu);
// Sky Room // Sky Room
@ -3885,6 +3925,8 @@ static void M_HandleLevelPlatter(INT32 choice)
else else
M_NightsAttack(-1); M_NightsAttack(-1);
} }
else if (currentMenu == &MISC_ChangeLevelDef)
M_ChangeLevel(0);
else else
M_LevelSelectWarp(0); M_LevelSelectWarp(0);
} }
@ -6845,16 +6887,35 @@ static void M_DrawServerMenu(void)
V_DrawSmallScaledPatch((BASEVIDWIDTH*3/4)-(SHORT(PictureOfLevel->width)/4), ((BASEVIDHEIGHT*3/4)-(SHORT(PictureOfLevel->height)/4)+10), 0, PictureOfLevel); V_DrawSmallScaledPatch((BASEVIDWIDTH*3/4)-(SHORT(PictureOfLevel->width)/4), ((BASEVIDHEIGHT*3/4)-(SHORT(PictureOfLevel->height)/4)+10), 0, PictureOfLevel);
} }
static void M_MapChange(INT32 choice) static void M_GameTypeChange(INT32 choice)
{ {
(void)choice; (void)choice;
MISC_ChangeGameTypeDef.prevMenu = currentMenu;
M_SetupNextMenu(&MISC_ChangeGameTypeDef);
itemOn = gametype;
}
// Drawing function for Nights Attack
void M_DrawGameTypeMenu(void)
{
M_DrawGenericMenu();
M_DrawLevelPlatterHeader(currentMenu->y - lsheadingheight, "SELECT GAMETYPE", true);
}
static void M_MapChange(INT32 choice)
{
MISC_ChangeLevelDef.prevMenu = currentMenu;
levellistmode = LLM_CREATESERVER; levellistmode = LLM_CREATESERVER;
CV_SetValue(&cv_newgametype, gametype); CV_SetValue(&cv_newgametype, choice);
CV_SetValue(&cv_nextmap, gamemap);
if (!M_PrepareLevelPlatter(choice))
{
M_StartMessage(M_GetText("No selectable levels found.\n"),NULL,MM_NOTHING);
return;
}
M_PrepareLevelSelect();
M_SetupNextMenu(&MISC_ChangeLevelDef); M_SetupNextMenu(&MISC_ChangeLevelDef);
} }