mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Add component list to main editor interface and enable basic placement
This commit is contained in:
@ -1,13 +1,17 @@
|
||||
// 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 System;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Cursor;
|
||||
using osu.Game.Screens.Play;
|
||||
|
||||
namespace osu.Game.Skinning.Editor
|
||||
{
|
||||
@ -45,6 +49,12 @@ namespace osu.Game.Skinning.Editor
|
||||
RelativeSizeAxes = Axes.X
|
||||
},
|
||||
new SkinBlueprintContainer(target),
|
||||
new SkinComponentToolbox
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
RequestPlacement = placeComponent
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -56,6 +66,15 @@ namespace osu.Game.Skinning.Editor
|
||||
});
|
||||
}
|
||||
|
||||
private void placeComponent(Type type)
|
||||
{
|
||||
var instance = (Drawable)Activator.CreateInstance(type);
|
||||
|
||||
var targetContainer = target.ChildrenOfType<HUDOverlay>().FirstOrDefault();
|
||||
|
||||
targetContainer?.Add(instance);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
Reference in New Issue
Block a user