mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
* Singleplayer save-complete level select now following new system.
* More comprehensive "pick up where you left off" system. * Made individual map name selection actually take into account the map name AND the act number if the heading isn't the zone name.
This commit is contained in:
parent
7178ae5916
commit
2737d08107
1 changed files with 50 additions and 27 deletions
73
src/m_menu.c
73
src/m_menu.c
|
@ -645,9 +645,6 @@ 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
|
||||||
/* {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 60},
|
|
||||||
|
|
||||||
{IT_WHITESTRING|IT_CALL, NULL, "Start", M_LevelSelectWarp, 120},*/
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static menuitem_t SR_UnlockChecklistMenu[] =
|
static menuitem_t SR_UnlockChecklistMenu[] =
|
||||||
|
@ -692,9 +689,7 @@ static menuitem_t SP_LoadGameMenu[] =
|
||||||
// Single Player Level Select
|
// Single Player Level Select
|
||||||
static menuitem_t SP_LevelSelectMenu[] =
|
static menuitem_t SP_LevelSelectMenu[] =
|
||||||
{
|
{
|
||||||
{IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 60},
|
{IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleLevelPlatter, '\0'}, // dummy menuitem for the control func
|
||||||
|
|
||||||
{IT_WHITESTRING|IT_CALL, NULL, "Start", M_LevelSelectWarp, 120},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Single Player Time Attack
|
// Single Player Time Attack
|
||||||
|
@ -1433,12 +1428,12 @@ menu_t SR_MainDef =
|
||||||
};
|
};
|
||||||
menu_t SR_LevelSelectDef =
|
menu_t SR_LevelSelectDef =
|
||||||
{
|
{
|
||||||
0,
|
NULL,
|
||||||
sizeof (SR_LevelSelectMenu)/sizeof (menuitem_t),
|
sizeof (SR_LevelSelectMenu)/sizeof (menuitem_t),
|
||||||
&SR_MainDef,
|
&SR_MainDef,
|
||||||
SR_LevelSelectMenu,
|
SR_LevelSelectMenu,
|
||||||
M_DrawLevelPlatterMenu,
|
M_DrawLevelPlatterMenu,
|
||||||
40, 40,
|
0, 0,
|
||||||
0,
|
0,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
@ -1478,7 +1473,18 @@ menu_t SP_LoadDef =
|
||||||
0,
|
0,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
menu_t SP_LevelSelectDef = MAPICONMENUSTYLE(NULL, SP_LevelSelectMenu, &SP_LoadDef);
|
|
||||||
|
menu_t SP_LevelSelectDef =
|
||||||
|
{
|
||||||
|
NULL,
|
||||||
|
sizeof (SP_LevelSelectMenu)/sizeof (menuitem_t),
|
||||||
|
&SP_LoadDef,
|
||||||
|
SP_LevelSelectMenu,
|
||||||
|
M_DrawLevelPlatterMenu,
|
||||||
|
0, 0,
|
||||||
|
0,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
menu_t SP_GameStatsDef =
|
menu_t SP_GameStatsDef =
|
||||||
{
|
{
|
||||||
|
@ -3556,22 +3562,24 @@ static boolean M_CanShowLevelOnPlatter(INT32 mapnum, INT32 gt)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static INT32 M_CountLevelsToShowOnPlatter(INT32 gt)
|
#if 0
|
||||||
|
static INT32 M_CountLevelsToShowOnPlatter(INT32 gt)
|
||||||
{
|
{
|
||||||
INT32 mapnum, count = 0;
|
INT32 mapnum, count = 0;
|
||||||
|
|
||||||
for (mapnum = 0; mapnum < NUMMAPS; mapnum++)
|
for (mapnum = 0; mapnum < NUMMAPS; mapnum++)
|
||||||
if (M_CanShowLevelInPlatter(mapnum, gt))
|
if (M_CanShowLevelOnPlatter(mapnum, gt))
|
||||||
count++;
|
count++;
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}*/
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static INT32 M_CountRowsToShowOnPlatter(INT32 gt)
|
static INT32 M_CountRowsToShowOnPlatter(INT32 gt)
|
||||||
{
|
{
|
||||||
INT32 mapnum, prevmapnum, col = 0, rows = 0;
|
INT32 mapnum = 0, prevmapnum = 0, col = 0, rows = 0;
|
||||||
|
|
||||||
for (mapnum = 0; mapnum < NUMMAPS; mapnum++)
|
while (mapnum < NUMMAPS)
|
||||||
{
|
{
|
||||||
if (M_CanShowLevelOnPlatter(mapnum, gt))
|
if (M_CanShowLevelOnPlatter(mapnum, gt))
|
||||||
{
|
{
|
||||||
|
@ -3590,6 +3598,7 @@ static INT32 M_CountRowsToShowOnPlatter(INT32 gt)
|
||||||
}
|
}
|
||||||
prevmapnum = mapnum;
|
prevmapnum = mapnum;
|
||||||
}
|
}
|
||||||
|
mapnum++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rows;
|
return rows;
|
||||||
|
@ -3598,7 +3607,7 @@ static INT32 M_CountRowsToShowOnPlatter(INT32 gt)
|
||||||
static boolean M_PrepareLevelPlatter(INT32 gt)
|
static boolean M_PrepareLevelPlatter(INT32 gt)
|
||||||
{
|
{
|
||||||
INT32 numrows = M_CountRowsToShowOnPlatter(gt);
|
INT32 numrows = M_CountRowsToShowOnPlatter(gt);
|
||||||
INT32 mapnum, col = 0, row = 0;
|
INT32 mapnum, desiredmap, col = 0, row = 0;
|
||||||
|
|
||||||
if (!numrows)
|
if (!numrows)
|
||||||
return false;
|
return false;
|
||||||
|
@ -3615,6 +3624,8 @@ static boolean M_PrepareLevelPlatter(INT32 gt)
|
||||||
// done here so lsrow and lscol can be set if cv_nextmap is on the platter
|
// done here so lsrow and lscol can be set if cv_nextmap is on the platter
|
||||||
lsrow = lscol = lstic = lshli = lsoffs[0] = lsoffs[1] = 0;
|
lsrow = lscol = lstic = lshli = lsoffs[0] = lsoffs[1] = 0;
|
||||||
|
|
||||||
|
desiredmap = ((Playing()) ? gamemap: cv_nextmap.value);
|
||||||
|
|
||||||
for (mapnum = 0; mapnum < NUMMAPS; mapnum++)
|
for (mapnum = 0; mapnum < NUMMAPS; mapnum++)
|
||||||
{
|
{
|
||||||
if (M_CanShowLevelOnPlatter(mapnum, gt))
|
if (M_CanShowLevelOnPlatter(mapnum, gt))
|
||||||
|
@ -3638,21 +3649,32 @@ static boolean M_PrepareLevelPlatter(INT32 gt)
|
||||||
levelselect.rows[row].maplist[col] = mapnum+1; // putting the map on the platter
|
levelselect.rows[row].maplist[col] = mapnum+1; // putting the map on the platter
|
||||||
levelselect.rows[row].mapavailable[col] = M_LevelAvailableOnPlatter(mapnum);
|
levelselect.rows[row].mapavailable[col] = M_LevelAvailableOnPlatter(mapnum);
|
||||||
|
|
||||||
if (cv_nextmap.value == mapnum+1) // A little quality of life improvement.
|
if (desiredmap == mapnum+1) // A little quality of life improvement.
|
||||||
{
|
{
|
||||||
lsrow = row;
|
lsrow = row;
|
||||||
lscol = col;
|
lscol = col;
|
||||||
}
|
}
|
||||||
|
|
||||||
// individual map name
|
// individual map name
|
||||||
if (!levelselect.rows[row].mapavailable[col])
|
if (levelselect.rows[row].mapavailable[col])
|
||||||
sprintf(levelselect.rows[row].mapnames[col], "???");
|
{
|
||||||
else if (actnum)
|
if (headingisname)
|
||||||
|
{
|
||||||
|
if (actnum)
|
||||||
sprintf(levelselect.rows[row].mapnames[col], "ACT %d", actnum);
|
sprintf(levelselect.rows[row].mapnames[col], "ACT %d", actnum);
|
||||||
else if (headingisname)
|
else
|
||||||
sprintf(levelselect.rows[row].mapnames[col], "THE ACT", actnum);
|
sprintf(levelselect.rows[row].mapnames[col], "THE ACT");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (actnum)
|
||||||
|
sprintf(levelselect.rows[row].mapnames[col], "%s %d", mapheaderinfo[mapnum]->lvlttl, actnum);
|
||||||
else
|
else
|
||||||
sprintf(levelselect.rows[row].mapnames[col], "%s", mapheaderinfo[mapnum]->lvlttl);
|
sprintf(levelselect.rows[row].mapnames[col], "%s", mapheaderinfo[mapnum]->lvlttl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sprintf(levelselect.rows[row].mapnames[col], "???");
|
||||||
|
|
||||||
// creating header text
|
// creating header text
|
||||||
if (!col && (!row || !(fastcmp(mapheaderinfo[mapnum]->selectheading, mapheaderinfo[levelselect.rows[row-1].maplist[0]-1]->selectheading))))
|
if (!col && (!row || !(fastcmp(mapheaderinfo[mapnum]->selectheading, mapheaderinfo[levelselect.rows[row-1].maplist[0]-1]->selectheading))))
|
||||||
|
@ -4650,6 +4672,7 @@ static void M_CustomLevelSelect(INT32 choice)
|
||||||
SR_LevelSelectDef.prevMenu = currentMenu;
|
SR_LevelSelectDef.prevMenu = currentMenu;
|
||||||
levellistmode = LLM_LEVELSELECT;
|
levellistmode = LLM_LEVELSELECT;
|
||||||
maplistoption = (UINT8)(unlockables[ul].variable);
|
maplistoption = (UINT8)(unlockables[ul].variable);
|
||||||
|
|
||||||
if (!M_PrepareLevelPlatter(-1))
|
if (!M_PrepareLevelPlatter(-1))
|
||||||
{
|
{
|
||||||
M_StartMessage(M_GetText("No selectable levels found.\n"),NULL,MM_NOTHING);
|
M_StartMessage(M_GetText("No selectable levels found.\n"),NULL,MM_NOTHING);
|
||||||
|
@ -4677,17 +4700,17 @@ static void M_SinglePlayerMenu(INT32 choice)
|
||||||
static void M_LoadGameLevelSelect(INT32 choice)
|
static void M_LoadGameLevelSelect(INT32 choice)
|
||||||
{
|
{
|
||||||
(void)choice;
|
(void)choice;
|
||||||
|
|
||||||
|
SP_LevelSelectDef.prevMenu = currentMenu;
|
||||||
levellistmode = LLM_LEVELSELECT;
|
levellistmode = LLM_LEVELSELECT;
|
||||||
maplistoption = 1;
|
maplistoption = 1;
|
||||||
if (M_CountLevelsToShowInList() == 0)
|
|
||||||
|
if (!M_PrepareLevelPlatter(-1))
|
||||||
{
|
{
|
||||||
M_StartMessage(M_GetText("No selectable levels found.\n"),NULL,MM_NOTHING);
|
M_StartMessage(M_GetText("No selectable levels found.\n"),NULL,MM_NOTHING);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SP_LevelSelectDef.prevMenu = currentMenu;
|
|
||||||
|
|
||||||
M_PrepareLevelSelect();
|
|
||||||
M_SetupNextMenu(&SP_LevelSelectDef);
|
M_SetupNextMenu(&SP_LevelSelectDef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue