From 5585a7d4380cb6a7070f7f8dbaa6a9fe3c0caaad Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 30 Apr 2021 12:41:18 +0900 Subject: [PATCH] Add basic interfaces for skinnable target containers --- .../Screens/Play/HUD/IDefaultSkinnableTarget.cs | 12 ++++++++++++ osu.Game/Screens/Play/HUD/ISkinnableTarget.cs | 15 +++++++++++++++ osu.Game/Screens/Play/HUDOverlay.cs | 2 +- osu.Game/Skinning/Editor/SkinEditor.cs | 4 ++-- 4 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 osu.Game/Screens/Play/HUD/IDefaultSkinnableTarget.cs create mode 100644 osu.Game/Screens/Play/HUD/ISkinnableTarget.cs diff --git a/osu.Game/Screens/Play/HUD/IDefaultSkinnableTarget.cs b/osu.Game/Screens/Play/HUD/IDefaultSkinnableTarget.cs new file mode 100644 index 0000000000..208d920dec --- /dev/null +++ b/osu.Game/Screens/Play/HUD/IDefaultSkinnableTarget.cs @@ -0,0 +1,12 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +namespace osu.Game.Screens.Play.HUD +{ + /// + /// The default placement location for new s. + /// + public interface IDefaultSkinnableTarget : ISkinnableTarget + { + } +} diff --git a/osu.Game/Screens/Play/HUD/ISkinnableTarget.cs b/osu.Game/Screens/Play/HUD/ISkinnableTarget.cs new file mode 100644 index 0000000000..61a173ed02 --- /dev/null +++ b/osu.Game/Screens/Play/HUD/ISkinnableTarget.cs @@ -0,0 +1,15 @@ +// Copyright (c) ppy Pty Ltd . 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 +{ + /// + /// Denotes a container which can house s. + /// + public interface ISkinnableTarget : IContainerCollection + { + } +} diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 669c920017..eb6e599a19 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -22,7 +22,7 @@ using osuTK; namespace osu.Game.Screens.Play { [Cached] - public class HUDOverlay : Container, IKeyBindingHandler + public class HUDOverlay : Container, IKeyBindingHandler, IDefaultSkinnableTarget { public const float FADE_DURATION = 300; diff --git a/osu.Game/Skinning/Editor/SkinEditor.cs b/osu.Game/Skinning/Editor/SkinEditor.cs index 885d41043c..6d189dc027 100644 --- a/osu.Game/Skinning/Editor/SkinEditor.cs +++ b/osu.Game/Skinning/Editor/SkinEditor.cs @@ -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().FirstOrDefault(); + var targetContainer = target.ChildrenOfType().FirstOrDefault(); targetContainer?.Add(instance); }