Simplify implementation

This commit is contained in:
Dean Herbert 2024-02-25 00:12:20 +08:00
parent 2696620d12
commit 824d671cce
No known key found for this signature in database
2 changed files with 2 additions and 12 deletions

View File

@ -122,14 +122,9 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
private void updateSpmAlpha()
{
if (drawableSpinner.Result?.TimeStarted is double startTime)
{
double timeOffset = Math.Clamp(Clock.CurrentTime, startTime, startTime + drawableSpinner.HitObject.TimeFadeIn) - startTime;
spmContainer.Alpha = (float)(timeOffset / drawableSpinner.HitObject.TimeFadeIn);
}
spmContainer.Alpha = (float)Math.Clamp((Clock.CurrentTime - startTime) / drawableSpinner.HitObject.TimeFadeIn, 0, 1);
else
{
spmContainer.Alpha = 0;
}
}
}
}

View File

@ -128,14 +128,9 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
private void updateSpmAlpha()
{
if (drawableSpinner.Result?.TimeStarted is double startTime)
{
double timeOffset = Math.Clamp(Clock.CurrentTime, startTime, startTime + drawableSpinner.HitObject.TimeFadeIn) - startTime;
spmContainer.Alpha = (float)(timeOffset / drawableSpinner.HitObject.TimeFadeIn);
}
spmContainer.Alpha = (float)Math.Clamp((Clock.CurrentTime - startTime) / drawableSpinner.HitObject.TimeFadeIn, 0, 1);
else
{
spmContainer.Alpha = 0;
}
}
}
}