mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Make selection blueprints handle position adjustments
This commit is contained in:
@ -12,7 +12,6 @@ using osu.Framework.Input.States;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
using osu.Game.Rulesets.Edit.Tools;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Compose.Components
|
||||
{
|
||||
@ -165,7 +164,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
|
||||
private void onSelectionRequested(SelectionBlueprint blueprint, InputState state) => selectionBox.HandleSelectionRequested(blueprint, state);
|
||||
|
||||
private void onDragRequested(SelectionBlueprint blueprint, Vector2 delta, InputState state) => selectionBox.HandleDrag(blueprint, delta, state);
|
||||
private void onDragRequested(DragEvent dragEvent) => selectionBox.HandleDrag(dragEvent);
|
||||
|
||||
private class SelectionBlueprintContainer : Container<SelectionBlueprint>
|
||||
{
|
||||
|
@ -12,7 +12,6 @@ using osu.Framework.Input.Events;
|
||||
using osu.Framework.Input.States;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
using osu.Game.Rulesets.Edit.Types;
|
||||
using OpenTK;
|
||||
using OpenTK.Input;
|
||||
|
||||
@ -60,19 +59,12 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
|
||||
#region User Input Handling
|
||||
|
||||
public void HandleDrag(SelectionBlueprint m, Vector2 delta, InputState state)
|
||||
public void HandleDrag(DragEvent dragEvent)
|
||||
{
|
||||
// Todo: Various forms of snapping
|
||||
|
||||
foreach (var blueprint in selectedBlueprints)
|
||||
{
|
||||
switch (blueprint.HitObject.HitObject)
|
||||
{
|
||||
case IHasEditablePosition editablePosition:
|
||||
editablePosition.OffsetPosition(delta);
|
||||
break;
|
||||
}
|
||||
}
|
||||
blueprint.AdjustPosition(dragEvent);
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(KeyDownEvent e)
|
||||
|
Reference in New Issue
Block a user