2019-01-24 08:43:03 +00:00
|
|
|
// 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.
|
2018-10-29 09:35:46 +00:00
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Input.Events;
|
|
|
|
using osu.Game.Rulesets.Edit;
|
2018-11-07 07:08:56 +00:00
|
|
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners.Components;
|
2018-10-29 09:35:46 +00:00
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
2018-11-01 10:24:58 +00:00
|
|
|
using osu.Game.Rulesets.Osu.UI;
|
2019-10-03 07:14:42 +00:00
|
|
|
using osuTK;
|
2018-10-29 09:35:46 +00:00
|
|
|
|
2018-11-07 07:08:56 +00:00
|
|
|
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners
|
2018-10-29 09:35:46 +00:00
|
|
|
{
|
2018-11-06 09:04:03 +00:00
|
|
|
public class SpinnerPlacementBlueprint : PlacementBlueprint
|
2018-10-29 09:35:46 +00:00
|
|
|
{
|
|
|
|
public new Spinner HitObject => (Spinner)base.HitObject;
|
|
|
|
|
|
|
|
private readonly SpinnerPiece piece;
|
|
|
|
|
|
|
|
private bool isPlacingEnd;
|
|
|
|
|
2018-11-06 09:04:03 +00:00
|
|
|
public SpinnerPlacementBlueprint()
|
2018-11-01 10:24:58 +00:00
|
|
|
: base(new Spinner { Position = OsuPlayfield.BASE_SIZE / 2 })
|
2018-10-29 09:35:46 +00:00
|
|
|
{
|
2019-09-27 09:45:22 +00:00
|
|
|
InternalChild = piece = new SpinnerPiece { Alpha = 0.5f };
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void Update()
|
|
|
|
{
|
|
|
|
base.Update();
|
|
|
|
|
|
|
|
piece.UpdateFrom(HitObject);
|
2018-10-29 09:35:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
protected override bool OnClick(ClickEvent e)
|
|
|
|
{
|
|
|
|
if (isPlacingEnd)
|
|
|
|
{
|
|
|
|
HitObject.EndTime = EditorClock.CurrentTime;
|
|
|
|
EndPlacement();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
isPlacingEnd = true;
|
|
|
|
piece.FadeTo(1f, 150, Easing.OutQuint);
|
2018-11-13 03:52:44 +00:00
|
|
|
|
|
|
|
BeginPlacement();
|
2018-10-29 09:35:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
2019-10-03 07:14:42 +00:00
|
|
|
|
|
|
|
public override void UpdatePosition(Vector2 screenSpacePosition)
|
|
|
|
{
|
|
|
|
}
|
2018-10-29 09:35:46 +00:00
|
|
|
}
|
|
|
|
}
|