1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 17:32:54 +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>
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);
}
/// <summary>