Skip to content

Commit

Permalink
Fix GuiMenu.cpp
Browse files Browse the repository at this point in the history
Fix build error
  • Loading branch information
bluestang2006 committed Mar 26, 2022
1 parent 264fbbf commit 0df674a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions es-app/src/guis/GuiMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,12 @@ void GuiMenu::openSoundSettings()
auto music_enabled = std::make_shared<SwitchComponent>(mWindow);
music_enabled->setState(Settings::getInstance()->getBool("EnableMusic"));
s->addWithLabel("BACKGROUND MUSIC", music_enabled);
s->addSaveFunc([music_enabled]
{
if (Settings::getInstance()->setBool("EnableMusic", music_enabled->getState()))
{
if (music_enabled->getState())
AudioManager::getInstance()->playRandomMusic();
else
AudioManager::getInstance()->stopMusic();
}
s->addSaveFunc([music_enabled] {
Settings::getInstance()->setBool("EnableMusic", music_enabled->getState());
if (music_enabled->getState())
AudioManager::getInstance()->playRandomMusic();
else
AudioManager::getInstance()->stopMusic();
});

auto video_audio = std::make_shared<SwitchComponent>(mWindow);
Expand Down

0 comments on commit 0df674a

Please sign in to comment.