diff options
Diffstat (limited to 'doc/classes/UndoRedo.xml')
-rw-r--r-- | doc/classes/UndoRedo.xml | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml index 7258efbdda..6c151ef958 100644 --- a/doc/classes/UndoRedo.xml +++ b/doc/classes/UndoRedo.xml @@ -17,7 +17,7 @@ func undo_something(): pass # Put here the code that reverts what's done by "do_something()". - func _on_MyButton_pressed(): + func _on_my_button_pressed(): var node = get_node("MyNode2D") undo_redo.create_action("Move the node") undo_redo.add_do_method(self, "do_something") @@ -48,10 +48,10 @@ { var node = GetNode<Node2D>("MyNode2D"); UndoRedo.CreateAction("Move the node"); - UndoRedo.AddDoMethod(this, nameof(DoSomething)); - UndoRedo.AddUndoMethod(this, nameof(UndoSomething)); - UndoRedo.AddDoProperty(node, "position", new Vector2(100, 100)); - UndoRedo.AddUndoProperty(node, "position", node.Position); + UndoRedo.AddDoMethod(this, MethodName.DoSomething); + UndoRedo.AddUndoMethod(this, MethodName.UndoSomething); + UndoRedo.AddDoProperty(node, Node2D.PropertyName.Position, new Vector2(100, 100)); + UndoRedo.AddUndoProperty(node, Node2D.PropertyName.Position, node.Position); UndoRedo.CommitAction(); } [/csharp] |