mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Don't go to main menu when exiting to menu
This also replaces some createmenu()s with returnmenu()s as needed even when said createmenu()s already didn't go to the main menu. Now when you exit the level editor, you'll be selecting the "level editor" option in "play levels", and if you exit from a level you'll still be selecting that level in the levels list. Furthermore, regardless of what you're exiting, your cursor position will be remembered.
This commit is contained in:
parent
4d9c834a13
commit
e909515f3d
4 changed files with 24 additions and 6 deletions
|
@ -1338,7 +1338,13 @@ void Game::updatestate()
|
||||||
graphics.backgrounddrawn = false;
|
graphics.backgrounddrawn = false;
|
||||||
map.tdrawback = true;
|
map.tdrawback = true;
|
||||||
graphics.flipmode = false;
|
graphics.flipmode = false;
|
||||||
createmenu(Menu::mainmenu);
|
//Don't be stuck on the summary screen,
|
||||||
|
//or "who do you want to play the level with?"
|
||||||
|
//or "do you want cutscenes?"
|
||||||
|
if (!intimetrial)
|
||||||
|
{
|
||||||
|
returnmenu();
|
||||||
|
}
|
||||||
state = 0;
|
state = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2098,7 +2104,6 @@ void Game::updatestate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
createmenu(Menu::levellist);
|
|
||||||
state = 0;
|
state = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2993,6 +2998,7 @@ void Game::updatestate()
|
||||||
{
|
{
|
||||||
graphics.fademode = 2;
|
graphics.fademode = 2;
|
||||||
companion = 0;
|
companion = 0;
|
||||||
|
returnmenu();
|
||||||
state=3100;
|
state=3100;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3023,6 +3029,7 @@ void Game::updatestate()
|
||||||
state++;
|
state++;
|
||||||
graphics.fademode = 2;
|
graphics.fademode = 2;
|
||||||
music.fadeout();
|
music.fadeout();
|
||||||
|
returnmenu();
|
||||||
state=3100;
|
state=3100;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3053,7 +3060,6 @@ void Game::updatestate()
|
||||||
graphics.fademode = 4;
|
graphics.fademode = 4;
|
||||||
graphics.backgrounddrawn = true;
|
graphics.backgrounddrawn = true;
|
||||||
map.tdrawback = true;
|
map.tdrawback = true;
|
||||||
createmenu(Menu::play);
|
|
||||||
music.play(6);
|
music.play(6);
|
||||||
state = 0;
|
state = 0;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1191,6 +1191,15 @@ void menuactionpress()
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
//Ok but first quickly remove the last stack frame to prevent piling up timetrialcomplete stack frames
|
||||||
|
if (game.menustack.empty())
|
||||||
|
{
|
||||||
|
puts("Error: menu stack is empty!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
game.menustack.pop_back();
|
||||||
|
}
|
||||||
//duplicate the above based on given time trial level!
|
//duplicate the above based on given time trial level!
|
||||||
if (game.timetriallevel == 0) //space station 1
|
if (game.timetriallevel == 0) //space station 1
|
||||||
{
|
{
|
||||||
|
@ -1229,7 +1238,7 @@ void menuactionpress()
|
||||||
case Menu::nodeathmodecomplete2:
|
case Menu::nodeathmodecomplete2:
|
||||||
music.play(6);
|
music.play(6);
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::play);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -30,7 +30,7 @@ void titlelogic()
|
||||||
{
|
{
|
||||||
music.playef(3);
|
music.playef(3);
|
||||||
}
|
}
|
||||||
game.createmenu(game.menudest);
|
game.createmenu(game.menudest, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3455,7 +3455,10 @@ void editorlogic()
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
ed.settingsmod=false;
|
ed.settingsmod=false;
|
||||||
graphics.backgrounddrawn=false;
|
graphics.backgrounddrawn=false;
|
||||||
game.createmenu(Menu::mainmenu);
|
//Do returnmenu twice because we have two menus:
|
||||||
|
//the main editor menu and the confirm save&quit menu
|
||||||
|
game.returnmenu();
|
||||||
|
game.returnmenu();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue