From 96769897bfbbf7551dbd5ee04fd89e98936819b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marvin=20Sch=C3=BCrz?= Date: Fri, 11 Oct 2024 11:38:32 +0200 Subject: [PATCH] Extract method for scheduler call --- osu.Game.Rulesets.Osu/Edit/PolygonGenerationPopover.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/PolygonGenerationPopover.cs b/osu.Game.Rulesets.Osu/Edit/PolygonGenerationPopover.cs index c46e2650bc..91a8d56fc1 100644 --- a/osu.Game.Rulesets.Osu/Edit/PolygonGenerationPopover.cs +++ b/osu.Game.Rulesets.Osu/Edit/PolygonGenerationPopover.cs @@ -118,13 +118,15 @@ protected override void LoadComplete() changeHandler?.BeginChange(); began = true; - distanceSnapInput.Current.BindValueChanged(_ => Scheduler.AddOnce(tryCreatePolygon)); - offsetAngleInput.Current.BindValueChanged(_ => Scheduler.AddOnce(tryCreatePolygon)); - repeatCountInput.Current.BindValueChanged(_ => Scheduler.AddOnce(tryCreatePolygon)); - pointInput.Current.BindValueChanged(_ => Scheduler.AddOnce(tryCreatePolygon)); + distanceSnapInput.Current.BindValueChanged(_ => scheduleRefresh()); + offsetAngleInput.Current.BindValueChanged(_ => scheduleRefresh()); + repeatCountInput.Current.BindValueChanged(_ => scheduleRefresh()); + pointInput.Current.BindValueChanged(_ => scheduleRefresh()); tryCreatePolygon(); } + private void scheduleRefresh() => Scheduler.AddOnce(tryCreatePolygon); + private void tryCreatePolygon() { double startTime = beatSnapProvider.SnapTime(editorClock.CurrentTime);