mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-11-10 08:42:11 +01:00
Also added undo redo support for creating and removing nodes in mat_maker_gd's addon.
This commit is contained in:
parent
49efd3f106
commit
5115167821
@ -173,7 +173,14 @@ func on_graph_node_close_request(node : GraphNode) -> void:
|
|||||||
ignore_changes(true)
|
ignore_changes(true)
|
||||||
|
|
||||||
_material.cancel_render_and_wait()
|
_material.cancel_render_and_wait()
|
||||||
_material.remove_node(node._node)
|
|
||||||
|
#_material.remove_node(node._node)
|
||||||
|
|
||||||
|
_undo_redo.create_action("MMGD: Remove Node")
|
||||||
|
_undo_redo.add_do_method(_material, "remove_node", node._node)
|
||||||
|
_undo_redo.add_undo_method(_material, "add_node", node._node)
|
||||||
|
_undo_redo.commit_action()
|
||||||
|
|
||||||
recreate()
|
recreate()
|
||||||
|
|
||||||
ignore_changes(false)
|
ignore_changes(false)
|
||||||
@ -198,7 +205,12 @@ func _on_AddPopup_ok_pressed(script_path : String):
|
|||||||
|
|
||||||
ignore_changes(true)
|
ignore_changes(true)
|
||||||
|
|
||||||
_material.add_node(nnode)
|
#_material.add_node(nnode)
|
||||||
|
|
||||||
|
_undo_redo.create_action("MMGD: Add Node")
|
||||||
|
_undo_redo.add_do_method(_material, "add_node", nnode)
|
||||||
|
_undo_redo.add_undo_method(_material, "remove_node", nnode)
|
||||||
|
_undo_redo.commit_action()
|
||||||
|
|
||||||
var gn : GraphNode = MMGraphNode.new()
|
var gn : GraphNode = MMGraphNode.new()
|
||||||
gn.slot_colors = slot_colors
|
gn.slot_colors = slot_colors
|
||||||
|
Loading…
Reference in New Issue
Block a user