mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Fix potential blueprint nullrefs with the new structure
This commit is contained in:
@ -123,12 +123,20 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
if (blueprint == null)
|
||||
return;
|
||||
|
||||
blueprint.Selected += onBlueprintSelected;
|
||||
blueprint.Deselected += onBlueprintDeselected;
|
||||
blueprint.SelectionRequested += onSelectionRequested;
|
||||
blueprint.DragRequested += onDragRequested;
|
||||
if (hitObject.IsLoaded)
|
||||
addBlueprint();
|
||||
else
|
||||
hitObject.OnLoadComplete += _ => addBlueprint();
|
||||
|
||||
selectionBlueprints.Add(blueprint);
|
||||
void addBlueprint()
|
||||
{
|
||||
blueprint.Selected += onBlueprintSelected;
|
||||
blueprint.Deselected += onBlueprintDeselected;
|
||||
blueprint.SelectionRequested += onSelectionRequested;
|
||||
blueprint.DragRequested += onDragRequested;
|
||||
|
||||
selectionBlueprints.Add(blueprint);
|
||||
}
|
||||
}
|
||||
|
||||
private void removeBlueprintFor(DrawableHitObject hitObject) => removeBlueprintFor(hitObject.HitObject);
|
||||
|
Reference in New Issue
Block a user