1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:07:25 +08:00

Move CanRotatePlayfieldOrigin bindable to generic rotation handler

This commit is contained in:
Nguyên Minh Hồ 2024-01-25 16:56:59 +07:00
parent 2fa52de87a
commit d5b70ed09a
5 changed files with 9 additions and 9 deletions

View File

@ -101,10 +101,7 @@ namespace osu.Game.Rulesets.Osu.Edit
RightToolbox.AddRange(new EditorToolboxGroup[]
{
new TransformToolboxGroup
{
RotationHandler = (OsuSelectionRotationHandler)BlueprintContainer.SelectionHandler.RotationHandler,
},
new TransformToolboxGroup { RotationHandler = BlueprintContainer.SelectionHandler.RotationHandler, },
FreehandlSliderToolboxGroup
}
);

View File

@ -164,7 +164,7 @@ namespace osu.Game.Rulesets.Osu.Edit
if ((reference & Anchor.y0) > 0) scale.Y = -scale.Y;
}
public override OsuSelectionRotationHandler CreateRotationHandler() => new OsuSelectionRotationHandler();
public override SelectionRotationHandler CreateRotationHandler() => new OsuSelectionRotationHandler();
private void scaleSlider(Slider slider, Vector2 scale)
{

View File

@ -19,8 +19,6 @@ namespace osu.Game.Rulesets.Osu.Edit
{
public partial class OsuSelectionRotationHandler : SelectionRotationHandler
{
public BindableBool CanRotatePlayfieldOrigin { get; private set; } = new BindableBool();
[Resolved]
private IEditorChangeHandler? changeHandler { get; set; }

View File

@ -11,6 +11,7 @@ using osu.Framework.Input.Events;
using osu.Game.Input.Bindings;
using osu.Game.Rulesets.Edit;
using osu.Game.Screens.Edit.Components;
using osu.Game.Screens.Edit.Compose.Components;
using osuTK;
namespace osu.Game.Rulesets.Osu.Edit
@ -21,7 +22,7 @@ namespace osu.Game.Rulesets.Osu.Edit
private EditorToolButton rotateButton = null!;
public OsuSelectionRotationHandler RotationHandler { get; init; } = null!;
public SelectionRotationHandler RotationHandler { get; init; } = null!;
public TransformToolboxGroup()
: base("transform")

View File

@ -14,10 +14,14 @@ namespace osu.Game.Screens.Edit.Compose.Components
{
/// <summary>
/// Whether rotation anchored by the selection origin can currently be performed.
/// This is in constrast to rotation anchored by the entire field.
/// </summary>
public Bindable<bool> CanRotateSelectionOrigin { get; private set; } = new BindableBool();
/// <summary>
/// Whether rotation anchored by the center of the playfield can currently be performed.
/// </summary>
public Bindable<bool> CanRotatePlayfieldOrigin { get; private set; } = new BindableBool();
/// <summary>
/// Performs a single, instant, atomic rotation operation.
/// </summary>