1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:07:25 +08:00

Fix test failures due to on-the-fly starttime changes

This commit is contained in:
smoogipoo 2020-11-12 16:58:40 +09:00
parent 974390bda7
commit cf91962865

View File

@ -57,6 +57,14 @@ namespace osu.Game.Rulesets.UI
lifetimeManager.EntryBecameDead += entryBecameDead;
}
protected override void LoadComplete()
{
base.LoadComplete();
// Application of hitobject 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 (IsLoaded)
SortInternal();
});
startTimeMap[hitObject] = bindable;
}