godot icon indicating copy to clipboard operation
godot copied to clipboard

Non-editable status is not preserved on custom types inheriting from other custom types

Open addmix opened this issue 2 years ago • 2 comments

Godot version

4.0 beta 15

System information

Windows 10

Issue description

When you have a plugin with multiple custom types, and one of them inherits another, the second-level custom type's non-editable status is not preserved. image In this case we would expect both A and B to have protected types, but in this case B's type is not protected.

Steps to reproduce

Create a plugin. Create two scripts, one A is the base level script, and B to inherit from A. Create a new plugin, add both as custom types, making sure that B inherits from A. After enabling plugin and restarting the editor, instances of A will show as protected, whereas instances of B are free to be modified.

Minimal reproduction project

minimal.zip

addmix avatar Jan 27 '23 03:01 addmix

I think this is not a correct usage of add_custom_type(). As per documentation, the base you provide is the base node that will be instantiated and then it will get the script attached. Custom class is not a valid base type, because it's a script. The nodes will appear correctly if you use Node as base for both.

KoBeWi avatar Jan 29 '23 02:01 KoBeWi

It seems like you are correct, it is supposed to be the base built-in node/resource. Perhaps documentation should to be changed to indicate this.

addmix avatar Jan 29 '23 04:01 addmix

Fixed by #72413

addmix avatar Feb 02 '23 22:02 addmix