mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Merge branch 'master' into placement-display-in-timeline
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
@ -8,6 +9,7 @@ using osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners.Components;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Rulesets.Osu.UI;
|
||||
using osuTK;
|
||||
using osuTK.Input;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners
|
||||
{
|
||||
@ -29,22 +31,31 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners
|
||||
{
|
||||
base.Update();
|
||||
|
||||
if (isPlacingEnd)
|
||||
HitObject.EndTime = Math.Max(HitObject.StartTime, EditorClock.CurrentTime);
|
||||
|
||||
piece.UpdateFrom(HitObject);
|
||||
}
|
||||
|
||||
protected override bool OnClick(ClickEvent e)
|
||||
protected override bool OnMouseDown(MouseDownEvent e)
|
||||
{
|
||||
if (isPlacingEnd)
|
||||
{
|
||||
if (e.Button != MouseButton.Right)
|
||||
return false;
|
||||
|
||||
HitObject.EndTime = EditorClock.CurrentTime;
|
||||
EndPlacement(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
isPlacingEnd = true;
|
||||
piece.FadeTo(1f, 150, Easing.OutQuint);
|
||||
if (e.Button != MouseButton.Left)
|
||||
return false;
|
||||
|
||||
BeginPlacement();
|
||||
piece.FadeTo(1f, 150, Easing.OutQuint);
|
||||
|
||||
isPlacingEnd = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -36,6 +36,9 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
|
||||
protected override DistanceSnapGrid CreateDistanceSnapGrid(IEnumerable<HitObject> selectedHitObjects)
|
||||
{
|
||||
if (BlueprintContainer.CurrentTool is SpinnerCompositionTool)
|
||||
return null;
|
||||
|
||||
var objects = selectedHitObjects.ToList();
|
||||
|
||||
if (objects.Count == 0)
|
||||
@ -89,6 +92,9 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
targetIndex++;
|
||||
}
|
||||
|
||||
if (sourceObject is Spinner)
|
||||
return null;
|
||||
|
||||
return new OsuDistanceSnapGrid((OsuHitObject)sourceObject, (OsuHitObject)targetObject);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user