diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditor.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditor.cs index 48dbda9da6..86d97b4999 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditor.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditor.cs @@ -9,11 +9,11 @@ using osu.Framework.Graphics.UserInterface; using osu.Framework.Testing; using osu.Game.Overlays; using osu.Game.Overlays.Settings; +using osu.Game.Overlays.SkinEditor; using osu.Game.Rulesets; using osu.Game.Rulesets.Osu; using osu.Game.Screens.Play.HUD.HitErrorMeters; using osu.Game.Skinning; -using osu.Game.Skinning.Editor; using osuTK.Input; namespace osu.Game.Tests.Visual.Gameplay diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditorComponentsList.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditorComponentsList.cs index 05a550a24d..2ae5e6f998 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditorComponentsList.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditorComponentsList.cs @@ -7,9 +7,9 @@ using NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Overlays; +using osu.Game.Overlays.SkinEditor; using osu.Game.Rulesets; using osu.Game.Rulesets.Osu; -using osu.Game.Skinning.Editor; namespace osu.Game.Tests.Visual.Gameplay { diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditorMultipleSkins.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditorMultipleSkins.cs index ad3911f50b..d5b6ac38cb 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditorMultipleSkins.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditorMultipleSkins.cs @@ -8,11 +8,11 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Testing; using osu.Framework.Timing; +using osu.Game.Overlays.SkinEditor; using osu.Game.Rulesets; using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Play; -using osu.Game.Skinning.Editor; using osu.Game.Tests.Gameplay; using osuTK.Input; diff --git a/osu.Game.Tests/Visual/Navigation/TestSceneEditDefaultSkin.cs b/osu.Game.Tests/Visual/Navigation/TestSceneEditDefaultSkin.cs index 7d39d48378..bd75825da2 100644 --- a/osu.Game.Tests/Visual/Navigation/TestSceneEditDefaultSkin.cs +++ b/osu.Game.Tests/Visual/Navigation/TestSceneEditDefaultSkin.cs @@ -8,8 +8,8 @@ using NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Testing; using osu.Game.Overlays.Settings.Sections; +using osu.Game.Overlays.SkinEditor; using osu.Game.Skinning; -using osu.Game.Skinning.Editor; namespace osu.Game.Tests.Visual.Navigation { diff --git a/osu.Game.Tests/Visual/Navigation/TestSceneSkinEditorNavigation.cs b/osu.Game.Tests/Visual/Navigation/TestSceneSkinEditorNavigation.cs index 845cfdd6df..467b943ea0 100644 --- a/osu.Game.Tests/Visual/Navigation/TestSceneSkinEditorNavigation.cs +++ b/osu.Game.Tests/Visual/Navigation/TestSceneSkinEditorNavigation.cs @@ -12,11 +12,11 @@ using osu.Framework.Screens; using osu.Framework.Testing; using osu.Framework.Threading; using osu.Game.Overlays.Settings; +using osu.Game.Overlays.SkinEditor; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu.Mods; using osu.Game.Screens.Play; using osu.Game.Screens.Play.HUD.HitErrorMeters; -using osu.Game.Skinning.Editor; using osu.Game.Tests.Beatmaps.IO; using osuTK; using osuTK.Input; diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 4113c9be8f..df3d8b99f4 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -49,6 +49,7 @@ using osu.Game.Overlays; using osu.Game.Overlays.BeatmapListing; using osu.Game.Overlays.Music; using osu.Game.Overlays.Notifications; +using osu.Game.Overlays.SkinEditor; using osu.Game.Overlays.Toolbar; using osu.Game.Overlays.Volume; using osu.Game.Performance; @@ -59,7 +60,6 @@ using osu.Game.Screens.Menu; using osu.Game.Screens.Play; using osu.Game.Screens.Ranking; using osu.Game.Screens.Select; -using osu.Game.Skinning.Editor; using osu.Game.Updater; using osu.Game.Users; using osu.Game.Utils; diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs index f75656cc99..5cf8157812 100644 --- a/osu.Game/Overlays/Settings/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs @@ -17,9 +17,9 @@ using osu.Framework.Platform; using osu.Game.Database; using osu.Game.Graphics.UserInterface; using osu.Game.Localisation; +using osu.Game.Overlays.SkinEditor; using osu.Game.Screens.Select; using osu.Game.Skinning; -using osu.Game.Skinning.Editor; using Realms; namespace osu.Game.Overlays.Settings.Sections diff --git a/osu.Game/Skinning/Editor/SkinBlueprint.cs b/osu.Game/Overlays/SkinEditor/SkinBlueprint.cs similarity index 98% rename from osu.Game/Skinning/Editor/SkinBlueprint.cs rename to osu.Game/Overlays/SkinEditor/SkinBlueprint.cs index c5e822a17a..893bc4bac2 100644 --- a/osu.Game/Skinning/Editor/SkinBlueprint.cs +++ b/osu.Game/Overlays/SkinEditor/SkinBlueprint.cs @@ -11,10 +11,11 @@ using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Edit; +using osu.Game.Skinning; using osuTK; using osuTK.Graphics; -namespace osu.Game.Skinning.Editor +namespace osu.Game.Overlays.SkinEditor { public partial class SkinBlueprint : SelectionBlueprint { diff --git a/osu.Game/Skinning/Editor/SkinBlueprintContainer.cs b/osu.Game/Overlays/SkinEditor/SkinBlueprintContainer.cs similarity index 63% rename from osu.Game/Skinning/Editor/SkinBlueprintContainer.cs rename to osu.Game/Overlays/SkinEditor/SkinBlueprintContainer.cs index 2998136aca..a448b3d0c1 100644 --- a/osu.Game/Skinning/Editor/SkinBlueprintContainer.cs +++ b/osu.Game/Overlays/SkinEditor/SkinBlueprintContainer.cs @@ -8,16 +8,21 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; -using osu.Framework.Screens; -using osu.Framework.Testing; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Sprites; using osu.Framework.Input.Events; +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; using osuTK.Input; -namespace osu.Game.Skinning.Editor +namespace osu.Game.Overlays.SkinEditor { public partial class SkinBlueprintContainer : BlueprintContainer { @@ -44,9 +49,7 @@ namespace osu.Game.Skinning.Editor 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; } @@ -157,5 +160,65 @@ namespace osu.Game.Skinning.Editor 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" + } + } + }, + }; + } + } } } diff --git a/osu.Game/Skinning/Editor/SkinComponentToolbox.cs b/osu.Game/Overlays/SkinEditor/SkinComponentToolbox.cs similarity index 99% rename from osu.Game/Skinning/Editor/SkinComponentToolbox.cs rename to osu.Game/Overlays/SkinEditor/SkinComponentToolbox.cs index 9985b81059..6017a98944 100644 --- a/osu.Game/Skinning/Editor/SkinComponentToolbox.cs +++ b/osu.Game/Overlays/SkinEditor/SkinComponentToolbox.cs @@ -11,12 +11,12 @@ using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Localisation; -using osu.Game.Overlays; using osu.Game.Screens.Edit.Components; using osu.Game.Screens.Play.HUD; +using osu.Game.Skinning; using osuTK; -namespace osu.Game.Skinning.Editor +namespace osu.Game.Overlays.SkinEditor { public partial class SkinComponentToolbox : EditorSidebarSection { diff --git a/osu.Game/Skinning/Editor/SkinEditor.cs b/osu.Game/Overlays/SkinEditor/SkinEditor.cs similarity index 97% rename from osu.Game/Skinning/Editor/SkinEditor.cs rename to osu.Game/Overlays/SkinEditor/SkinEditor.cs index 5c0c8b2427..275cbd18d7 100644 --- a/osu.Game/Skinning/Editor/SkinEditor.cs +++ b/osu.Game/Overlays/SkinEditor/SkinEditor.cs @@ -23,17 +23,17 @@ using osu.Game.Graphics.Containers; using osu.Game.Graphics.Cursor; using osu.Game.Graphics.UserInterface; using osu.Game.Localisation; -using osu.Game.Overlays; using osu.Game.Overlays.OSD; using osu.Game.Screens.Edit.Components; using osu.Game.Screens.Edit.Components.Menus; +using osu.Game.Skinning; -namespace osu.Game.Skinning.Editor +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; @@ -359,10 +359,7 @@ namespace osu.Game.Skinning.Editor protected override void PopIn() { - this - // align animation to happen after the majority of the ScalingContainer animation completes. - .Delay(ScalingContainer.TRANSITION_DURATION * 0.3f) - .FadeIn(TRANSITION_DURATION, Easing.OutQuint); + this.FadeIn(TRANSITION_DURATION, Easing.OutQuint); } protected override void PopOut() diff --git a/osu.Game/Skinning/Editor/SkinEditorOverlay.cs b/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs similarity index 99% rename from osu.Game/Skinning/Editor/SkinEditorOverlay.cs rename to osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs index f15afc7feb..4eff87c5f4 100644 --- a/osu.Game/Skinning/Editor/SkinEditorOverlay.cs +++ b/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs @@ -14,7 +14,7 @@ using osu.Game.Screens; using osu.Game.Screens.Edit.Components; using osuTK; -namespace osu.Game.Skinning.Editor +namespace osu.Game.Overlays.SkinEditor { /// /// A container which handles loading a skin editor on user request for a specified target. diff --git a/osu.Game/Skinning/Editor/SkinEditorSceneLibrary.cs b/osu.Game/Overlays/SkinEditor/SkinEditorSceneLibrary.cs similarity index 98% rename from osu.Game/Skinning/Editor/SkinEditorSceneLibrary.cs rename to osu.Game/Overlays/SkinEditor/SkinEditorSceneLibrary.cs index 0936be3ee8..61195d7175 100644 --- a/osu.Game/Skinning/Editor/SkinEditorSceneLibrary.cs +++ b/osu.Game/Overlays/SkinEditor/SkinEditorSceneLibrary.cs @@ -14,7 +14,6 @@ using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Localisation; -using osu.Game.Overlays; using osu.Game.Rulesets; using osu.Game.Rulesets.Mods; using osu.Game.Screens; @@ -23,7 +22,7 @@ using osu.Game.Screens.Select; using osu.Game.Utils; using osuTK; -namespace osu.Game.Skinning.Editor +namespace osu.Game.Overlays.SkinEditor { public partial class SkinEditorSceneLibrary : CompositeDrawable { diff --git a/osu.Game/Skinning/Editor/SkinSelectionHandler.cs b/osu.Game/Overlays/SkinEditor/SkinSelectionHandler.cs similarity index 99% rename from osu.Game/Skinning/Editor/SkinSelectionHandler.cs rename to osu.Game/Overlays/SkinEditor/SkinSelectionHandler.cs index d67cbef481..129b9c1b44 100644 --- a/osu.Game/Skinning/Editor/SkinSelectionHandler.cs +++ b/osu.Game/Overlays/SkinEditor/SkinSelectionHandler.cs @@ -14,9 +14,10 @@ using osu.Game.Extensions; using osu.Game.Graphics.UserInterface; using osu.Game.Rulesets.Edit; using osu.Game.Screens.Edit.Compose.Components; +using osu.Game.Skinning; using osuTK; -namespace osu.Game.Skinning.Editor +namespace osu.Game.Overlays.SkinEditor { public partial class SkinSelectionHandler : SelectionHandler { diff --git a/osu.Game/Skinning/Editor/SkinSettingsToolbox.cs b/osu.Game/Overlays/SkinEditor/SkinSettingsToolbox.cs similarity index 96% rename from osu.Game/Skinning/Editor/SkinSettingsToolbox.cs rename to osu.Game/Overlays/SkinEditor/SkinSettingsToolbox.cs index 6afe92c6b2..5a48dee973 100644 --- a/osu.Game/Skinning/Editor/SkinSettingsToolbox.cs +++ b/osu.Game/Overlays/SkinEditor/SkinSettingsToolbox.cs @@ -9,7 +9,7 @@ using osu.Game.Localisation; using osu.Game.Screens.Edit.Components; using osuTK; -namespace osu.Game.Skinning.Editor +namespace osu.Game.Overlays.SkinEditor { internal partial class SkinSettingsToolbox : EditorSidebarSection {