Fix catch distance snap grid not moving

Regressed in https://github.com/ppy/osu/pull/25154.
Specifically, in 013b5fa916
and 74b86349d5.

A simple case of too-much-code-deleted-itis.
This commit is contained in:
Bartłomiej Dach 2023-10-26 15:40:46 +02:00
parent 5e059a362f
commit 359ae31204
No known key found for this signature in database

View File

@ -10,6 +10,7 @@ using osu.Framework.Graphics;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Game.Beatmaps;
using osu.Game.Graphics.UserInterface;
using osu.Game.Input.Bindings;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.UI;
@ -179,5 +180,33 @@ namespace osu.Game.Rulesets.Catch.Edit
return null;
}
}
protected override void Update()
{
base.Update();
updateDistanceSnapGrid();
}
private void updateDistanceSnapGrid()
{
if (DistanceSnapProvider.DistanceSnapToggle.Value != TernaryState.True)
{
distanceSnapGrid.Hide();
return;
}
var sourceHitObject = getDistanceSnapGridSourceHitObject();
if (sourceHitObject == null)
{
distanceSnapGrid.Hide();
return;
}
distanceSnapGrid.Show();
distanceSnapGrid.StartTime = sourceHitObject.GetEndTime();
distanceSnapGrid.StartX = sourceHitObject.EffectiveX;
}
}
}