mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 07:33:20 +08:00
Change rotate tool button to be enabled on single circle.
Inject osu ruleset specific rotate handler instead of generic handler.
This commit is contained in:
parent
e1f8bc9692
commit
601ba9f194
@ -101,7 +101,10 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
|
||||
RightToolbox.AddRange(new EditorToolboxGroup[]
|
||||
{
|
||||
new TransformToolboxGroup { RotationHandler = BlueprintContainer.SelectionHandler.RotationHandler, },
|
||||
new TransformToolboxGroup
|
||||
{
|
||||
RotationHandler = (OsuSelectionRotationHandler)BlueprintContainer.SelectionHandler.RotationHandler,
|
||||
},
|
||||
FreehandlSliderToolboxGroup
|
||||
}
|
||||
);
|
||||
|
@ -164,7 +164,7 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
if ((reference & Anchor.y0) > 0) scale.Y = -scale.Y;
|
||||
}
|
||||
|
||||
public override SelectionRotationHandler CreateRotationHandler() => new OsuSelectionRotationHandler();
|
||||
public override OsuSelectionRotationHandler CreateRotationHandler() => new OsuSelectionRotationHandler();
|
||||
|
||||
private void scaleSlider(Slider slider, Vector2 scale)
|
||||
{
|
||||
|
@ -11,7 +11,6 @@ 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
|
||||
@ -22,7 +21,7 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
|
||||
private EditorToolButton rotateButton = null!;
|
||||
|
||||
public SelectionRotationHandler RotationHandler { get; init; } = null!;
|
||||
public OsuSelectionRotationHandler RotationHandler { get; init; } = null!;
|
||||
|
||||
public TransformToolboxGroup()
|
||||
: base("transform")
|
||||
@ -53,7 +52,7 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
|
||||
// bindings to `Enabled` on the buttons are decoupled on purpose
|
||||
// due to the weird `OsuButton` behaviour of resetting `Enabled` to `false` when `Action` is set.
|
||||
canRotate.BindTo(RotationHandler.CanRotateSelectionOrigin);
|
||||
canRotate.BindTo(RotationHandler.CanRotatePlayfieldOrigin);
|
||||
canRotate.BindValueChanged(_ => rotateButton.Enabled.Value = canRotate.Value, true);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user