From b53aeec90de21feca625932e2163d45ab379d757 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Thu, 4 Jul 2019 05:18:29 +0300 Subject: [PATCH] Move audio adjustment inside OnResuming --- osu.Game/Screens/Menu/Intro.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 2883559bbd..f6fbcf6498 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -35,13 +35,16 @@ public class Intro : StartupScreen private readonly BindableDouble exitingVolumeFade = new BindableDouble(1); + [Resolved] + private AudioManager audio { get; set; } + private Bindable menuVoice; private Bindable menuMusic; private Track track; private WorkingBeatmap introBeatmap; [BackgroundDependencyLoader] - private void load(AudioManager audio, OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game) + private void load(OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game) { menuVoice = config.GetBindable(OsuSetting.MenuVoice); menuMusic = config.GetBindable(OsuSetting.MenuMusic); @@ -74,8 +77,6 @@ private void load(AudioManager audio, OsuConfigManager config, BeatmapManager be welcome = audio.Samples.Get(@"welcome"); seeya = audio.Samples.Get(@"seeya"); - - audio.AddAdjustment(AdjustableProperty.Volume, exitingVolumeFade); } private const double delay_step_one = 2300; @@ -165,6 +166,7 @@ public override void OnResuming(IScreen last) else fadeOutTime = 500; + audio.AddAdjustment(AdjustableProperty.Volume, exitingVolumeFade); this.TransformBindableTo(exitingVolumeFade, 0, fadeOutTime).OnComplete(_ => this.Exit()); //don't want to fade out completely else we will stop running updates.