1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-07 18:07:28 +08:00

Merge pull request #5759 from Game4all/music-playback-improvements

Prevent beatmap change during intro playback

Co-authored-by: Dean Herbert <pe@ppy.sh>
This commit is contained in:
Dean Herbert 2019-08-21 14:15:02 +09:00 committed by GitHub
commit 5802ce74e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,11 +28,18 @@ namespace osu.Game.Screens.Menu
private Bindable<bool> menuVoice;
private LeasedBindable<WorkingBeatmap> beatmap;
public new Bindable<WorkingBeatmap> Beatmap => beatmap;
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBlack();
[BackgroundDependencyLoader]
private void load(OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game)
{
// prevent user from changing beatmap while the intro is still runnning.
beatmap = base.Beatmap.BeginLease(false);
menuVoice = config.GetBindable<bool>(OsuSetting.MenuVoice);
seeya = audio.Samples.Get(@"seeya");
}
@ -107,6 +114,8 @@ namespace osu.Game.Screens.Menu
protected void LoadMenu()
{
beatmap.Return();
DidLoadMenu = true;
this.Push(mainMenu);
}