mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Stop preview playback when an overlay is popping out
This commit is contained in:
@ -2,14 +2,13 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Linq;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
@ -18,6 +17,8 @@ using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Overlays.Profile;
|
||||
using osu.Game.Overlays.Profile.Sections;
|
||||
using osu.Game.Users;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
@ -30,6 +31,7 @@ namespace osu.Game.Overlays
|
||||
protected ProfileHeader Header;
|
||||
private SectionsContainer<ProfileSection> sectionsContainer;
|
||||
private ProfileTabControl tabs;
|
||||
private PreviewTrackManager previewTrackManager;
|
||||
|
||||
public const float CONTENT_X_MARGIN = 50;
|
||||
|
||||
@ -56,9 +58,10 @@ namespace osu.Game.Overlays
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(APIAccess api)
|
||||
private void load(APIAccess api, PreviewTrackManager previewTrackManager)
|
||||
{
|
||||
this.api = api;
|
||||
this.previewTrackManager = previewTrackManager;
|
||||
}
|
||||
|
||||
protected override void PopIn()
|
||||
@ -70,6 +73,7 @@ namespace osu.Game.Overlays
|
||||
protected override void PopOut()
|
||||
{
|
||||
base.PopOut();
|
||||
previewTrackManager.CurrentTrack?.Stop();
|
||||
FadeEdgeEffectTo(0, WaveContainer.DISAPPEAR_DURATION, Easing.Out);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user