mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 11:42:56 +08:00
Merge pull request #10257 from hbnrmx/legacy-SpinnerNoBlink
Add support for SpinnerNoBlink to LegacyOldStyleSpinner
This commit is contained in:
commit
c93d1631d4
@ -24,12 +24,16 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
private Sprite metreSprite;
|
||||
private Container metre;
|
||||
|
||||
private bool spinnerBlink;
|
||||
|
||||
private const float sprite_scale = 1 / 1.6f;
|
||||
private const float final_metre_height = 692 * sprite_scale;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(ISkinSource source, DrawableHitObject drawableObject)
|
||||
{
|
||||
spinnerBlink = source.GetConfig<OsuSkinConfiguration, bool>(OsuSkinConfiguration.SpinnerNoBlink)?.Value != true;
|
||||
|
||||
drawableSpinner = (DrawableSpinner)drawableObject;
|
||||
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
@ -116,12 +120,15 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
|
||||
private float getMetreHeight(float progress)
|
||||
{
|
||||
progress = Math.Min(99, progress * 100);
|
||||
progress *= 100;
|
||||
|
||||
// the spinner should still blink at 100% progress.
|
||||
if (spinnerBlink)
|
||||
progress = Math.Min(99, progress);
|
||||
|
||||
int barCount = (int)progress / 10;
|
||||
|
||||
// todo: add SpinnerNoBlink support
|
||||
if (RNG.NextBool(((int)progress % 10) / 10f))
|
||||
if (spinnerBlink && RNG.NextBool(((int)progress % 10) / 10f))
|
||||
barCount++;
|
||||
|
||||
return (float)barCount / total_bars * final_metre_height;
|
||||
|
@ -14,6 +14,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
CursorRotate,
|
||||
HitCircleOverlayAboveNumber,
|
||||
HitCircleOverlayAboveNumer, // Some old skins will have this typo
|
||||
SpinnerFrequencyModulate
|
||||
SpinnerFrequencyModulate,
|
||||
SpinnerNoBlink
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Skinning
|
||||
ComboPrefix,
|
||||
ComboOverlap,
|
||||
AnimationFramerate,
|
||||
LayeredHitSounds,
|
||||
LayeredHitSounds
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user