Fix various screens not registering themselves as IPreviewTrackOwner

This commit is contained in:
Dan Balasescu
2025-11-17 13:33:59 +09:00
parent 45e8df7af2
commit ce5e54c9d2
5 changed files with 9 additions and 6 deletions

View File

@@ -220,10 +220,13 @@ namespace osu.Game.Tests.Visual.Components
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
{
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
if (registerAsOwner)
dependencies.CacheAs<IPreviewTrackOwner>(this);
return dependencies;
{
// Automatically handled by interface caching.
return base.CreateChildDependencies(parent);
}
return new DependencyContainer();
}
}

View File

@@ -1,6 +1,8 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
namespace osu.Game.Audio
{
/// <summary>
@@ -10,6 +12,7 @@ namespace osu.Game.Audio
/// <see cref="IPreviewTrackOwner"/>s can cancel the currently playing <see cref="PreviewTrack"/> through the
/// global <see cref="PreviewTrackManager"/> if they're the owner of the playing <see cref="PreviewTrack"/>.
/// </remarks>
[Cached]
public interface IPreviewTrackOwner
{
}

View File

@@ -15,7 +15,6 @@ using osu.Game.Overlays;
namespace osu.Game.Graphics.Containers
{
[Cached(typeof(IPreviewTrackOwner))]
public abstract partial class OsuFocusedOverlayContainer : FocusedOverlayContainer, IPreviewTrackOwner, IKeyBindingHandler<GlobalAction>
{
protected readonly IBindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All);

View File

@@ -44,7 +44,6 @@ using osuTK;
namespace osu.Game.Screens.OnlinePlay.DailyChallenge
{
[Cached(typeof(IPreviewTrackOwner))]
public partial class DailyChallenge : OsuScreen, IPreviewTrackOwner, IHandlePresentBeatmap
{
private readonly Room room;

View File

@@ -30,7 +30,6 @@ using osuTK;
namespace osu.Game.Screens.Play
{
[Cached(typeof(IPreviewTrackOwner))]
public partial class SoloSpectatorScreen : SpectatorScreen, IPreviewTrackOwner
{
[Resolved]