mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:07:52 +08:00
Use better name if we're renaming
This commit is contained in:
parent
9a18ba2699
commit
4c881b5633
@ -41,8 +41,8 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
private void updateState()
|
private void updateState()
|
||||||
{
|
{
|
||||||
var quad = GeometryUtils.GetSurroundingQuad(selectedMovableObjects);
|
var quad = GeometryUtils.GetSurroundingQuad(selectedMovableObjects);
|
||||||
CanRotateFromSelectionOrigin.Value = quad.Width > 0 || quad.Height > 0;
|
CanRotateAroundSelectionOrigin.Value = quad.Width > 0 || quad.Height > 0;
|
||||||
CanRotateFromPlayfieldOrigin.Value = selectedMovableObjects.Any();
|
CanRotateAroundPlayfieldOrigin.Value = selectedMovableObjects.Any();
|
||||||
}
|
}
|
||||||
|
|
||||||
private OsuHitObject[]? objectsInRotation;
|
private OsuHitObject[]? objectsInRotation;
|
||||||
|
@ -86,7 +86,7 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
angleInput.Current.BindValueChanged(angle => rotationInfo.Value = rotationInfo.Value with { Degrees = angle.NewValue });
|
angleInput.Current.BindValueChanged(angle => rotationInfo.Value = rotationInfo.Value with { Degrees = angle.NewValue });
|
||||||
rotationOrigin.Items.First().Select();
|
rotationOrigin.Items.First().Select();
|
||||||
|
|
||||||
rotationHandler.CanRotateFromSelectionOrigin.BindValueChanged(e =>
|
rotationHandler.CanRotateAroundSelectionOrigin.BindValueChanged(e =>
|
||||||
{
|
{
|
||||||
selectionCentreButton.Selected.Disabled = !e.NewValue;
|
selectionCentreButton.Selected.Disabled = !e.NewValue;
|
||||||
}, true);
|
}, true);
|
||||||
|
@ -64,15 +64,15 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
// aggregate two values into canRotate
|
// aggregate two values into canRotate
|
||||||
canRotatePlayfieldOrigin = RotationHandler.CanRotateFromPlayfieldOrigin.GetBoundCopy();
|
canRotatePlayfieldOrigin = RotationHandler.CanRotateAroundPlayfieldOrigin.GetBoundCopy();
|
||||||
canRotatePlayfieldOrigin.BindValueChanged(_ => updateCanRotateAggregate());
|
canRotatePlayfieldOrigin.BindValueChanged(_ => updateCanRotateAggregate());
|
||||||
|
|
||||||
canRotateSelectionOrigin = RotationHandler.CanRotateFromSelectionOrigin.GetBoundCopy();
|
canRotateSelectionOrigin = RotationHandler.CanRotateAroundSelectionOrigin.GetBoundCopy();
|
||||||
canRotateSelectionOrigin.BindValueChanged(_ => updateCanRotateAggregate());
|
canRotateSelectionOrigin.BindValueChanged(_ => updateCanRotateAggregate());
|
||||||
|
|
||||||
void updateCanRotateAggregate()
|
void updateCanRotateAggregate()
|
||||||
{
|
{
|
||||||
canRotate.Value = RotationHandler.CanRotateFromPlayfieldOrigin.Value || RotationHandler.CanRotateFromSelectionOrigin.Value;
|
canRotate.Value = RotationHandler.CanRotateAroundPlayfieldOrigin.Value || RotationHandler.CanRotateAroundSelectionOrigin.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// aggregate three values into canScale
|
// aggregate three values into canScale
|
||||||
|
@ -69,7 +69,7 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
{
|
{
|
||||||
this.getTargetContainer = getTargetContainer;
|
this.getTargetContainer = getTargetContainer;
|
||||||
|
|
||||||
CanRotateFromSelectionOrigin.Value = true;
|
CanRotateAroundSelectionOrigin.Value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
[CanBeNull]
|
[CanBeNull]
|
||||||
|
@ -41,7 +41,7 @@ namespace osu.Game.Overlays.SkinEditor
|
|||||||
|
|
||||||
private void updateState()
|
private void updateState()
|
||||||
{
|
{
|
||||||
CanRotateFromSelectionOrigin.Value = selectedItems.Count > 0;
|
CanRotateAroundSelectionOrigin.Value = selectedItems.Count > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Drawable[]? objectsInRotation;
|
private Drawable[]? objectsInRotation;
|
||||||
|
@ -127,7 +127,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
if (rotationHandler != null)
|
if (rotationHandler != null)
|
||||||
canRotate.BindTo(rotationHandler.CanRotateFromSelectionOrigin);
|
canRotate.BindTo(rotationHandler.CanRotateAroundSelectionOrigin);
|
||||||
|
|
||||||
if (scaleHandler != null)
|
if (scaleHandler != null)
|
||||||
{
|
{
|
||||||
|
@ -15,12 +15,12 @@ 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.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Bindable<bool> CanRotateFromSelectionOrigin { get; private set; } = new BindableBool();
|
public Bindable<bool> CanRotateAroundSelectionOrigin { get; private set; } = new BindableBool();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether rotation anchored by the center of the playfield can currently be performed.
|
/// Whether rotation anchored by the center of the playfield can currently be performed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Bindable<bool> CanRotateFromPlayfieldOrigin { get; private set; } = new BindableBool();
|
public Bindable<bool> CanRotateAroundPlayfieldOrigin { get; private set; } = new BindableBool();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Performs a single, instant, atomic rotation operation.
|
/// Performs a single, instant, atomic rotation operation.
|
||||||
|
Loading…
Reference in New Issue
Block a user