mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Add global flip hotkeys
This commit is contained in:
@ -52,7 +52,7 @@ namespace osu.Game.Rulesets.Catch.Edit
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool HandleFlip(Direction direction)
|
||||
public override bool HandleFlip(Direction direction, bool flipOverOrigin)
|
||||
{
|
||||
var selectionRange = CatchHitObjectUtils.GetPositionRange(SelectedItems);
|
||||
|
||||
@ -60,7 +60,7 @@ namespace osu.Game.Rulesets.Catch.Edit
|
||||
EditorBeatmap.PerformOnSelection(h =>
|
||||
{
|
||||
if (h is CatchHitObject catchObject)
|
||||
changed |= handleFlip(selectionRange, catchObject);
|
||||
changed |= handleFlip(selectionRange, catchObject, flipOverOrigin);
|
||||
});
|
||||
return changed;
|
||||
}
|
||||
@ -116,7 +116,7 @@ namespace osu.Game.Rulesets.Catch.Edit
|
||||
return Math.Clamp(deltaX, lowerBound, upperBound);
|
||||
}
|
||||
|
||||
private bool handleFlip(PositionRange selectionRange, CatchHitObject hitObject)
|
||||
private bool handleFlip(PositionRange selectionRange, CatchHitObject hitObject, bool flipOverOrigin)
|
||||
{
|
||||
switch (hitObject)
|
||||
{
|
||||
@ -124,7 +124,7 @@ namespace osu.Game.Rulesets.Catch.Edit
|
||||
return false;
|
||||
|
||||
case JuiceStream juiceStream:
|
||||
juiceStream.OriginalX = selectionRange.GetFlippedPosition(juiceStream.OriginalX);
|
||||
juiceStream.OriginalX = getFlippedPosition(juiceStream.OriginalX);
|
||||
|
||||
foreach (var point in juiceStream.Path.ControlPoints)
|
||||
point.Position *= new Vector2(-1, 1);
|
||||
@ -133,9 +133,11 @@ namespace osu.Game.Rulesets.Catch.Edit
|
||||
return true;
|
||||
|
||||
default:
|
||||
hitObject.OriginalX = selectionRange.GetFlippedPosition(hitObject.OriginalX);
|
||||
hitObject.OriginalX = getFlippedPosition(hitObject.OriginalX);
|
||||
return true;
|
||||
}
|
||||
|
||||
float getFlippedPosition(float original) => flipOverOrigin ? CatchPlayfield.WIDTH - original : selectionRange.GetFlippedPosition(original);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user