1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Fix so it reacts to PathVersion with Scheduler

This commit is contained in:
OliBomby 2024-01-13 12:50:39 +01:00
parent e1186080b8
commit fca9b1f536
2 changed files with 10 additions and 2 deletions

View File

@ -244,7 +244,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
else if (slidingSample.IsPlaying)
slidingSample.Stop();
}
}
protected override void UpdateAfterChildren()
{
base.UpdateAfterChildren();
// It's important that this is done in UpdateAfterChildren so that the SliderBody has a chance to update its Size and PathOffset on Update.
double completionProgress = Math.Clamp((Time.Current - HitObject.StartTime) / HitObject.Duration, 0, 1);
Ball.UpdateProgress(completionProgress);

View File

@ -18,6 +18,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
protected IBindable<Color4> AccentColourBindable { get; private set; } = null!;
private IBindable<int> pathVersion = null!;
[Resolved(CanBeNull = true)]
private OsuRulesetConfigManager? config { get; set; }
@ -31,8 +33,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
ScaleBindable = drawableSlider.ScaleBindable.GetBoundCopy();
ScaleBindable.BindValueChanged(scale => PathRadius = OsuHitObject.OBJECT_RADIUS * scale.NewValue, true);
drawableObject.DefaultsApplied += _ => Refresh();
drawableObject.HitObjectApplied += _ => Refresh();
pathVersion = drawableSlider.PathVersion.GetBoundCopy();
pathVersion.BindValueChanged(_ => Scheduler.AddOnce(Refresh));
AccentColourBindable = drawableObject.AccentColour.GetBoundCopy();
AccentColourBindable.BindValueChanged(accent => AccentColour = GetBodyAccentColour(skin, accent.NewValue), true);