[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>
</description>
<tutorials>
<tutorials>
</tutorials>
</tutorials>
...
@@ -20,6 +41,7 @@
...
@@ -20,6 +41,7 @@
<argumentindex="1"name="method"type="String">
<argumentindex="1"name="method"type="String">
</argument>
</argument>
<description>
<description>
Register a method that will be called when the action is committed.
</description>
</description>
</method>
</method>
<methodname="add_do_property">
<methodname="add_do_property">
...
@@ -32,7 +54,7 @@
...
@@ -32,7 +54,7 @@
<argumentindex="2"name="value"type="Variant">
<argumentindex="2"name="value"type="Variant">
</argument>
</argument>
<description>
<description>
Set a property with a custom value.
Register a property value change for 'do'.
</description>
</description>
</method>
</method>
<methodname="add_do_reference">
<methodname="add_do_reference">
...
@@ -41,7 +63,7 @@
...
@@ -41,7 +63,7 @@
<argumentindex="0"name="object"type="Object">
<argumentindex="0"name="object"type="Object">
</argument>
</argument>
<description>
<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>
</description>
</method>
</method>
<methodname="add_undo_method"qualifiers="vararg">
<methodname="add_undo_method"qualifiers="vararg">
...
@@ -52,6 +74,7 @@
...
@@ -52,6 +74,7 @@
<argumentindex="1"name="method"type="String">
<argumentindex="1"name="method"type="String">
</argument>
</argument>
<description>
<description>
Register a method that will be called when the action is undone.
</description>
</description>
</method>
</method>
<methodname="add_undo_property">
<methodname="add_undo_property">
...
@@ -64,7 +87,7 @@
...
@@ -64,7 +87,7 @@
<argumentindex="2"name="value"type="Variant">
<argumentindex="2"name="value"type="Variant">
</argument>
</argument>
<description>
<description>
Undo setting of a property with a custom value.
Register a property value change for 'undo'.
</description>
</description>
</method>
</method>
<methodname="add_undo_reference">
<methodname="add_undo_reference">
...
@@ -73,7 +96,7 @@
...
@@ -73,7 +96,7 @@
<argumentindex="0"name="object"type="Object">
<argumentindex="0"name="object"type="Object">
</argument>
</argument>
<description>
<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].