Merging sliders causes new objects to become invisible
Type
Game behaviour
Bug description
Using the editor, make two sliders, select both, then select "merge selection" - this sometimes creates an error where new objects become invisible, and existing objects can seemingly not be deleted. Saving the map and entering the editor makes the invisible objects appear.
Screenshots or videos
https://github.com/ppy/osu/assets/63306696/86d982b7-6fc5-46ba-9851-6fd0e1c75d03
Version
2024.130.2-lazer
Logs
I am currently looking into this.
I am currently looking into this.
Are you still looking into this? I would like to fix it.
I am currently looking into this.
Are you still looking into this? I would like to fix it.
I'd go ahead, it's been over a month.
Please do, I'm not working on it
I can't reproduce exactly like the video above (sliders with the same StartTime but different EndTime), maybe something changed in the code since, but having 2 exact equal sliders at the same StartTime and EndTime triggered this error for me.
Relevant Log:
2024-01-31 02:46:51 [error]: An unhandled error has occurred.
2024-01-31 02:46:51 [error]: System.InvalidOperationException: Can not change depth of drawable which is not contained within this CompositeDrawable.
2024-01-31 02:46:51 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.ChangeInternalChildDepth(Drawable child, Single newDepth)
2024-01-31 02:46:51 [error]: at osu.Game.Screens.Edit.Compose.Components.EditorBlueprintContainer.OnBlueprintDeselected(SelectionBlueprint`1 blueprint)
The exception is thrown by first line of this method:
protected virtual void OnBlueprintDeselected(SelectionBlueprint<T> blueprint)
{
SelectionBlueprints.ChangeChildDepth(blueprint, 0);
SelectionHandler.HandleDeselected(blueprint);
}
It seems the merge is trying to deselect the merged slider after deleting the slider (?), i still need to take a deeper look in that part.
At the moment simply checking if blueprint exists before changing its depth seems to work and doesn't brake anything. But idk how to feel about this.
Also being unable to add objects after the merge seems to just be a side effect of a unhandled exception in the editor.
I am starting to think this may be a framework issue, my other fix to this was to check in the merge method if there was any slider at the same start time of the first one and increment it so they would differ from each other and them re-order them again by StartTime. That fixed the issue, but when i tried to do the same with 3 sliders the problem appeared again, for some reason even if the third slider is not selected it still crashes the game as you can see in the video below, this is what makes me think it is a framework problem.
https://github.com/ppy/osu/assets/90941580/c27e7d26-f86c-4f83-9722-88d67cd8edce
As you cant see the amount of selected objects right before it crashes because of the stacktrace there it is: