1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 16:37:26 +08:00

Use DI instead

This commit is contained in:
Endrik Tombak 2020-04-05 13:36:52 +03:00
parent 1f6a4fa4b8
commit a3626333be
2 changed files with 6 additions and 4 deletions

View File

@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
private double animDuration; private double animDuration;
private readonly ReverseArrowPiece scaleContainer; private readonly Drawable scaleContainer;
public DrawableSliderRepeat(SliderRepeat sliderRepeat, DrawableSlider drawableSlider) public DrawableSliderRepeat(SliderRepeat sliderRepeat, DrawableSlider drawableSlider)
: base(sliderRepeat) : base(sliderRepeat)
@ -80,7 +80,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
case ArmedState.Hit: case ArmedState.Hit:
this.FadeOut(animDuration, Easing.Out) this.FadeOut(animDuration, Easing.Out)
.ScaleTo(Scale * 1.5f, animDuration, Easing.Out); .ScaleTo(Scale * 1.5f, animDuration, Easing.Out);
scaleContainer.ShouldFollowBeats = false;
scaleContainer.Transforms.ForEach(t => scaleContainer.RemoveTransform(t)); scaleContainer.Transforms.ForEach(t => scaleContainer.RemoveTransform(t));
break; break;
} }

View File

@ -8,12 +8,15 @@ using osu.Framework.Graphics.Sprites;
using osu.Game.Beatmaps.ControlPoints; using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Skinning; using osu.Game.Skinning;
using osu.Framework.Allocation;
using osu.Game.Rulesets.Objects.Drawables;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{ {
public class ReverseArrowPiece : BeatSyncedContainer public class ReverseArrowPiece : BeatSyncedContainer
{ {
public bool ShouldFollowBeats = true; [Resolved]
private DrawableHitObject drawableSlider { get; set; }
public ReverseArrowPiece() public ReverseArrowPiece()
{ {
@ -41,7 +44,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes) protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
{ {
if (ShouldFollowBeats) if (!drawableSlider.IsHit)
Child.ScaleTo(1.3f).ScaleTo(1f, timingPoint.BeatLength, Easing.Out); Child.ScaleTo(1.3f).ScaleTo(1f, timingPoint.BeatLength, Easing.Out);
} }
} }