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

Merge branch 'nested-hitobject-pooling' into osu-hitobject-pooling

This commit is contained in:
smoogipoo 2020-11-12 18:10:34 +09:00
commit 57ca192c8e

View File

@ -57,6 +57,14 @@ namespace osu.Game.Rulesets.UI
lifetimeManager.EntryBecameDead += entryBecameDead;
}
protected override void LoadAsyncComplete()
{
base.LoadAsyncComplete();
// Application of hitobjects during load() may have changed their start times, so ensure the correct sorting order.
SortInternal();
}
#region Pooling support
public void Add(HitObjectLifetimeEntry entry) => lifetimeManager.AddEntry(entry);
@ -163,7 +171,12 @@ namespace osu.Game.Rulesets.UI
private void bindStartTime(DrawableHitObject hitObject)
{
var bindable = hitObject.StartTimeBindable.GetBoundCopy();
bindable.BindValueChanged(_ => SortInternal());
bindable.BindValueChanged(_ =>
{
if (LoadState >= LoadState.Ready)
SortInternal();
});
startTimeMap[hitObject] = bindable;
}