2020-01-04 20:01:42 +08: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.
|
|
|
|
|
2020-01-04 20:12:37 +08:00
|
|
|
using System;
|
2020-01-04 20:01:42 +08:00
|
|
|
using osu.Framework.Audio.Track;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osuTK;
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
|
|
|
using osu.Game.Graphics.Containers;
|
|
|
|
using osu.Game.Skinning;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|
|
|
{
|
|
|
|
public class ReverseArrowPiece : BeatSyncedContainer
|
|
|
|
{
|
2020-01-04 20:12:37 +08:00
|
|
|
private readonly RepeatPoint repeatPoint;
|
|
|
|
|
|
|
|
public ReverseArrowPiece(RepeatPoint repeatPoint)
|
2020-01-04 20:01:42 +08:00
|
|
|
{
|
2020-01-04 20:12:37 +08:00
|
|
|
this.repeatPoint = repeatPoint;
|
|
|
|
|
2020-01-14 00:39:45 +08:00
|
|
|
Divisor = 2;
|
|
|
|
MinimumBeatLength = 200;
|
|
|
|
|
2020-01-04 20:01:42 +08:00
|
|
|
Anchor = Anchor.Centre;
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
|
|
|
Blending = BlendingParameters.Additive;
|
|
|
|
|
|
|
|
Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);
|
|
|
|
|
2020-01-14 00:45:10 +08:00
|
|
|
Child = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.ReverseArrow), _ => new SpriteIcon
|
2020-01-04 20:01:42 +08:00
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Icon = FontAwesome.Solid.ChevronRight,
|
|
|
|
Size = new Vector2(0.35f)
|
2020-01-14 00:45:32 +08:00
|
|
|
})
|
2020-01-04 20:01:42 +08:00
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
|
|
|
|
{
|
2020-01-07 11:55:05 +08:00
|
|
|
if (Clock.CurrentTime < repeatPoint.StartTime)
|
2020-01-14 00:45:10 +08:00
|
|
|
Child.ScaleTo(1.3f).ScaleTo(1f, Math.Min(timingPoint.BeatLength, repeatPoint.StartTime - Clock.CurrentTime), Easing.Out);
|
2020-01-04 20:01:42 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|