2018-10-29 17:35:46 +08:00
|
|
|
// 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;
|
2018-11-07 15:08:56 +08:00
|
|
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners.Components;
|
2018-10-29 17:35:46 +08:00
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
2018-11-01 18:24:58 +08:00
|
|
|
using osu.Game.Rulesets.Osu.UI;
|
2018-10-29 17:35:46 +08:00
|
|
|
|
2018-11-07 15:08:56 +08:00
|
|
|
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners
|
2018-10-29 17:35:46 +08:00
|
|
|
{
|
2018-11-06 17:04:03 +08:00
|
|
|
public class SpinnerPlacementBlueprint : PlacementBlueprint
|
2018-10-29 17:35:46 +08:00
|
|
|
{
|
|
|
|
public new Spinner HitObject => (Spinner)base.HitObject;
|
|
|
|
|
|
|
|
private readonly SpinnerPiece piece;
|
|
|
|
|
|
|
|
private bool isPlacingEnd;
|
|
|
|
|
2018-11-06 17:04:03 +08:00
|
|
|
public SpinnerPlacementBlueprint()
|
2018-11-01 18:24:58 +08:00
|
|
|
: base(new Spinner { Position = OsuPlayfield.BASE_SIZE / 2 })
|
2018-10-29 17:35:46 +08:00
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|