diff --git a/osu.Game/Skinning/Editor/SkinEditor.cs b/osu.Game/Skinning/Editor/SkinEditor.cs index f7e5aeecdf..6fe3df6e8a 100644 --- a/osu.Game/Skinning/Editor/SkinEditor.cs +++ b/osu.Game/Skinning/Editor/SkinEditor.cs @@ -11,7 +11,6 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input.Events; using osu.Framework.Testing; -using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Cursor; @@ -50,7 +49,7 @@ namespace osu.Game.Skinning.Editor private Container content; - private EditorSidebarSection settingsToolbox; + private EditorSidebar settingsSidebar; public SkinEditor() { @@ -161,17 +160,7 @@ namespace osu.Game.Skinning.Editor Depth = float.MaxValue, RelativeSizeAxes = Axes.Both, }, - new EditorSidebar - { - Children = new[] - { - settingsToolbox = new SkinSettingsToolbox - { - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreRight, - } - } - }, + settingsSidebar = new EditorSidebar(), } } } @@ -266,14 +255,10 @@ namespace osu.Game.Skinning.Editor private void populateSettings() { - settingsToolbox.Clear(); + settingsSidebar.Clear(); - var first = SelectedComponents.OfType().FirstOrDefault(); - - if (first != null) - { - settingsToolbox.Children = first.CreateSettingsControls().ToArray(); - } + foreach (var component in SelectedComponents.OfType()) + settingsSidebar.Add(new SkinSettingsToolbox(component)); } private IEnumerable availableTargets => targetScreen.ChildrenOfType(); diff --git a/osu.Game/Skinning/Editor/SkinSettingsToolbox.cs b/osu.Game/Skinning/Editor/SkinSettingsToolbox.cs index fc06d3647a..d2823ed0e4 100644 --- a/osu.Game/Skinning/Editor/SkinSettingsToolbox.cs +++ b/osu.Game/Skinning/Editor/SkinSettingsToolbox.cs @@ -1,8 +1,10 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Game.Configuration; using osu.Game.Screens.Edit.Components; using osuTK; @@ -12,8 +14,8 @@ namespace osu.Game.Skinning.Editor { protected override Container Content { get; } - public SkinSettingsToolbox() - : base("Settings") + public SkinSettingsToolbox(Drawable component) + : base($"Settings ({component.GetType().Name})") { base.Content.Add(Content = new FillFlowContainer { @@ -21,6 +23,7 @@ namespace osu.Game.Skinning.Editor AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Spacing = new Vector2(10), + Children = component.CreateSettingsControls().ToArray() }); } }