mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 21:02:54 +08:00
Stop beat syncing (and close match stable's implementation of arrow animation)
This commit is contained in:
parent
ad4e988520
commit
8010410487
@ -2,7 +2,6 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio.Track;
|
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -10,8 +9,6 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
|
||||||
using osu.Game.Graphics.Containers;
|
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -19,24 +16,20 @@ using osuTK.Graphics;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
||||||
{
|
{
|
||||||
public partial class ArgonReverseArrow : BeatSyncedContainer
|
public partial class ArgonReverseArrow : CompositeDrawable
|
||||||
{
|
{
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private DrawableHitObject drawableRepeat { get; set; } = null!;
|
private DrawableHitObject drawableObject { get; set; } = null!;
|
||||||
|
|
||||||
private Bindable<Color4> accentColour = null!;
|
private Bindable<Color4> accentColour = null!;
|
||||||
|
|
||||||
private SpriteIcon icon = null!;
|
private SpriteIcon icon = null!;
|
||||||
|
|
||||||
private Container main = null!;
|
private Container main = null!;
|
||||||
private Sprite side = null!;
|
private Sprite side = null!;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(TextureStore textures, DrawableHitObject hitObject)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
Divisor = 2;
|
|
||||||
MinimumBeatLength = 150;
|
|
||||||
|
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
@ -76,22 +69,39 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
accentColour = hitObject.AccentColour.GetBoundCopy();
|
accentColour = drawableObject.AccentColour.GetBoundCopy();
|
||||||
accentColour.BindValueChanged(accent => icon.Colour = accent.NewValue.Darken(4), true);
|
accentColour.BindValueChanged(accent => icon.Colour = accent.NewValue.Darken(4), true);
|
||||||
|
|
||||||
|
drawableObject.ApplyCustomUpdateState += updateStateTransforms;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
|
private void updateStateTransforms(DrawableHitObject hitObject, ArmedState state)
|
||||||
{
|
{
|
||||||
if (!drawableRepeat.Judged)
|
const float move_distance = -12;
|
||||||
|
const double move_out_duration = 35;
|
||||||
|
const double move_in_duration = 250;
|
||||||
|
const double total = 300;
|
||||||
|
|
||||||
|
switch (state)
|
||||||
{
|
{
|
||||||
main.ScaleTo(1.3f, timingPoint.BeatLength / 8, Easing.Out)
|
case ArmedState.Idle:
|
||||||
|
main.ScaleTo(1.3f, move_out_duration, Easing.Out)
|
||||||
.Then()
|
.Then()
|
||||||
.ScaleTo(1f, timingPoint.BeatLength / 2, Easing.Out);
|
.ScaleTo(1f, move_in_duration, Easing.Out)
|
||||||
|
.Loop(total - (move_in_duration + move_out_duration));
|
||||||
side
|
side
|
||||||
.MoveToX(-12, timingPoint.BeatLength / 8, Easing.Out)
|
.MoveToX(move_distance, move_out_duration, Easing.Out)
|
||||||
.Then()
|
.Then()
|
||||||
.MoveToX(0, timingPoint.BeatLength / 2, Easing.Out);
|
.MoveToX(0, move_in_duration, Easing.Out)
|
||||||
|
.Loop(total - (move_in_duration + move_out_duration));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
base.Dispose(isDisposing);
|
||||||
|
drawableObject.ApplyCustomUpdateState -= updateStateTransforms;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user