1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 16:52:54 +08:00

Removed no longer neccessary "exiting" flag

This commit is contained in:
aQaTL 2018-01-17 20:56:44 +01:00
parent a8fb732256
commit 8471a579e0
No known key found for this signature in database
GPG Key ID: 181719411A8555F0

View File

@ -79,8 +79,6 @@ namespace osu.Game
private SettingsOverlay settings;
private bool exiting;
public OsuGame(string[] args = null)
{
this.args = args;
@ -119,13 +117,6 @@ namespace osu.Game
Ruleset.ValueChanged += r => configRuleset.Value = r.ID ?? 0;
muteWhenInactive = LocalConfig.GetBindable<bool>(OsuSetting.MuteWhenInactive);
Host.Window.Exited += () =>
{
//Prevent not saving audio levels when user alt tabs before the window closes
if (volume.IsMuted)
volume.Unmute();
exiting = true;
};
}
private ScheduledDelegate scoreLoad;
@ -403,7 +394,7 @@ namespace osu.Game
protected override void OnDeactivated()
{
base.OnDeactivated();
if (muteWhenInactive && !exiting)
if (muteWhenInactive)
{
wasMuted = volume.IsMuted;
volume.Mute();
@ -413,7 +404,7 @@ namespace osu.Game
protected override void OnActivated()
{
base.OnActivated();
if (IsLoaded && muteWhenInactive && !wasMuted && !exiting)
if (IsLoaded && muteWhenInactive && !wasMuted)
{
volume.Unmute();
}