Add a "previous page" option to the credits menu

The credits aren't super-long, but it's still nice to have this menu
option.

If it's the first page, "previous page" will be "last page" instead.
This commit is contained in:
Misa
2020-04-16 23:37:49 -07:00
committed by Ethan Lee
parent 85b16b969a
commit 995dc3940a
2 changed files with 96 additions and 0 deletions

View File

@@ -701,6 +701,13 @@ void menuactionpress()
game.createmenu(Menu::credits2, true);
map.nexttowercolour();
break;
case 1:
//last page
music.playef(11);
game.createmenu(Menu::credits6, true);
game.currentmenuoption = 1;
map.nexttowercolour();
break;
default:
//back
music.playef(11);
@@ -719,6 +726,13 @@ void menuactionpress()
map.nexttowercolour();
break;
case 1:
//previous page
music.playef(11);
game.createmenu(Menu::credits, true);
game.currentmenuoption = 1;
map.nexttowercolour();
break;
case 2:
//back
music.playef(11);
game.returnmenu();
@@ -735,6 +749,13 @@ void menuactionpress()
game.createmenu(Menu::credits3, true);
map.nexttowercolour();
break;
case 1:
//previous page
music.playef(11);
game.createmenu(Menu::credits2, true);
game.currentmenuoption = 1;
map.nexttowercolour();
break;
default:
//back
music.playef(11);
@@ -763,6 +784,26 @@ void menuactionpress()
game.createmenu(Menu::credits3, true);
}
map.nexttowercolour();
break;
case 1:
//previous page
music.playef(11);
game.current_credits_list_index -= 9;
if (game.current_credits_list_index < 0)
{
//No more super patrons. Move to the previous credits section
game.current_credits_list_index = 0;
game.createmenu(Menu::credits25, true);
}
else
{
//There are more super patrons. Refresh the menu with the next ones
game.createmenu(Menu::credits3, true);
}
game.currentmenuoption = 1;
map.nexttowercolour();
break;
default:
@@ -794,6 +835,26 @@ void menuactionpress()
game.createmenu(Menu::credits4, true);
}
map.nexttowercolour();
break;
case 1:
//previous page
music.playef(11);
game.current_credits_list_index -= 14;
if (game.current_credits_list_index < 0)
{
//No more patrons. Move to the previous credits section
game.current_credits_list_index = game.superpatrons.size() - 1 - (game.superpatrons.size()-1)%9;
game.createmenu(Menu::credits3, true);
}
else
{
//There are more patrons. Refresh the menu with the next ones
game.createmenu(Menu::credits4, true);
}
game.currentmenuoption = 1;
map.nexttowercolour();
break;
default:
@@ -825,6 +886,26 @@ void menuactionpress()
game.createmenu(Menu::credits5, true);
}
map.nexttowercolour();
break;
case 1:
//previous page
music.playef(11);
game.current_credits_list_index -= 9;
if (game.current_credits_list_index < 0)
{
//No more GitHub contributors. Move to the previous credits section
game.current_credits_list_index = game.patrons.size() - 1 - (game.patrons.size()-1)%14;
game.createmenu(Menu::credits4, true);
}
else
{
//There are more GitHub contributors. Refresh the menu with the next ones
game.createmenu(Menu::credits5, true);
}
game.currentmenuoption = 1;
map.nexttowercolour();
break;
default:
@@ -845,6 +926,14 @@ void menuactionpress()
game.createmenu(Menu::credits, true);
map.nexttowercolour();
break;
case 1:
//previous page
music.playef(11);
game.current_credits_list_index = game.githubfriends.size() - 1 - (game.githubfriends.size()-1)%9;
game.createmenu(Menu::credits5, true);
game.currentmenuoption = 1;
map.nexttowercolour();
break;
default:
//back
music.playef(11);