Skip to content

Commit

Permalink
Fix #1763: Title music does not stop when unchecked in options window (
Browse files Browse the repository at this point in the history
  • Loading branch information
niceeffort committed Jan 29, 2023
1 parent f653e2d commit 3f9ce05
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,7 @@
23.01+ (???)
------------------------------------------------------------------------
- Fix: [#1763] Title music does not stop when unchecked in options window.
- Fix: [#1772] Toggling edge scrolling option does not work.

23.01 (2023-01-25)
------------------------------------------------------------------------
Expand Down
12 changes: 10 additions & 2 deletions src/OpenLoco/src/Windows/Options.cpp
Expand Up @@ -858,13 +858,21 @@ namespace OpenLoco::Ui::Windows::Options
auto& cfg = Config::get();
cfg.audio.playTitleMusic = !cfg.audio.playTitleMusic;
Config::write();
w->invalidate();

if (!isTitleMode())
{
return;
}

if (cfg.audio.playTitleMusic)
{
Audio::playMusic(Environment::PathId::css5, Config::get().old.volume, true);
}

w->invalidate();
else
{
Audio::stopMusic();
}
}

// 0x004C04E0
Expand Down

0 comments on commit 3f9ce05

Please sign in to comment.