Close expanded tile editor when inspector updates #95034
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TileSet editor has an internal inspector that really likes getting refreshed. One instance is when you select another tile, another is when a polygon is added or removed:
godot/scene/resources/2d/tile_set.cpp
Line 6271 in 3978628
This causes all property editors to get destroyed and re-created.
There is one special editor though - the expanded editor. When you expand polygon editor (see #79512), it's moved to a different parent that isn't inside the inspector. So when inspector is cleared, the expanded editor survives it and holds outdated information.
I don't have a good solution for that yet. Perfectly, when inspector is refreshed, the previous editor should be automatically expanded again. However the "previous" editor no longer exists and there can be multiple polygon editors, so it has to be somehow remembered per-property, idk.
For now I just force-close the editor when it's going to become invalid.
godot.windows.editor.dev.x86_64_wcdUtQLTWn.mp4
It's a safe fix that could be applied for now.
Closes #84321
Closes #86720
Opens #95XXX (the new behavior is disrupting, so an issue should be opened if this is merged)