mirror of
https://github.com/ppy/osu
synced 2024-12-15 11:25:29 +00:00
fix with new event
This commit is contained in:
parent
a1f4724685
commit
fd48249eef
@ -24,11 +24,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
editorBeatmap.HitObjectUpdated += hitObjectUpdated;
|
editorBeatmap.SelectionBlueprintsShouldBeSorted += SortInternal;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void hitObjectUpdated(HitObject _) => SortInternal();
|
|
||||||
|
|
||||||
public override void Add(SelectionBlueprint<HitObject> drawable)
|
public override void Add(SelectionBlueprint<HitObject> drawable)
|
||||||
{
|
{
|
||||||
SortInternal();
|
SortInternal();
|
||||||
@ -72,7 +70,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
|
|
||||||
if (editorBeatmap != null)
|
if (editorBeatmap != null)
|
||||||
editorBeatmap.HitObjectUpdated -= hitObjectUpdated;
|
editorBeatmap.SelectionBlueprintsShouldBeSorted -= SortInternal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,11 @@ namespace osu.Game.Screens.Edit
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action<HitObject> HitObjectUpdated;
|
public event Action<HitObject> HitObjectUpdated;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Invoked after <see cref="HitObjects"/> is updated during <see cref="UpdateState"/> and blueprints need to be sorted immediately to prevent a crash.
|
||||||
|
/// </summary>
|
||||||
|
public event Action SelectionBlueprintsShouldBeSorted;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// All currently selected <see cref="HitObject"/>s.
|
/// All currently selected <see cref="HitObject"/>s.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -331,6 +336,9 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
beatmapProcessor?.PostProcess();
|
beatmapProcessor?.PostProcess();
|
||||||
|
|
||||||
|
// Signal selection blueprint sorting because it is possible that the beatmap processor changed the order of the selection blueprints
|
||||||
|
SelectionBlueprintsShouldBeSorted?.Invoke();
|
||||||
|
|
||||||
// callbacks may modify the lists so let's be safe about it
|
// callbacks may modify the lists so let's be safe about it
|
||||||
var deletes = batchPendingDeletes.ToArray();
|
var deletes = batchPendingDeletes.ToArray();
|
||||||
batchPendingDeletes.Clear();
|
batchPendingDeletes.Clear();
|
||||||
|
Loading…
Reference in New Issue
Block a user