Don't show next/previous page options if only one page

It's possible to get one page of levels by removing all the built-ins,
either by removing them directly from data.zip or by putting files with
the same filenames as them in your level folder that don't contain
nothing.

And hey, there's already a check for if no levels exist at all, so why
not check for this too?
This commit is contained in:
Misa
2021-08-11 19:48:40 -07:00
committed by Ethan Lee
parent 254cede905
commit 28e4a155d4
3 changed files with 24 additions and 17 deletions

View File

@@ -412,12 +412,14 @@ static void menuactionpress(void)
break;
#if !defined(NO_CUSTOM_LEVELS)
case Menu::levellist:
{
const bool nextlastoptions = ed.ListOfMetaData.size() > 8;
if(game.currentmenuoption==(int)game.menuoptions.size()-1){
//go back to menu
music.playef(11);
game.returnmenu();
map.nexttowercolour();
}else if(game.currentmenuoption==(int)game.menuoptions.size()-2){
}else if(nextlastoptions && game.currentmenuoption==(int)game.menuoptions.size()-2){
//previous page
music.playef(11);
if(game.levelpage==0){
@@ -428,7 +430,7 @@ static void menuactionpress(void)
game.createmenu(Menu::levellist, true);
game.currentmenuoption=game.menuoptions.size()-2;
map.nexttowercolour();
}else if(game.currentmenuoption==(int)game.menuoptions.size()-3){
}else if(nextlastoptions && game.currentmenuoption==(int)game.menuoptions.size()-3){
//next page
music.playef(11);
if((size_t) ((game.levelpage*8)+8) >= ed.ListOfMetaData.size()){
@@ -457,6 +459,7 @@ static void menuactionpress(void)
}
}
break;
}
#endif
case Menu::quickloadlevel:
switch (game.currentmenuoption)