From 359ae3120494d0b9d3b61599d6f50f5abe0330ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 26 Oct 2023 15:40:46 +0200 Subject: [PATCH] Fix catch distance snap grid not moving Regressed in https://github.com/ppy/osu/pull/25154. Specifically, in 013b5fa916d819ec7a8a93b1692d4aa027934a67 and 74b86349d58e5169e52bbdc70cef3dec81579a74. A simple case of too-much-code-deleted-itis. --- .../Edit/CatchHitObjectComposer.cs | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/osu.Game.Rulesets.Catch/Edit/CatchHitObjectComposer.cs b/osu.Game.Rulesets.Catch/Edit/CatchHitObjectComposer.cs index 6f0ee260ab..4172720ada 100644 --- a/osu.Game.Rulesets.Catch/Edit/CatchHitObjectComposer.cs +++ b/osu.Game.Rulesets.Catch/Edit/CatchHitObjectComposer.cs @@ -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; + } } }