mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 00:42:55 +08:00
Add basic interfaces for skinnable target containers
This commit is contained in:
parent
ae9d1dc40b
commit
5585a7d438
12
osu.Game/Screens/Play/HUD/IDefaultSkinnableTarget.cs
Normal file
12
osu.Game/Screens/Play/HUD/IDefaultSkinnableTarget.cs
Normal file
@ -0,0 +1,12 @@
|
||||
// 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.
|
||||
|
||||
namespace osu.Game.Screens.Play.HUD
|
||||
{
|
||||
/// <summary>
|
||||
/// The default placement location for new <see cref="ISkinnableComponent"/>s.
|
||||
/// </summary>
|
||||
public interface IDefaultSkinnableTarget : ISkinnableTarget
|
||||
{
|
||||
}
|
||||
}
|
15
osu.Game/Screens/Play/HUD/ISkinnableTarget.cs
Normal file
15
osu.Game/Screens/Play/HUD/ISkinnableTarget.cs
Normal file
@ -0,0 +1,15 @@
|
||||
// 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.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Screens.Play.HUD
|
||||
{
|
||||
/// <summary>
|
||||
/// Denotes a container which can house <see cref="ISkinnableComponent"/>s.
|
||||
/// </summary>
|
||||
public interface ISkinnableTarget : IContainerCollection<Drawable>
|
||||
{
|
||||
}
|
||||
}
|
@ -22,7 +22,7 @@ using osuTK;
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
[Cached]
|
||||
public class HUDOverlay : Container, IKeyBindingHandler<GlobalAction>
|
||||
public class HUDOverlay : Container, IKeyBindingHandler<GlobalAction>, IDefaultSkinnableTarget
|
||||
{
|
||||
public const float FADE_DURATION = 300;
|
||||
|
||||
|
@ -11,7 +11,7 @@ using osu.Framework.Testing;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Cursor;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
|
||||
namespace osu.Game.Skinning.Editor
|
||||
{
|
||||
@ -70,7 +70,7 @@ namespace osu.Game.Skinning.Editor
|
||||
{
|
||||
var instance = (Drawable)Activator.CreateInstance(type);
|
||||
|
||||
var targetContainer = target.ChildrenOfType<HUDOverlay>().FirstOrDefault();
|
||||
var targetContainer = target.ChildrenOfType<IDefaultSkinnableTarget>().FirstOrDefault();
|
||||
|
||||
targetContainer?.Add(instance);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user