1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-16 14:22:54 +08:00

Rename and split up statement to make more legible

This commit is contained in:
Dean Herbert 2020-07-31 09:03:29 +09:00
parent ec0d7760af
commit 8e49256a5c

View File

@ -29,7 +29,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
private SpinnerTicks ticks; private SpinnerTicks ticks;
private int completeTick; private int wholeRotationCount;
private SpinnerFill fill; private SpinnerFill fill;
private Container mainContainer; private Container mainContainer;
private SpinnerCentreLayer centre; private SpinnerCentreLayer centre;
@ -145,13 +146,24 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
centre.FadeAccent(colour, duration); centre.FadeAccent(colour, duration);
} }
private bool updateCompleteTick() => completeTick != (completeTick = (int)(drawableSpinner.RotationTracker.CumulativeRotation / 360)); private bool checkNewRotationCount
{
get
{
int rotations = (int)(drawableSpinner.RotationTracker.CumulativeRotation / 360);
if (wholeRotationCount == rotations) return false;
wholeRotationCount = rotations;
return true;
}
}
protected override void Update() protected override void Update()
{ {
base.Update(); base.Update();
if (drawableSpinner.RotationTracker.Complete.Value && updateCompleteTick()) if (drawableSpinner.RotationTracker.Complete.Value && checkNewRotationCount)
{ {
fill.FinishTransforms(false, nameof(Alpha)); fill.FinishTransforms(false, nameof(Alpha));
fill fill