1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 08:22:56 +08:00

Remove secondary schedule logic

This commit is contained in:
Dean Herbert 2020-09-12 21:20:37 +09:00
parent 81f30cd264
commit 3854caae9b

View File

@ -77,7 +77,7 @@ namespace osu.Game.Screens.Edit
/// <param name="hitObject">The <see cref="HitObject"/> to update.</param> /// <param name="hitObject">The <see cref="HitObject"/> to update.</param>
public void UpdateHitObject([NotNull] HitObject hitObject) => updateHitObject(hitObject, false); 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) if (hitObject != null)
pendingUpdates.Add(hitObject); pendingUpdates.Add(hitObject);
@ -93,6 +93,12 @@ namespace osu.Game.Screens.Edit
beatmapProcessor?.PostProcess(); beatmapProcessor?.PostProcess();
if (performAdd)
{
foreach (var obj in pendingUpdates)
HitObjectAdded?.Invoke(obj);
}
if (!silent) if (!silent)
{ {
foreach (var obj in pendingUpdates) foreach (var obj in pendingUpdates)
@ -158,14 +164,8 @@ namespace osu.Game.Screens.Edit
{ {
trackStartTime(hitObject); trackStartTime(hitObject);
updateHitObject(hitObject, true); mutableHitObjects.Insert(index, hitObject);
updateHitObject(hitObject, true, true);
// must occur after the batch-scheduled ApplyDefaults.
Schedule(() =>
{
mutableHitObjects.Insert(index, hitObject);
HitObjectAdded?.Invoke(hitObject);
});
} }
/// <summary> /// <summary>