Enforce custom nodes to keep their original type
Replaces PR https://github.com/godotengine/godot/pull/82684 with a move away from Core/Object in favor of ~~Scene/Main/Node~~ metadata usage.
Closes https://github.com/godotengine/godot-proposals/issues/7905
Not sure if showing extend icon for non-custom-type scripts is a good idea:
It can show for scripts that can't be extended, and more importantly, takes space, which is already too small in that area.
You could try using _property_can_revert() and _property_get_revert() to handle script default. It could allow removing PackedScene changes.
- Script button "Extend" is now only shown when the script is a custom type script
- "Clear" is only removed if resource is actually a script
I haven't found a nice way around the PackedScene changes yet. As I see it, _property_can_revert() and _property_get_revert() are virtual methods. Where would be a good place to override them to get the desired effect?
Where would be a good place to override them to get the desired effect?
In Object. Although they are part of GDClass, so not sure if it's possible. In worst case you can put some duplicate code in Node and Resource.
I was trying to avoid changes to core/ as much as possible with this PR, as this was requested in the last PR attempt. That's why I initially didn't use CoreStringNames.
~~Maybe I can get away with the changes in packed_scene if I add a condition in PropertyUtils::is_property_value_different as I already did in PropertyUtils::get_property_default_value.~~ No, that's not going to work.
Can you rebase to resolve conflicts?
Can you rebase to resolve conflicts?
Yes, will do this now.
Rebased.
I think I got all suggestions in place and also moved from CoreStringNames to SceneStringNames.