1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:47:26 +08:00

Ensure music starts when returning to lounge or main menu

This commit is contained in:
Dean Herbert 2020-07-10 16:33:45 +09:00
parent 49b88971d1
commit 44fdb5b82e
2 changed files with 9 additions and 2 deletions

View File

@ -260,8 +260,8 @@ namespace osu.Game.Screens.Menu
// we may have consumed our preloaded instance, so let's make another.
preloadSongSelect();
if (Beatmap.Value.Track != null && music?.IsUserPaused != true)
Beatmap.Value.Track.Start();
if (music?.IsUserPaused == false)
music.Play();
}
public override bool OnExiting(IScreen next)

View File

@ -11,6 +11,7 @@ using osu.Framework.Screens;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Multiplayer;
using osu.Game.Overlays;
using osu.Game.Overlays.SearchableList;
using osu.Game.Screens.Multi.Lounge.Components;
using osu.Game.Screens.Multi.Match;
@ -31,6 +32,9 @@ namespace osu.Game.Screens.Multi.Lounge
[Resolved]
private Bindable<Room> selectedRoom { get; set; }
[Resolved(canBeNull: true)]
private MusicController music { get; set; }
private bool joiningRoom;
[BackgroundDependencyLoader]
@ -122,6 +126,9 @@ namespace osu.Game.Screens.Multi.Lounge
if (selectedRoom.Value?.RoomID.Value == null)
selectedRoom.Value = new Room();
if (music?.IsUserPaused == false)
music.Play();
onReturning();
}