mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 19:22:54 +08:00
Removed no longer neccessary "exiting" flag
This commit is contained in:
parent
a8fb732256
commit
8471a579e0
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user