mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 06:13:04 +08:00
Further simplify non-transactional change logic
This commit is contained in:
parent
3114174e09
commit
4ccd751604
@ -131,18 +131,9 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
mutableHitObjects.Insert(index, hitObject);
|
mutableHitObjects.Insert(index, hitObject);
|
||||||
|
|
||||||
if (TransactionActive)
|
BeginChange();
|
||||||
batchPendingInserts.Add(hitObject);
|
batchPendingInserts.Add(hitObject);
|
||||||
else
|
EndChange();
|
||||||
{
|
|
||||||
// must be run after any change to hitobject ordering
|
|
||||||
beatmapProcessor?.PreProcess();
|
|
||||||
processHitObject(hitObject);
|
|
||||||
beatmapProcessor?.PostProcess();
|
|
||||||
|
|
||||||
HitObjectAdded?.Invoke(hitObject);
|
|
||||||
SaveState();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -213,18 +204,9 @@ namespace osu.Game.Screens.Edit
|
|||||||
bindable.UnbindAll();
|
bindable.UnbindAll();
|
||||||
startTimeBindables.Remove(hitObject);
|
startTimeBindables.Remove(hitObject);
|
||||||
|
|
||||||
if (TransactionActive)
|
BeginChange();
|
||||||
batchPendingDeletes.Add(hitObject);
|
batchPendingDeletes.Add(hitObject);
|
||||||
else
|
EndChange();
|
||||||
{
|
|
||||||
// must be run after any change to hitobject ordering
|
|
||||||
beatmapProcessor?.PreProcess();
|
|
||||||
processHitObject(hitObject);
|
|
||||||
beatmapProcessor?.PostProcess();
|
|
||||||
|
|
||||||
HitObjectRemoved?.Invoke(hitObject);
|
|
||||||
SaveState();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
Loading…
Reference in New Issue
Block a user