VP-GAMES / DialogueEditor

Dialogue editor plugin for Godot Engine
MIT License
24 stars 1 forks source link

Please handle GraphEdit._on_end_node_move #3

Closed qbx2 closed 1 year ago

qbx2 commented 1 year ago

I cannot reposition GraphNodes, and the offsets are reset when I update GraphNodes.

My solution:

  1. Add this to _init_connections() in DialogueNodesView.gd
    if not _graph_ui.is_connected("_end_node_move", self, "_on_end_node_move"):
        assert(_graph_ui.connect("_end_node_move", self, "_on_end_node_move") == OK)
  2. Add this to DialogueNodesView.gd
    func _on_end_node_move():
    var node = _selected_node._node
    _dialogue.node_move_request(node.uuid, _selected_node.offset)
  3. Implement node_move_request in DialogueDialogue.gd
    func node_move_request(uuid, offset):
    var node = _node_by_uuid(uuid) as DialogueNode
    node.position = offset

I tested it and it works, but I think the author could add better code to handle this.

VP-GAMES commented 1 year ago

I added your code to this commit https://github.com/VP-GAMES/DialogueEditor/commit/1f1a92410c6820982b6417b8253da0a9db4388c0. Thank you for bugreport and implementation code. You can also create a pull request if you need.

qbx2 commented 1 year ago

Thank you!