mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 02:37:25 +08:00
48 lines
1.3 KiB
C#
48 lines
1.3 KiB
C#
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
using osu.Framework.Graphics;
|
|
using osu.Framework.Input.Events;
|
|
using osu.Game.Rulesets.Edit;
|
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners.Components;
|
|
using osu.Game.Rulesets.Osu.Objects;
|
|
using osu.Game.Rulesets.Osu.UI;
|
|
|
|
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners
|
|
{
|
|
public class SpinnerPlacementBlueprint : PlacementBlueprint
|
|
{
|
|
public new Spinner HitObject => (Spinner)base.HitObject;
|
|
|
|
private readonly SpinnerPiece piece;
|
|
|
|
private bool isPlacingEnd;
|
|
|
|
public SpinnerPlacementBlueprint()
|
|
: base(new Spinner { Position = OsuPlayfield.BASE_SIZE / 2 })
|
|
{
|
|
InternalChild = piece = new SpinnerPiece(HitObject) { Alpha = 0.5f };
|
|
}
|
|
|
|
protected override bool OnClick(ClickEvent e)
|
|
{
|
|
if (isPlacingEnd)
|
|
{
|
|
HitObject.EndTime = EditorClock.CurrentTime;
|
|
EndPlacement();
|
|
}
|
|
else
|
|
{
|
|
HitObject.StartTime = EditorClock.CurrentTime;
|
|
|
|
isPlacingEnd = true;
|
|
piece.FadeTo(1f, 150, Easing.OutQuint);
|
|
|
|
BeginPlacement();
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|