1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 04:02:59 +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. // we may have consumed our preloaded instance, so let's make another.
preloadSongSelect(); preloadSongSelect();
if (Beatmap.Value.Track != null && music?.IsUserPaused != true) if (music?.IsUserPaused == false)
Beatmap.Value.Track.Start(); music.Play();
} }
public override bool OnExiting(IScreen next) 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.Containers;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;
using osu.Game.Overlays;
using osu.Game.Overlays.SearchableList; using osu.Game.Overlays.SearchableList;
using osu.Game.Screens.Multi.Lounge.Components; using osu.Game.Screens.Multi.Lounge.Components;
using osu.Game.Screens.Multi.Match; using osu.Game.Screens.Multi.Match;
@ -31,6 +32,9 @@ namespace osu.Game.Screens.Multi.Lounge
[Resolved] [Resolved]
private Bindable<Room> selectedRoom { get; set; } private Bindable<Room> selectedRoom { get; set; }
[Resolved(canBeNull: true)]
private MusicController music { get; set; }
private bool joiningRoom; private bool joiningRoom;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
@ -122,6 +126,9 @@ namespace osu.Game.Screens.Multi.Lounge
if (selectedRoom.Value?.RoomID.Value == null) if (selectedRoom.Value?.RoomID.Value == null)
selectedRoom.Value = new Room(); selectedRoom.Value = new Room();
if (music?.IsUserPaused == false)
music.Play();
onReturning(); onReturning();
} }