2022-09-19 14:39:08 +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.
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
2023-10-02 16:41:08 +08:00
|
|
|
using osu.Framework.Audio.Track;
|
2022-09-19 14:39:08 +08:00
|
|
|
using osu.Framework.Bindables;
|
|
|
|
using osu.Framework.Extensions.Color4Extensions;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
2023-10-02 16:41:08 +08:00
|
|
|
using osu.Framework.Graphics.Textures;
|
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
|
|
|
using osu.Game.Graphics.Containers;
|
2022-09-19 14:39:08 +08:00
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
|
|
|
using osuTK;
|
|
|
|
using osuTK.Graphics;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
|
|
|
{
|
2023-10-02 16:41:08 +08:00
|
|
|
public partial class ArgonReverseArrow : BeatSyncedContainer
|
2022-09-19 14:39:08 +08:00
|
|
|
{
|
2023-10-02 16:41:08 +08:00
|
|
|
[Resolved]
|
|
|
|
private DrawableHitObject drawableRepeat { get; set; } = null!;
|
|
|
|
|
2022-09-19 14:39:08 +08:00
|
|
|
private Bindable<Color4> accentColour = null!;
|
|
|
|
|
|
|
|
private SpriteIcon icon = null!;
|
|
|
|
|
2023-10-02 16:41:08 +08:00
|
|
|
private Container main = null!;
|
2023-10-02 17:26:35 +08:00
|
|
|
private Sprite side = null!;
|
2023-10-02 16:41:08 +08:00
|
|
|
|
2022-09-19 14:39:08 +08:00
|
|
|
[BackgroundDependencyLoader]
|
2023-10-02 16:41:08 +08:00
|
|
|
private void load(TextureStore textures, DrawableHitObject hitObject)
|
2022-09-19 14:39:08 +08:00
|
|
|
{
|
2023-10-02 17:26:35 +08:00
|
|
|
Divisor = 2;
|
2023-10-02 17:34:21 +08:00
|
|
|
MinimumBeatLength = 150;
|
2023-10-02 17:26:35 +08:00
|
|
|
|
2022-09-19 14:39:08 +08:00
|
|
|
Anchor = Anchor.Centre;
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
2023-09-20 11:48:15 +08:00
|
|
|
Size = OsuHitObject.OBJECT_DIMENSIONS;
|
2022-09-19 14:39:08 +08:00
|
|
|
|
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
{
|
2023-10-02 16:41:08 +08:00
|
|
|
main = new Container
|
2022-09-19 14:39:08 +08:00
|
|
|
{
|
2023-10-02 16:41:08 +08:00
|
|
|
RelativeSizeAxes = Axes.Both,
|
2022-09-19 14:39:08 +08:00
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
2023-10-02 16:41:08 +08:00
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
|
|
|
new Circle
|
|
|
|
{
|
|
|
|
Size = new Vector2(40, 20),
|
|
|
|
Colour = Color4.White,
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
},
|
|
|
|
icon = new SpriteIcon
|
|
|
|
{
|
|
|
|
Icon = FontAwesome.Solid.AngleDoubleRight,
|
|
|
|
Size = new Vector2(16),
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
},
|
|
|
|
}
|
2022-09-19 14:39:08 +08:00
|
|
|
},
|
2023-10-02 17:26:35 +08:00
|
|
|
side = new Sprite
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
Texture = textures.Get("Gameplay/osu/repeat-edge-piece"),
|
|
|
|
Size = new Vector2(ArgonMainCirclePiece.OUTER_GRADIENT_SIZE),
|
|
|
|
}
|
2022-09-19 14:39:08 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
accentColour = hitObject.AccentColour.GetBoundCopy();
|
2022-09-22 17:12:28 +08:00
|
|
|
accentColour.BindValueChanged(accent => icon.Colour = accent.NewValue.Darken(4), true);
|
2022-09-19 14:39:08 +08:00
|
|
|
}
|
2023-10-02 16:41:08 +08:00
|
|
|
|
|
|
|
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
|
|
|
|
{
|
|
|
|
if (!drawableRepeat.Judged)
|
2023-10-02 17:26:35 +08:00
|
|
|
{
|
2023-10-02 17:34:21 +08:00
|
|
|
main.ScaleTo(1.3f, timingPoint.BeatLength / 8, Easing.Out)
|
2023-10-02 17:26:35 +08:00
|
|
|
.Then()
|
|
|
|
.ScaleTo(1f, timingPoint.BeatLength / 2, Easing.Out);
|
|
|
|
side
|
2023-10-02 17:34:21 +08:00
|
|
|
.MoveToX(-12, timingPoint.BeatLength / 8, Easing.Out)
|
2023-10-02 17:26:35 +08:00
|
|
|
.Then()
|
|
|
|
.MoveToX(0, timingPoint.BeatLength / 2, Easing.Out);
|
|
|
|
}
|
2023-10-02 16:41:08 +08:00
|
|
|
}
|
2022-09-19 14:39:08 +08:00
|
|
|
}
|
|
|
|
}
|