From 26efb8e8423ccc7e4aa559d2aea28090d4fc3b61 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Feb 2023 18:33:31 +0900 Subject: [PATCH 1/3] Replace white box legacy placeholder with something that visually fits --- .../SkinEditor/SkinBlueprintContainer.cs | 72 +++++++++++++++++-- 1 file changed, 67 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/SkinEditor/SkinBlueprintContainer.cs b/osu.Game/Overlays/SkinEditor/SkinBlueprintContainer.cs index 9f99242fc5..a448b3d0c1 100644 --- a/osu.Game/Overlays/SkinEditor/SkinBlueprintContainer.cs +++ b/osu.Game/Overlays/SkinEditor/SkinBlueprintContainer.cs @@ -8,11 +8,15 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Sprites; using osu.Framework.Input.Events; -using osu.Framework.Screens; using osu.Framework.Testing; +using osu.Game.Graphics; +using osu.Game.Graphics.Containers; +using osu.Game.Graphics.UserInterfaceV2; using osu.Game.Rulesets.Edit; -using osu.Game.Screens; using osu.Game.Screens.Edit.Compose.Components; using osu.Game.Skinning; using osuTK; @@ -45,9 +49,7 @@ namespace osu.Game.Overlays.SkinEditor if (targetContainers.Length == 0) { - string targetScreen = target.ChildrenOfType().LastOrDefault()?.GetType().Name ?? "this screen"; - - AddInternal(new ScreenWhiteBox.UnderConstructionMessage(targetScreen, "doesn't support skin customisation just yet.")); + AddInternal(new NonSkinnableScreenPlaceholder()); return; } @@ -158,5 +160,65 @@ namespace osu.Game.Overlays.SkinEditor foreach (var list in targetComponents) list.UnbindAll(); } + + public partial class NonSkinnableScreenPlaceholder : CompositeDrawable + { + [Resolved] + private SkinEditorOverlay? skinEditorOverlay { get; set; } + + [BackgroundDependencyLoader] + private void load(OverlayColourProvider colourProvider) + { + RelativeSizeAxes = Axes.Both; + + InternalChildren = new Drawable[] + { + new Box + { + Colour = colourProvider.Dark6, + RelativeSizeAxes = Axes.Both, + Alpha = 0.95f, + }, + new FillFlowContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Spacing = new Vector2(0, 5), + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + new SpriteIcon + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Icon = FontAwesome.Solid.ExclamationCircle, + Size = new Vector2(24), + Y = -5, + }, + new OsuTextFlowContainer(t => t.Font = OsuFont.Default.With(weight: FontWeight.SemiBold, size: 18)) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + TextAnchor = Anchor.Centre, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Text = "Please navigate to a skinnable screen using the scene library", + }, + new RoundedButton + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Width = 200, + Margin = new MarginPadding { Top = 20 }, + Action = () => skinEditorOverlay?.Hide(), + Text = "Return to game" + } + } + }, + }; + } + } } } From 9b6d95b3d6ff4c01e371fc0b8898ad14498c8d44 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Feb 2023 18:33:45 +0900 Subject: [PATCH 2/3] Adjust skin editor pop in/out to be more snappy --- osu.Game/Overlays/SkinEditor/SkinEditor.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Overlays/SkinEditor/SkinEditor.cs b/osu.Game/Overlays/SkinEditor/SkinEditor.cs index ad89057d12..479a559643 100644 --- a/osu.Game/Overlays/SkinEditor/SkinEditor.cs +++ b/osu.Game/Overlays/SkinEditor/SkinEditor.cs @@ -33,7 +33,7 @@ namespace osu.Game.Overlays.SkinEditor [Cached(typeof(SkinEditor))] public partial class SkinEditor : VisibilityContainer, ICanAcceptFiles, IKeyBindingHandler { - public const double TRANSITION_DURATION = 500; + public const double TRANSITION_DURATION = 300; public const float MENU_HEIGHT = 40; @@ -361,7 +361,6 @@ namespace osu.Game.Overlays.SkinEditor { this // align animation to happen after the majority of the ScalingContainer animation completes. - .Delay(ScalingContainer.TRANSITION_DURATION * 0.3f) .FadeIn(TRANSITION_DURATION, Easing.OutQuint); } From f7fa9e3927c7ad65bc631aa7242febb04ffbc823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 2 Feb 2023 18:41:35 +0100 Subject: [PATCH 3/3] Remove outdated comment --- osu.Game/Overlays/SkinEditor/SkinEditor.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game/Overlays/SkinEditor/SkinEditor.cs b/osu.Game/Overlays/SkinEditor/SkinEditor.cs index 479a559643..275cbd18d7 100644 --- a/osu.Game/Overlays/SkinEditor/SkinEditor.cs +++ b/osu.Game/Overlays/SkinEditor/SkinEditor.cs @@ -359,9 +359,7 @@ namespace osu.Game.Overlays.SkinEditor protected override void PopIn() { - this - // align animation to happen after the majority of the ScalingContainer animation completes. - .FadeIn(TRANSITION_DURATION, Easing.OutQuint); + this.FadeIn(TRANSITION_DURATION, Easing.OutQuint); } protected override void PopOut()