1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37: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[] RightToolbox.AddRange(new EditorToolboxGroup[]
{ {
new TransformToolboxGroup new TransformToolboxGroup { RotationHandler = BlueprintContainer.SelectionHandler.RotationHandler, },
{
RotationHandler = (OsuSelectionRotationHandler)BlueprintContainer.SelectionHandler.RotationHandler,
},
FreehandlSliderToolboxGroup FreehandlSliderToolboxGroup
} }
); );

View File

@ -164,7 +164,7 @@ namespace osu.Game.Rulesets.Osu.Edit
if ((reference & Anchor.y0) > 0) scale.Y = -scale.Y; 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) 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 partial class OsuSelectionRotationHandler : SelectionRotationHandler
{ {
public BindableBool CanRotatePlayfieldOrigin { get; private set; } = new BindableBool();
[Resolved] [Resolved]
private IEditorChangeHandler? changeHandler { get; set; } private IEditorChangeHandler? changeHandler { get; set; }

View File

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

View File

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