Update class documentation and add rst update script

This commit is contained in:
Serhii Snitsaruk 2024-01-16 11:18:18 +01:00
parent 1648728e1b
commit 594097ae4c
7 changed files with 70 additions and 22 deletions

View File

@ -114,9 +114,7 @@ Makes a copy of the BehaviorTree resource.
void **copy_other** **(** :ref:`BehaviorTree<class_BehaviorTree>` p_other **)**
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
Become a copy of another behavior tree.
.. rst-class:: classref-item-separator

View File

@ -31,15 +31,17 @@ Properties
.. table::
:widths: auto
+-----------------------------+---------------------------------------------------------------------------+-----------+
| Array | :ref:`args<class_BTCallMethod_property_args>` | ``[]`` |
+-----------------------------+---------------------------------------------------------------------------+-----------+
| bool | :ref:`args_include_delta<class_BTCallMethod_property_args_include_delta>` | ``false`` |
+-----------------------------+---------------------------------------------------------------------------+-----------+
| StringName | :ref:`method<class_BTCallMethod_property_method>` | ``&""`` |
+-----------------------------+---------------------------------------------------------------------------+-----------+
| :ref:`BBNode<class_BBNode>` | :ref:`node<class_BTCallMethod_property_node>` | |
+-----------------------------+---------------------------------------------------------------------------+-----------+
+-------------------------------------+---------------------------------------------------------------------------+-----------+
| :ref:`BBVariant[]<class_BBVariant>` | :ref:`args<class_BTCallMethod_property_args>` | ``[]`` |
+-------------------------------------+---------------------------------------------------------------------------+-----------+
| bool | :ref:`args_include_delta<class_BTCallMethod_property_args_include_delta>` | ``false`` |
+-------------------------------------+---------------------------------------------------------------------------+-----------+
| StringName | :ref:`method<class_BTCallMethod_property_method>` | ``&""`` |
+-------------------------------------+---------------------------------------------------------------------------+-----------+
| :ref:`BBNode<class_BBNode>` | :ref:`node<class_BTCallMethod_property_node>` | |
+-------------------------------------+---------------------------------------------------------------------------+-----------+
| String | :ref:`result_var<class_BTCallMethod_property_result_var>` | ``""`` |
+-------------------------------------+---------------------------------------------------------------------------+-----------+
.. rst-class:: classref-section-separator
@ -54,12 +56,12 @@ Property Descriptions
.. rst-class:: classref-property
Array **args** = ``[]``
:ref:`BBVariant[]<class_BBVariant>` **args** = ``[]``
.. rst-class:: classref-property-setget
- void **set_args** **(** Array value **)**
- Array **get_args** **(** **)**
- void **set_args** **(** :ref:`BBVariant[]<class_BBVariant>` value **)**
- :ref:`BBVariant[]<class_BBVariant>` **get_args** **(** **)**
The arguments to be passed when calling the method.
@ -114,6 +116,23 @@ The name of the method to be called.
Specifies the ``Node`` or ``Object`` instance containing the method to be called.
.. rst-class:: classref-item-separator
----
.. _class_BTCallMethod_property_result_var:
.. rst-class:: classref-property
String **result_var** = ``""``
.. rst-class:: classref-property-setget
- void **set_result_var** **(** String value **)**
- String **get_result_var** **(** **)**
if non-empty, assign the result of the method call to the blackboard variable specified by this property.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -64,7 +64,7 @@ Methods
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------+
| String | :ref:`_generate_name<class_BTTask_private_method__generate_name>` **(** **)** |virtual| |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------+
| PackedStringArray | :ref:`_get_configuration_warning<class_BTTask_private_method__get_configuration_warning>` **(** **)** |virtual| |const| |
| PackedStringArray | :ref:`_get_configuration_warnings<class_BTTask_private_method__get_configuration_warnings>` **(** **)** |virtual| |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`_setup<class_BTTask_private_method__setup>` **(** **)** |virtual| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------+
@ -249,11 +249,11 @@ Called to generate a display name for the task unless :ref:`custom_name<class_BT
----
.. _class_BTTask_private_method__get_configuration_warning:
.. _class_BTTask_private_method__get_configuration_warnings:
.. rst-class:: classref-method
PackedStringArray **_get_configuration_warning** **(** **)** |virtual| |const|
PackedStringArray **_get_configuration_warnings** **(** **)** |virtual| |const|
The string returned by this method is shown as a warning message in the behavior tree editor. Any task script that overrides this method must include ``@tool`` annotation at the top of the file.

View File

@ -10,7 +10,7 @@
<tutorials>
</tutorials>
<members>
<member name="args" type="Array" setter="set_args" getter="get_args" default="[]">
<member name="args" type="BBVariant[]" setter="set_args" getter="get_args" default="[]">
The arguments to be passed when calling the method.
</member>
<member name="args_include_delta" type="bool" setter="set_include_delta" getter="is_delta_included" default="false">
@ -22,5 +22,8 @@
<member name="node" type="BBNode" setter="set_node_param" getter="get_node_param">
Specifies the [Node] or [Object] instance containing the method to be called.
</member>
<member name="result_var" type="String" setter="set_result_var" getter="get_result_var" default="&quot;&quot;">
if non-empty, assign the result of the method call to the blackboard variable specified by this property.
</member>
</members>
</class>

View File

@ -31,7 +31,7 @@
Called to generate a display name for the task unless [member custom_name] is set. See [method get_task_name].
</description>
</method>
<method name="_get_configuration_warning" qualifiers="virtual const">
<method name="_get_configuration_warnings" qualifiers="virtual const">
<return type="PackedStringArray" />
<description>
The string returned by this method is shown as a warning message in the behavior tree editor. Any task script that overrides this method must include [code]@tool[/code] annotation at the top of the file.
@ -126,7 +126,7 @@
Returns the root task of the behavior tree.
</description>
</method>
<method name="get_task_name" qualifiers="const">
<method name="get_task_name">
<return type="String" />
<description>
The string returned by this method is used to represent the task in the editor.
@ -169,7 +169,7 @@
Returns [code]null[/code] if this task has no parent or it is the last child in the parent's children list.
</description>
</method>
<method name="print_tree" qualifiers="const">
<method name="print_tree">
<return type="void" />
<param index="0" name="p_initial_tabs" type="int" default="0" />
<description>

View File

@ -21,6 +21,13 @@
Makes a copy of the BehaviorTree resource.
</description>
</method>
<method name="copy_other">
<return type="void" />
<param index="0" name="p_other" type="BehaviorTree" />
<description>
Become a copy of another behavior tree.
</description>
</method>
<method name="get_root_task" qualifiers="const">
<return type="BTTask" />
<description>

21
gdextension/update_rst.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
usage () { echo -e "Usage: Call from the Godot source root to update LimboAI rst class documentation."; }
msg () { echo -e "$@"; }
set -e
if [ ! -d "${PWD}/modules/limboai" ]; then
usage
exit 1
fi
rm -rf /tmp/rst
./doc/tools/make_rst.py --output /tmp/rst doc/tools doc/classes/@GlobalScope.xml modules/limboai/doc_classes || /bin/true
msg Removing old rst class documentation...
rm ./modules/limboai/doc/source/classes/class_*
msg Copying new rst class documentation...
cp -r -f /tmp/rst/class_* modules/limboai/doc/source/classes/
msg Cleaning up...
rm modules/limboai/doc/source/classes/class_@globalscope.rst
msg Done!