Rybadour/NodeConnectorGodot

[Feature Request] Support for NodePath

Opened this issue · 4 comments

Problem

User changes the Tree structure

Actual Solution

Select them again and generate code
Ps: I didnt tested if clicking generate code two time it will add repeated code

Proposal

Instead of simple finding a node, the plugin generates a:

signal changed_tree_structure

export var path:NodePath

func _on_ready():
    path = path_to_node

CHeck if tree structure changed and re-assign to nodepath

Ah so generate absolute node paths instead? Certainly could be an option. Not sure how to handle when the node structure changes I don't know if this plugin should really aim to handle that.

I think that godot has a signal for tree structure change for that, but has to do some search.

Sorry but I'm still not 100% sure I understand the goal

Did you mean code a bit more like this

`signal changed_tree_structure

export var path:NodePath

func _on_ready():
path = path_to_node

func on_changed_tree_structure():
path =NEW_PATH_TO_NODE`

(WHY WON'T THE CODE FORMAT PROPERLY!?)

If so, your best bet will likely be SceneTree's node_configuration_warning_changed signal which should be simple enough to implement

like a said this needs a little research, and any idea is very welcome :D