mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 03:18:37 +08:00
26 lines
630 B
Plaintext
26 lines
630 B
Plaintext
undo/redo api proposal
|
|
|
|
|
|
|
|
o o o o o o o o
|
|
|
|
|
|
undoredo.create_method();
|
|
undoredo.add_do_method(node,"add_child",node_to_add);
|
|
undoredo.add_undo_method(node,"remove_child",node_to_add);
|
|
undoredo.add_add_data(node_to_add);
|
|
undoredo.commit()
|
|
|
|
undoredo.create_method();
|
|
undoredo.add_do_method(node,"remove_node",node_to_remove);
|
|
undoredo.add_undo_method(node,"add_node",node_to_remove);
|
|
undoredo.add_remove_data(node_to_remove);
|
|
undoredo.commit()
|
|
|
|
|
|
undoredo.create_property();
|
|
undoredo.add_do_set(node,"property",value);
|
|
undoredo.add_undo_set(node,"property",previous_value);
|
|
undoredo.add_remove_data(node_to_remove);
|
|
undoredo.commit()
|