Add unfocus audio pause option

Some people prefer the 2.2 behavior where unfocusing pauses the game,
but the music still plays. One such person is Trinket9 on the VVVVVV
Discord server, who wanted it that way.

The reason audio pausing was added in the first place was to prevent
desyncing music in levels with cutscenes that synced to music. Rather
than reverting it, let's add this option instead.
This commit is contained in:
Misa
2021-08-05 12:20:05 -07:00
committed by Ethan Lee
parent b114be88d5
commit 3095871683
5 changed files with 39 additions and 4 deletions

View File

@@ -390,6 +390,7 @@ void Game::init(void)
slidermode = SLIDER_NONE;
disablepause = false;
disableaudiopause = false;
inputdelay = false;
}
@@ -4198,6 +4199,11 @@ void Game::deserializesettings(tinyxml2::XMLElement* dataNode, ScreenSettings* s
disablepause = help.Int(pText);
}
if (SDL_strcmp(pKey, "disableaudiopause") == 0)
{
disableaudiopause = help.Int(pText);
}
if (SDL_strcmp(pKey, "over30mode") == 0)
{
over30mode = help.Int(pText);
@@ -4469,6 +4475,8 @@ void Game::serializesettings(tinyxml2::XMLElement* dataNode, const ScreenSetting
xml::update_tag(dataNode, "disablepause", (int) disablepause);
xml::update_tag(dataNode, "disableaudiopause", (int) disableaudiopause);
xml::update_tag(dataNode, "notextoutline", (int) graphics.notextoutline);
xml::update_tag(dataNode, "translucentroomname", (int) graphics.translucentroomname);
@@ -6118,6 +6126,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
}
case Menu::advancedoptions:
option("unfocus pause");
option("unfocus audio pause");
option("room name background");
option("return");
menuyoff = 0;