[method create_action], [method add_do_method], [method add_undo_method], [method add_do_property], [method add_undo_property], and [method commit_action] should be called one after the other, like in the example. Not doing so could lead to crashes.
If you don't need to register a method you can leave [method add_do_method] and [method add_undo_method] out, and so it goes for properties. You can register more than one method/property.
</description>
<tutorials>
</tutorials>
...
...
@@ -20,6 +41,7 @@
<argumentindex="1"name="method"type="String">
</argument>
<description>
Register a method that will be called when the action is committed.
</description>
</method>
<methodname="add_do_property">
...
...
@@ -32,7 +54,7 @@
<argumentindex="2"name="value"type="Variant">
</argument>
<description>
Set a property with a custom value.
Register a property value change for 'do'.
</description>
</method>
<methodname="add_do_reference">
...
...
@@ -41,7 +63,7 @@
<argumentindex="0"name="object"type="Object">
</argument>
<description>
Add a 'do' reference that will be erased if the 'do' history is lost. This is useful mostly for new nodes created for the 'do' call. Do not use for resources.
Register a reference for 'do' that will be erased if the 'do' history is lost. This is useful mostly for new nodes created for the 'do' call. Do not use for resources.
</description>
</method>
<methodname="add_undo_method"qualifiers="vararg">
...
...
@@ -52,6 +74,7 @@
<argumentindex="1"name="method"type="String">
</argument>
<description>
Register a method that will be called when the action is undone.
</description>
</method>
<methodname="add_undo_property">
...
...
@@ -64,7 +87,7 @@
<argumentindex="2"name="value"type="Variant">
</argument>
<description>
Undo setting of a property with a custom value.
Register a property value change for 'undo'.
</description>
</method>
<methodname="add_undo_reference">
...
...
@@ -73,7 +96,7 @@
<argumentindex="0"name="object"type="Object">
</argument>
<description>
Add an 'undo' reference that will be erased if the 'undo' history is lost. This is useful mostly for nodes removed with the 'do' call (not the 'undo' call!).
Register a reference for 'undo' that will be erased if the 'undo' history is lost. This is useful mostly for nodes removed with the 'do' call (not the 'undo' call!).
Create a new action. After this is called, do all your calls to [method add_do_method], [method add_undo_method], [method add_do_property] and [method add_undo_property].
Create a new action. After this is called, do all your calls to [method add_do_method], [method add_undo_method], [method add_do_property], and [method add_undo_property], then commit the action with [method commit_action].