1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:07:52 +08:00

Disable snaking out when tracking is disabled

This commit is contained in:
smoogipoo 2021-02-05 15:56:13 +09:00
parent 6aece18f8d
commit 3aa3692ed4
3 changed files with 23 additions and 3 deletions

View File

@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
{
base.Update();
CirclePiece.UpdateFrom(position == SliderPosition.Start ? HitObject.HeadCircle : HitObject.TailCircle);
CirclePiece.UpdateFrom(position == SliderPosition.Start ? (HitCircle)HitObject.HeadCircle : HitObject.TailCircle);
}
// Todo: This is temporary, since the slider circle masks don't do anything special yet. In the future they will handle input.

View File

@ -121,7 +121,7 @@ namespace osu.Game.Rulesets.Osu.Objects
public bool IgnoreJudgement = true;
[JsonIgnore]
public HitCircle HeadCircle { get; protected set; }
public SliderHeadCircle HeadCircle { get; protected set; }
[JsonIgnore]
public SliderTailCircle TailCircle { get; protected set; }

View File

@ -21,6 +21,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
[Resolved(CanBeNull = true)]
private OsuRulesetConfigManager config { get; set; }
private readonly Bindable<bool> snakingOut = new Bindable<bool>();
[BackgroundDependencyLoader]
private void load(ISkinSource skin, DrawableHitObject drawableObject)
{
@ -35,11 +37,29 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
accentColour = drawableObject.AccentColour.GetBoundCopy();
accentColour.BindValueChanged(accent => updateAccentColour(skin, accent.NewValue), true);
SnakingOut.BindTo(snakingOut);
config?.BindWith(OsuRulesetSetting.SnakingInSliders, SnakingIn);
config?.BindWith(OsuRulesetSetting.SnakingOutSliders, SnakingOut);
config?.BindWith(OsuRulesetSetting.SnakingOutSliders, snakingOut);
BorderSize = skin.GetConfig<OsuSkinConfiguration, float>(OsuSkinConfiguration.SliderBorderSize)?.Value ?? 1;
BorderColour = skin.GetConfig<OsuSkinColour, Color4>(OsuSkinColour.SliderBorder)?.Value ?? Color4.White;
drawableObject.HitObjectApplied += onHitObjectApplied;
onHitObjectApplied(drawableObject);
}
private void onHitObjectApplied(DrawableHitObject obj)
{
var drawableSlider = (DrawableSlider)obj;
if (drawableSlider.HitObject == null)
return;
if (!drawableSlider.HitObject.HeadCircle.TrackFollowCircle)
{
// When not tracking the follow circle, force the path to not snake out as it looks better that way.
SnakingOut.UnbindFrom(snakingOut);
SnakingOut.Value = false;
}
}
private void updateAccentColour(ISkinSource skin, Color4 defaultAccentColour)