From 3854caae9b0a6df9ba6599960a0a02fade064ae5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 12 Sep 2020 21:20:37 +0900 Subject: [PATCH] Remove secondary schedule logic --- osu.Game/Screens/Edit/EditorBeatmap.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/osu.Game/Screens/Edit/EditorBeatmap.cs b/osu.Game/Screens/Edit/EditorBeatmap.cs index fd5270653d..5272530228 100644 --- a/osu.Game/Screens/Edit/EditorBeatmap.cs +++ b/osu.Game/Screens/Edit/EditorBeatmap.cs @@ -77,7 +77,7 @@ namespace osu.Game.Screens.Edit /// The to update. public void UpdateHitObject([NotNull] HitObject hitObject) => updateHitObject(hitObject, false); - private void updateHitObject([CanBeNull] HitObject hitObject, bool silent) + private void updateHitObject([CanBeNull] HitObject hitObject, bool silent, bool performAdd = false) { if (hitObject != null) pendingUpdates.Add(hitObject); @@ -93,6 +93,12 @@ namespace osu.Game.Screens.Edit beatmapProcessor?.PostProcess(); + if (performAdd) + { + foreach (var obj in pendingUpdates) + HitObjectAdded?.Invoke(obj); + } + if (!silent) { foreach (var obj in pendingUpdates) @@ -158,14 +164,8 @@ namespace osu.Game.Screens.Edit { trackStartTime(hitObject); - updateHitObject(hitObject, true); - - // must occur after the batch-scheduled ApplyDefaults. - Schedule(() => - { - mutableHitObjects.Insert(index, hitObject); - HitObjectAdded?.Invoke(hitObject); - }); + mutableHitObjects.Insert(index, hitObject); + updateHitObject(hitObject, true, true); } ///