mirror of
https://github.com/ppy/osu.git
synced 2025-02-28 04:43:37 +08:00
Add basic structure for new rotation handler
This commit is contained in:
parent
4622255cc7
commit
ba8ebefb50
@ -55,6 +55,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
[Resolved(CanBeNull = true)]
|
[Resolved(CanBeNull = true)]
|
||||||
protected IEditorChangeHandler ChangeHandler { get; private set; }
|
protected IEditorChangeHandler ChangeHandler { get; private set; }
|
||||||
|
|
||||||
|
protected SelectionRotationHandler RotationHandler { get; private set; }
|
||||||
|
|
||||||
protected SelectionHandler()
|
protected SelectionHandler()
|
||||||
{
|
{
|
||||||
selectedBlueprints = new List<SelectionBlueprint<T>>();
|
selectedBlueprints = new List<SelectionBlueprint<T>>();
|
||||||
@ -66,6 +68,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
|
RotationHandler = CreateRotationHandler();
|
||||||
|
|
||||||
InternalChild = SelectionBox = CreateSelectionBox();
|
InternalChild = SelectionBox = CreateSelectionBox();
|
||||||
|
|
||||||
SelectedItems.CollectionChanged += (_, _) =>
|
SelectedItems.CollectionChanged += (_, _) =>
|
||||||
@ -132,6 +136,11 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
/// <returns>Whether any items could be rotated.</returns>
|
/// <returns>Whether any items could be rotated.</returns>
|
||||||
public virtual bool HandleRotation(float angle) => false;
|
public virtual bool HandleRotation(float angle) => false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates the handler to use for rotation operations.
|
||||||
|
/// </summary>
|
||||||
|
public virtual SelectionRotationHandler CreateRotationHandler() => new SelectionRotationHandler();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handles the selected items being scaled.
|
/// Handles the selected items being scaled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
// 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 osu.Framework.Bindables;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Screens.Edit.Compose.Components
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Base handler for editor rotation operations.
|
||||||
|
/// </summary>
|
||||||
|
public class SelectionRotationHandler
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the rotation can currently be performed.
|
||||||
|
/// </summary>
|
||||||
|
public Bindable<bool> CanRotate { get; private set; } = new BindableBool();
|
||||||
|
|
||||||
|
public virtual void Begin()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void Update(float rotation, Vector2 origin)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void Commit()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user