Fix catch distance snap provider not hiding slider properly

Regressed in https://github.com/ppy/osu/pull/25171.

The old code was kinda dependent on correct order of setting `Disabled`.
`CatchHitObjectComposer` would disable distance spacing in its BDL, and
then via the base `DistancedHitObjectComposer.LoadComplete()`, the
slider would be faded out. The switch to composition broke that
ordering.

To fix, stop relying on ordering and just respond to changes as they
come. That's what bindables are for.
This commit is contained in:
Bartłomiej Dach 2023-10-26 15:46:32 +02:00
parent 359ae31204
commit 79910df959
No known key found for this signature in database
1 changed files with 2 additions and 6 deletions

View File

@ -98,12 +98,6 @@ public void AttachToToolbox(ExpandingToolboxContainer toolboxContainer)
}
});
if (DistanceSpacingMultiplier.Disabled)
{
distanceSpacingSlider.Hide();
return;
}
DistanceSpacingMultiplier.Value = editorBeatmap.BeatmapInfo.DistanceSpacing;
DistanceSpacingMultiplier.BindValueChanged(multiplier =>
{
@ -116,6 +110,8 @@ public void AttachToToolbox(ExpandingToolboxContainer toolboxContainer)
editorBeatmap.BeatmapInfo.DistanceSpacing = multiplier.NewValue;
}, true);
DistanceSpacingMultiplier.BindDisabledChanged(disabled => distanceSpacingSlider.Alpha = disabled ? 0 : 1, true);
// Manual binding to handle enabling distance spacing when the slider is interacted with.
distanceSpacingSlider.Current.BindValueChanged(spacing =>
{