NodeConnectorGodot icon indicating copy to clipboard operation
NodeConnectorGodot copied to clipboard

[Feature Request] Support for NodePath

Open nonunknown opened this issue 4 years ago • 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

nonunknown avatar Apr 05 '20 13:04 nonunknown

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.

Rybadour avatar Apr 05 '20 13:04 Rybadour

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

nonunknown avatar Apr 05 '20 13:04 nonunknown

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

iatenine avatar Apr 12 '20 00:04 iatenine

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

nonunknown avatar Apr 12 '20 09:04 nonunknown