1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 08:02:55 +08:00

Add "Reset position" menu item in skin editor

This commit is contained in:
Dean Herbert 2022-03-16 20:02:52 +09:00
parent 7e8aa77b2b
commit 7e52623645

View File

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Extensions.EnumExtensions;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.UserInterface;
@ -199,6 +200,12 @@ namespace osu.Game.Skinning.Editor
Items = createAnchorItems((d, o) => ((Drawable)d).Origin == o, applyOrigins).ToArray()
};
yield return new OsuMenuItem("Reset position", MenuItemType.Standard, () =>
{
foreach (var blueprint in SelectedBlueprints)
((Drawable)blueprint.Item).Position = Vector2.Zero;
});
foreach (var item in base.GetContextMenuItemsForSelection(selection))
yield return item;