mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Add music and sound volume config options
This adds <musicvolume> and <soundvolume> tags to unlock.vvv and settings.vvv, so users' volume preferences will be persistent across game sessions. This does not add the user interface to change them from in-game; the next commit will do that.
This commit is contained in:
@@ -4222,6 +4222,16 @@ void Game::deserializesettings(tinyxml2::XMLElement* dataNode, ScreenSettings* s
|
||||
graphics.showmousecursor = help.Int(pText);
|
||||
}
|
||||
|
||||
if (SDL_strcmp(pKey, "musicvolume") == 0)
|
||||
{
|
||||
music.user_music_volume = help.Int(pText);
|
||||
}
|
||||
|
||||
if (SDL_strcmp(pKey, "soundvolume") == 0)
|
||||
{
|
||||
music.user_sound_volume = help.Int(pText);
|
||||
}
|
||||
|
||||
if (SDL_strcmp(pKey, "flipButton") == 0)
|
||||
{
|
||||
SDL_GameControllerButton newButton;
|
||||
@@ -4453,6 +4463,10 @@ void Game::serializesettings(tinyxml2::XMLElement* dataNode, const ScreenSetting
|
||||
|
||||
xml::update_tag(dataNode, "vsync", (int) screen_settings->useVsync);
|
||||
|
||||
xml::update_tag(dataNode, "musicvolume", music.user_music_volume);
|
||||
|
||||
xml::update_tag(dataNode, "soundvolume", music.user_sound_volume);
|
||||
|
||||
// Delete all controller buttons we had previously.
|
||||
// dataNode->FirstChildElement() shouldn't be NULL at this point...
|
||||
// we've already added a bunch of elements
|
||||
|
||||
Reference in New Issue
Block a user