1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 08:02:55 +08:00

Add SpinnerFrequencyModulate skin config option

This commit is contained in:
Ron B 2020-08-15 20:12:06 +03:00
parent bffdb73624
commit 5c11270b98
No known key found for this signature in database
GPG Key ID: 6F5B32DE5E5FA80C
2 changed files with 8 additions and 4 deletions

View File

@ -12,6 +12,7 @@ using osu.Game.Graphics;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
using osu.Game.Rulesets.Osu.Skinning;
using osu.Game.Rulesets.Scoring;
using osu.Game.Screens.Ranking;
using osu.Game.Skinning;
@ -31,6 +32,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
private readonly IBindable<Vector2> positionBindable = new Bindable<Vector2>();
private bool spinnerFrequencyModulate;
public DrawableSpinner(Spinner s)
: base(s)
{
@ -165,10 +168,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
private void load(OsuColour colours, ISkinSource skin)
{
positionBindable.BindValueChanged(pos => Position = pos.NewValue);
positionBindable.BindTo(HitObject.PositionBindable);
spinnerFrequencyModulate = skin.GetConfig<OsuSkinConfiguration, bool>(OsuSkinConfiguration.SpinnerFrequencyModulate)?.Value ?? true;
}
/// <summary>
@ -221,8 +225,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
RotationTracker.Tracking = !Result.HasResult && (OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false);
if (spinningSample != null)
// todo: implement SpinnerFrequencyModulate
spinningSample.Frequency.Value = 0.5f + Progress;
spinningSample.Frequency.Value = spinnerFrequencyModulate ? 0.5f + Progress : 0.5f;
}
protected override void UpdateAfterChildren()

View File

@ -13,6 +13,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
CursorExpand,
CursorRotate,
HitCircleOverlayAboveNumber,
HitCircleOverlayAboveNumer // Some old skins will have this typo
HitCircleOverlayAboveNumer, // Some old skins will have this typo
SpinnerFrequencyModulate
}
}