gilzoide / godot-dockable-container

Dockable/tiling UI panels Container addon for Godot
Creative Commons Zero v1.0 Universal
186 stars 19 forks source link

Refactor layout node classes to be RefCounted instead of sub-resources #25

Open gilzoide opened 10 months ago

gilzoide commented 10 months ago

This PR refactors layout node classes (DockableLayoutNode, DockableLayoutPanel and DockableLayoutSplit) to inherit from RefCounted instead of Resource. This makes all layout data concentrated in a single resource, avoiding sub-resources. Also, it doesn't make much sense for node classes to be standalone resources, they must live in a layout to be useful. For serialization to work, there is a new serialized_data property that serializes this tree to/from a Dictionary.

Note: this is a breaking change, previously serialized DockableLayout resources will be reset, since the new data is not compatible with previous one.