1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-30 16:38:29 +02:00

Add Flip Mode to game options if in M&P or in-game menu and unlocked

Flip Mode will now be in the game options menu if either:
 (1) You're playing the M&P version.
 (2) You have it unlocked and you came here from the in-game pause
     screen.

This is because if you're playing M&P, you'd have to close the game,
edit unlock.vvv, and re-launch the game to toggle Flip Mode, since
there's no other way to do so. And if you're playing the full version,
you'd have to save and exit your session in order to toggle Flip Mode.
This commit is contained in:
Misa 2020-06-29 20:45:57 -07:00 committed by Ethan Lee
parent 7ce4f1173d
commit 2c18d28880
3 changed files with 113 additions and 30 deletions

View File

@ -7209,6 +7209,12 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
case Menu::options: case Menu::options:
option("accessibility options"); option("accessibility options");
option("glitchrunner mode"); option("glitchrunner mode");
#if !defined(MAKEANDPLAY)
if (ingame_titlemode && unlock[18])
#endif
{
option("flip mode");
}
#if !defined(MAKEANDPLAY) #if !defined(MAKEANDPLAY)
option("unlock play modes"); option("unlock play modes");
#endif #endif

View File

@ -572,11 +572,21 @@ void menuactionpress()
case Menu::options: case Menu::options:
{ {
#if defined(MAKEANDPLAY) #if defined(MAKEANDPLAY)
#define OFFSET -1 int flipmode_offset = 0;
#else #else
#define OFFSET 0 int flipmode_offset = game.ingame_titlemode && game.unlock[18] ? 0 : -1;
#endif #endif
#if defined(MAKEANDPLAY)
int unlockmode_offset = -1;
#else
int unlockmode_offset = 0;
#endif
int mmmmmm_offset = music.mmmmmm ? 0 : -1;
int offset = 0;
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -590,30 +600,58 @@ void menuactionpress()
music.playef(11); music.playef(11);
game.glitchrunnermode = !game.glitchrunnermode; game.glitchrunnermode = !game.glitchrunnermode;
break; break;
#if !defined(MAKEANDPLAY)
case 2: case 2:
#if !defined(MAKEANDPLAY)
if (game.ingame_titlemode && game.unlock[18])
#endif
{
// toggle Flip Mode
graphics.setflipmode = !graphics.setflipmode;
game.savemystats = true;
if (graphics.setflipmode)
{
music.playef(18);
game.screenshake = 10;
game.flashlight = 5;
}
else
{
music.playef(11);
}
}
break;
}
offset += flipmode_offset;
#if !defined(MAKEANDPLAY)
if (game.currentmenuoption == 3+offset)
{
//unlock play options //unlock play options
music.playef(11); music.playef(11);
game.createmenu(Menu::unlockmenu); game.createmenu(Menu::unlockmenu);
map.nexttowercolour(); map.nexttowercolour();
break; }
#endif #endif
case OFFSET+3:
offset += unlockmode_offset;
if (game.currentmenuoption == 4+offset)
{
//clear data menu //clear data menu
music.playef(11); music.playef(11);
game.createmenu(Menu::controller); game.createmenu(Menu::controller);
map.nexttowercolour(); map.nexttowercolour();
break; break;
case OFFSET+4: }
else if (game.currentmenuoption == 5+offset)
{
//clear data menu //clear data menu
music.playef(11); music.playef(11);
game.createmenu(Menu::cleardatamenu); game.createmenu(Menu::cleardatamenu);
map.nexttowercolour(); map.nexttowercolour();
break;
} }
else if (game.currentmenuoption == 6+offset && music.mmmmmm)
int mmmmmm_offset = music.mmmmmm ? 0 : -1;
if (game.currentmenuoption == OFFSET+5+mmmmmm_offset)
{ {
//**** TOGGLE MMMMMM //**** TOGGLE MMMMMM
if(game.usingmmmmmm > 0){ if(game.usingmmmmmm > 0){
@ -626,7 +664,10 @@ void menuactionpress()
music.play(music.currentsong); music.play(music.currentsong);
game.savestats(); game.savestats();
} }
else if (game.currentmenuoption == OFFSET+6+mmmmmm_offset)
offset += mmmmmm_offset;
if (game.currentmenuoption == 7+offset)
{ {
//back //back
music.playef(11); music.playef(11);
@ -640,7 +681,6 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
} }
} }
#undef OFFSET
break; break;
} }
case Menu::unlockmenutrials: case Menu::unlockmenutrials:
@ -1171,6 +1211,7 @@ void menuactionpress()
} }
else if (game.currentmenuoption == 3 && game.unlock[18]) //enable/disable flip mode else if (game.currentmenuoption == 3 && game.unlock[18]) //enable/disable flip mode
{ {
// WARNING: Partially duplicated in Menu::options
graphics.setflipmode = !graphics.setflipmode; graphics.setflipmode = !graphics.setflipmode;
game.savemystats = true; game.savemystats = true;
if (graphics.setflipmode) if (graphics.setflipmode)

View File

@ -75,12 +75,21 @@ void menurender()
graphics.Print( -1, 75, "no start point!", tr, tg, tb, true); graphics.Print( -1, 75, "no start point!", tr, tg, tb, true);
break; break;
case Menu::options: case Menu::options:
{
#if defined(MAKEANDPLAY) #if defined(MAKEANDPLAY)
#define OFFSET -1 int flipmode_offset = 0;
#else #else
#define OFFSET 0 int flipmode_offset = game.ingame_titlemode && game.unlock[18] ? 0 : -1;
#endif #endif
#if defined(MAKEANDPLAY)
int unlockmode_offset = -1;
#else
int unlockmode_offset = 0;
#endif
int offset = 0;
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -101,25 +110,52 @@ void menurender()
graphics.Print( -1, 95, "Glitchrunner mode is OFF", tr/2, tg/2, tb/2, true); graphics.Print( -1, 95, "Glitchrunner mode is OFF", tr/2, tg/2, tb/2, true);
} }
break; break;
#if !defined(MAKEANDPLAY)
case 2: case 2:
#if !defined(MAKEANDPLAY)
if (game.ingame_titlemode && game.unlock[18])
#endif
{
graphics.bigprint( -1, 30, "Flip Mode", tr, tg, tb, true);
graphics.Print( -1, 65, "Flip the entire game vertically.", tr, tg, tb, true);
if (graphics.setflipmode)
{
graphics.Print( -1, 85, "Currently ENABLED!", tr, tg, tb, true);
}
else
{
graphics.Print( -1, 85, "Currently Disabled.", tr/2, tg/2, tb/2, true);
}
}
break;
}
offset += flipmode_offset;
#if !defined(MAKEANDPLAY)
if (game.currentmenuoption == 3+offset)
{
graphics.bigprint( -1, 30, "Unlock Play Modes", tr, tg, tb, true); graphics.bigprint( -1, 30, "Unlock Play Modes", tr, tg, tb, true);
graphics.Print( -1, 65, "Unlock parts of the game normally", tr, tg, tb, true); graphics.Print( -1, 65, "Unlock parts of the game normally", tr, tg, tb, true);
graphics.Print( -1, 75, "unlocked as you progress", tr, tg, tb, true); graphics.Print( -1, 75, "unlocked as you progress", tr, tg, tb, true);
break; }
#endif #endif
case OFFSET+3:
offset += unlockmode_offset;
if (game.currentmenuoption == 4+offset)
{
graphics.bigprint( -1, 30, "Game Pad Options", tr, tg, tb, true); graphics.bigprint( -1, 30, "Game Pad Options", tr, tg, tb, true);
graphics.Print( -1, 65, "Rebind your controller's buttons", tr, tg, tb, true); graphics.Print( -1, 65, "Rebind your controller's buttons", tr, tg, tb, true);
graphics.Print( -1, 75, "and adjust sensitivity", tr, tg, tb, true); graphics.Print( -1, 75, "and adjust sensitivity", tr, tg, tb, true);
break; }
case OFFSET+4: else if (game.currentmenuoption == 5+offset)
{
graphics.bigprint( -1, 30, "Clear Data", tr, tg, tb, true); graphics.bigprint( -1, 30, "Clear Data", tr, tg, tb, true);
graphics.Print( -1, 65, "Delete your save data", tr, tg, tb, true); graphics.Print( -1, 65, "Delete your save data", tr, tg, tb, true);
graphics.Print( -1, 75, "and unlocked play modes", tr, tg, tb, true); graphics.Print( -1, 75, "and unlocked play modes", tr, tg, tb, true);
break; }
case OFFSET+5: else if (game.currentmenuoption == 6+offset && music.mmmmmm)
if(music.mmmmmm){ {
graphics.bigprint( -1, 30, "Soundtrack", tr, tg, tb, true); graphics.bigprint( -1, 30, "Soundtrack", tr, tg, tb, true);
graphics.Print( -1, 65, "Toggle between MMMMMM and PPPPPP", tr, tg, tb, true); graphics.Print( -1, 65, "Toggle between MMMMMM and PPPPPP", tr, tg, tb, true);
if(music.usingmmmmmm){ if(music.usingmmmmmm){
@ -127,11 +163,10 @@ void menurender()
}else{ }else{
graphics.Print( -1, 85, "Current soundtrack: PPPPPP", tr, tg, tb, true); graphics.Print( -1, 85, "Current soundtrack: PPPPPP", tr, tg, tb, true);
} }
break;
} }
break; break;
} }
#undef OFFSET
break;
case Menu::graphicoptions: case Menu::graphicoptions:
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -552,6 +587,7 @@ void menurender()
} }
break; break;
case 3: case 3:
// WARNING: Partially duplicated in Menu::options
graphics.bigprint( -1, 30, "Flip Mode", tr, tg, tb, true); graphics.bigprint( -1, 30, "Flip Mode", tr, tg, tb, true);
graphics.Print( -1, 65, "Flip the entire game vertically.", tr, tg, tb, true); graphics.Print( -1, 65, "Flip the entire game vertically.", tr, tg, tb, true);
graphics.Print( -1, 75, "Compatible with other game modes.", tr, tg, tb, true); graphics.Print( -1, 75, "Compatible with other game modes.", tr, tg, tb, true);