2020-01-04 12:01:42 +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.
|
|
|
|
|
2022-06-17 07:37:17 +00:00
|
|
|
#nullable disable
|
|
|
|
|
2020-12-04 11:21:53 +00:00
|
|
|
using osu.Framework.Allocation;
|
2020-01-04 12:01:42 +00:00
|
|
|
using osu.Framework.Audio.Track;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
|
|
|
using osu.Game.Graphics.Containers;
|
2020-04-05 10:36:52 +00:00
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
2020-12-04 11:21:53 +00:00
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
|
|
|
using osu.Game.Skinning;
|
|
|
|
using osuTK;
|
2020-01-04 12:01:42 +00:00
|
|
|
|
2020-12-04 11:21:53 +00:00
|
|
|
namespace osu.Game.Rulesets.Osu.Skinning.Default
|
2020-01-04 12:01:42 +00:00
|
|
|
{
|
|
|
|
public class ReverseArrowPiece : BeatSyncedContainer
|
|
|
|
{
|
2020-04-05 10:36:52 +00:00
|
|
|
[Resolved]
|
2020-04-05 10:39:31 +00:00
|
|
|
private DrawableHitObject drawableRepeat { get; set; }
|
2020-04-05 09:45:10 +00:00
|
|
|
|
2020-01-14 09:14:31 +00:00
|
|
|
public ReverseArrowPiece()
|
2020-01-04 12:01:42 +00:00
|
|
|
{
|
2020-01-13 16:39:45 +00:00
|
|
|
Divisor = 2;
|
|
|
|
MinimumBeatLength = 200;
|
|
|
|
|
2020-01-04 12:01:42 +00:00
|
|
|
Anchor = Anchor.Centre;
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
|
|
|
Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);
|
|
|
|
|
2020-01-13 16:45:10 +00:00
|
|
|
Child = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.ReverseArrow), _ => new SpriteIcon
|
2020-01-04 12:01:42 +00:00
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2020-04-08 09:58:09 +00:00
|
|
|
Blending = BlendingParameters.Additive,
|
2020-01-04 12:01:42 +00:00
|
|
|
Icon = FontAwesome.Solid.ChevronRight,
|
|
|
|
Size = new Vector2(0.35f)
|
2020-01-13 16:45:32 +00:00
|
|
|
})
|
2020-01-04 12:01:42 +00:00
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-06-23 04:49:18 +00:00
|
|
|
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
|
2020-04-05 09:45:10 +00:00
|
|
|
{
|
2020-04-05 10:39:31 +00:00
|
|
|
if (!drawableRepeat.IsHit)
|
2020-04-05 09:45:10 +00:00
|
|
|
Child.ScaleTo(1.3f).ScaleTo(1f, timingPoint.BeatLength, Easing.Out);
|
|
|
|
}
|
2020-01-04 12:01:42 +00:00
|
|
|
}
|
|
|
|
}
|