From 3fcd786198a60b61cd6179f56294b0b12d209808 Mon Sep 17 00:00:00 2001 From: Lucas A Date: Sun, 18 Aug 2019 19:32:56 +0200 Subject: [PATCH 1/3] Take lease on WorkingBeatmap during intro screens to prevent weird interactions with Playback control. --- osu.Game/Screens/Menu/IntroScreen.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/osu.Game/Screens/Menu/IntroScreen.cs b/osu.Game/Screens/Menu/IntroScreen.cs index 27f3c9a45b..a621e29cf8 100644 --- a/osu.Game/Screens/Menu/IntroScreen.cs +++ b/osu.Game/Screens/Menu/IntroScreen.cs @@ -28,11 +28,18 @@ namespace osu.Game.Screens.Menu private Bindable menuVoice; + private LeasedBindable beatmap; + + public new Bindable Beatmap { get => beatmap; } + protected override BackgroundScreen CreateBackground() => new BackgroundScreenBlack(); [BackgroundDependencyLoader] private void load(OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game) { + //we take a lease on the beatmap bindable to prevent music playback from changing / pausing music during intros, as it is causing weird interactions with certains intros + beatmap = base.Beatmap.BeginLease(false); + menuVoice = config.GetBindable(OsuSetting.MenuVoice); seeya = audio.Samples.Get(@"seeya"); } @@ -108,6 +115,8 @@ namespace osu.Game.Screens.Menu protected void LoadMenu() { DidLoadMenu = true; + beatmap.Return(); //we return the lease to the beatmap bindable as we're pushing the main menu. + this.Push(mainMenu); } } From 33946f045812e67b22681cdedf408008807ac739 Mon Sep 17 00:00:00 2001 From: Lucas A Date: Tue, 20 Aug 2019 11:18:41 +0200 Subject: [PATCH 2/3] Fix CI issues and update comments. --- osu.Game/Screens/Menu/IntroScreen.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroScreen.cs b/osu.Game/Screens/Menu/IntroScreen.cs index a621e29cf8..6a98c78d5f 100644 --- a/osu.Game/Screens/Menu/IntroScreen.cs +++ b/osu.Game/Screens/Menu/IntroScreen.cs @@ -30,14 +30,14 @@ namespace osu.Game.Screens.Menu private LeasedBindable beatmap; - public new Bindable Beatmap { get => beatmap; } + public new Bindable Beatmap => beatmap; protected override BackgroundScreen CreateBackground() => new BackgroundScreenBlack(); [BackgroundDependencyLoader] private void load(OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game) { - //we take a lease on the beatmap bindable to prevent music playback from changing / pausing music during intros, as it is causing weird interactions with certains intros + // we take a lease on the beatmap bindable to prevent music playback from changing / pausing during intros, as it is causing weird interactions with certains intros. beatmap = base.Beatmap.BeginLease(false); menuVoice = config.GetBindable(OsuSetting.MenuVoice); @@ -115,7 +115,7 @@ namespace osu.Game.Screens.Menu protected void LoadMenu() { DidLoadMenu = true; - beatmap.Return(); //we return the lease to the beatmap bindable as we're pushing the main menu. + beatmap.Return(); this.Push(mainMenu); } From 724365c6d12e4b1f24824dfc7a20448839066f32 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 21 Aug 2019 14:01:07 +0900 Subject: [PATCH 3/3] Minor tidying --- osu.Game/Screens/Menu/IntroScreen.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroScreen.cs b/osu.Game/Screens/Menu/IntroScreen.cs index 6a98c78d5f..4d0f7ff87a 100644 --- a/osu.Game/Screens/Menu/IntroScreen.cs +++ b/osu.Game/Screens/Menu/IntroScreen.cs @@ -37,7 +37,7 @@ namespace osu.Game.Screens.Menu [BackgroundDependencyLoader] private void load(OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game) { - // we take a lease on the beatmap bindable to prevent music playback from changing / pausing during intros, as it is causing weird interactions with certains intros. + // prevent user from changing beatmap while the intro is still runnning. beatmap = base.Beatmap.BeginLease(false); menuVoice = config.GetBindable(OsuSetting.MenuVoice); @@ -114,9 +114,9 @@ namespace osu.Game.Screens.Menu protected void LoadMenu() { - DidLoadMenu = true; beatmap.Return(); + DidLoadMenu = true; this.Push(mainMenu); } }