Rename event to be more generic (and add comprehensive xmldoc)

This commit is contained in:
Dean Herbert
2022-09-13 14:59:30 +09:00
parent fd48249eef
commit f53507828c
2 changed files with 9 additions and 6 deletions

View File

@ -24,7 +24,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
{ {
base.LoadComplete(); base.LoadComplete();
editorBeatmap.SelectionBlueprintsShouldBeSorted += SortInternal; editorBeatmap.BeatmapReprocessed += SortInternal;
} }
public override void Add(SelectionBlueprint<HitObject> drawable) public override void Add(SelectionBlueprint<HitObject> drawable)
@ -70,7 +70,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
base.Dispose(isDisposing); base.Dispose(isDisposing);
if (editorBeatmap != null) if (editorBeatmap != null)
editorBeatmap.SelectionBlueprintsShouldBeSorted -= SortInternal; editorBeatmap.BeatmapReprocessed -= SortInternal;
} }
} }
} }

View File

@ -49,9 +49,13 @@ namespace osu.Game.Screens.Edit
public event Action<HitObject> HitObjectUpdated; public event Action<HitObject> HitObjectUpdated;
/// <summary> /// <summary>
/// Invoked after <see cref="HitObjects"/> is updated during <see cref="UpdateState"/> and blueprints need to be sorted immediately to prevent a crash. /// Invoked after any state changes occurred which triggered a beatmap reprocess via an <see cref="IBeatmapProcessor"/>.
/// </summary> /// </summary>
public event Action SelectionBlueprintsShouldBeSorted; /// <remarks>
/// Beatmap processing may change the order of hitobjects. This event gives external components a chance to handle any changes
/// not covered by the <see cref="HitObjectAdded"/> / <see cref="HitObjectUpdated"/> / <see cref="HitObjectRemoved"/> events.
/// </remarks>
public event Action BeatmapReprocessed;
/// <summary> /// <summary>
/// All currently selected <see cref="HitObject"/>s. /// All currently selected <see cref="HitObject"/>s.
@ -336,8 +340,7 @@ 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 BeatmapReprocessed?.Invoke();
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();