mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-11-13 22:49:42 +01:00
De-duplicate toggling flip mode in Input.cpp
Flip Mode toggling is now no longer copy-pasted.
This commit is contained in:
parent
8169a26f46
commit
be379733b6
1 changed files with 18 additions and 26 deletions
|
@ -173,6 +173,22 @@ static void updatebuttonmappings(int bind)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void toggleflipmode(void)
|
||||||
|
{
|
||||||
|
graphics.setflipmode = !graphics.setflipmode;
|
||||||
|
game.savestatsandsettings();
|
||||||
|
if (graphics.setflipmode)
|
||||||
|
{
|
||||||
|
music.playef(18);
|
||||||
|
game.screenshake = 10;
|
||||||
|
game.flashlight = 5;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
music.playef(11);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void menuactionpress(void)
|
static void menuactionpress(void)
|
||||||
{
|
{
|
||||||
switch (game.currentmenuname)
|
switch (game.currentmenuname)
|
||||||
|
@ -680,19 +696,7 @@ static void menuactionpress(void)
|
||||||
if (game.ingame_titlemode && game.unlock[18])
|
if (game.ingame_titlemode && game.unlock[18])
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
// toggle Flip Mode
|
toggleflipmode();
|
||||||
graphics.setflipmode = !graphics.setflipmode;
|
|
||||||
game.savestatsandsettings();
|
|
||||||
if (graphics.setflipmode)
|
|
||||||
{
|
|
||||||
music.playef(18);
|
|
||||||
game.screenshake = 10;
|
|
||||||
game.flashlight = 5;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
music.playef(11);
|
|
||||||
}
|
|
||||||
// Fix wrong area music in Tower (Positive Force vs. ecroF evitisoP)
|
// Fix wrong area music in Tower (Positive Force vs. ecroF evitisoP)
|
||||||
if (map.custommode)
|
if (map.custommode)
|
||||||
{
|
{
|
||||||
|
@ -1285,19 +1289,7 @@ static void menuactionpress(void)
|
||||||
}
|
}
|
||||||
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
|
toggleflipmode();
|
||||||
graphics.setflipmode = !graphics.setflipmode;
|
|
||||||
game.savestatsandsettings();
|
|
||||||
if (graphics.setflipmode)
|
|
||||||
{
|
|
||||||
music.playef(18);
|
|
||||||
game.screenshake = 10;
|
|
||||||
game.flashlight = 5;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
music.playef(11);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (game.currentmenuoption == 4)
|
else if (game.currentmenuoption == 4)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue