1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 03:27:24 +08:00

Merge pull request #29101 from bdach/daily-challenge/fix-preview-track

Fix preview tracks not stopping playback when suspending/exiting daily challenge screen
This commit is contained in:
Dean Herbert 2024-07-26 21:52:26 +09:00 committed by GitHub
commit 47eca0eb37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,6 +17,7 @@ using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Logging;
using osu.Framework.Screens;
using osu.Game.Audio;
using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Game.Graphics.Containers;
@ -40,7 +41,8 @@ using osuTK;
namespace osu.Game.Screens.OnlinePlay.DailyChallenge
{
public partial class DailyChallenge : OsuScreen
[Cached(typeof(IPreviewTrackOwner))]
public partial class DailyChallenge : OsuScreen, IPreviewTrackOwner
{
private readonly Room room;
private readonly PlaylistItem playlistItem;
@ -92,6 +94,9 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge
[Resolved]
protected IAPIProvider API { get; private set; } = null!;
[Resolved]
private PreviewTrackManager previewTrackManager { get; set; } = null!;
public override bool DisallowExternalBeatmapRulesetChanges => true;
public override bool? ApplyModTrackAdjustments => true;
@ -452,6 +457,7 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge
userModsSelectOverlay.Hide();
cancelTrackLooping();
previewTrackManager.StopAnyPlaying(this);
}
public override bool OnExiting(ScreenExitEvent e)
@ -459,6 +465,7 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge
waves.Hide();
userModsSelectOverlay.Hide();
cancelTrackLooping();
previewTrackManager.StopAnyPlaying(this);
this.Delay(WaveContainer.DISAPPEAR_DURATION).FadeOut();
roomManager.PartRoom();