mirror of
https://github.com/ppy/osu
synced 2025-01-14 01:51:04 +00: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)]
|
||||
protected IEditorChangeHandler ChangeHandler { get; private set; }
|
||||
|
||||
protected SelectionRotationHandler RotationHandler { get; private set; }
|
||||
|
||||
protected SelectionHandler()
|
||||
{
|
||||
selectedBlueprints = new List<SelectionBlueprint<T>>();
|
||||
@ -66,6 +68,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
RotationHandler = CreateRotationHandler();
|
||||
|
||||
InternalChild = SelectionBox = CreateSelectionBox();
|
||||
|
||||
SelectedItems.CollectionChanged += (_, _) =>
|
||||
@ -132,6 +136,11 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
/// <returns>Whether any items could be rotated.</returns>
|
||||
public virtual bool HandleRotation(float angle) => false;
|
||||
|
||||
/// <summary>
|
||||
/// Creates the handler to use for rotation operations.
|
||||
/// </summary>
|
||||
public virtual SelectionRotationHandler CreateRotationHandler() => new SelectionRotationHandler();
|
||||
|
||||
/// <summary>
|
||||
/// Handles the selected items being scaled.
|
||||
/// </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