From 8dc645c9a72d1a556a2319177b2379ba7e88ea1c Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Sat, 3 Feb 2024 17:28:56 +0100 Subject: [PATCH] Fix issues and update docs for BehaviorTreeData/View --- config.py | 1 + doc_classes/BTPlayer.xml | 6 ++++++ doc_classes/BTState.xml | 8 ++++++++ doc_classes/BehaviorTreeData.xml | 22 ++++++++++++++++++++++ doc_classes/BehaviorTreeView.xml | 20 ++++++++++++++++++++ editor/debugger/behavior_tree_data.cpp | 4 ++-- editor/debugger/behavior_tree_view.cpp | 1 - 7 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 doc_classes/BehaviorTreeData.xml create mode 100644 doc_classes/BehaviorTreeView.xml diff --git a/config.py b/config.py index 458072f..875d0d3 100644 --- a/config.py +++ b/config.py @@ -58,6 +58,7 @@ def get_doc_classes(): "BBVector4", "BBVector4i", "BehaviorTree", + "BehaviorTreeData", "BehaviorTreeView", "Blackboard", "BlackboardPlan", diff --git a/doc_classes/BTPlayer.xml b/doc_classes/BTPlayer.xml index a284468..090712d 100644 --- a/doc_classes/BTPlayer.xml +++ b/doc_classes/BTPlayer.xml @@ -16,6 +16,12 @@ Returns the behavior tree's last execution status. See [enum BT.Status]. + + + + Returns the root task of the instantiated behavior tree. + + diff --git a/doc_classes/BTState.xml b/doc_classes/BTState.xml index 7990803..80a490e 100644 --- a/doc_classes/BTState.xml +++ b/doc_classes/BTState.xml @@ -8,6 +8,14 @@ + + + + + Returns the root task of the instantiated behavior tree. + + + A [BehaviorTree] resource that defines state behavior. diff --git a/doc_classes/BehaviorTreeData.xml b/doc_classes/BehaviorTreeData.xml new file mode 100644 index 0000000..67c5e6e --- /dev/null +++ b/doc_classes/BehaviorTreeData.xml @@ -0,0 +1,22 @@ + + + + Represents current state of a [BehaviorTree] instance. + + + This class is used by the LimboAI debugger for the serialization and deserialization of [BehaviorTree] instance data. + Additionally, it can be used with [BehaviorTreeView] to visualize the current state of a [BehaviorTree] instance. It is meant to be utilized in custom in-game tools. + + + + + + + + + Returns current state of the [param p_tree_instance] encoded as a [BehaviorTreeData], suitable for use with [BehaviorTreeView]. + Behavior tree instance can be acquired with [method BTPlayer.get_tree_instance]. + + + + diff --git a/doc_classes/BehaviorTreeView.xml b/doc_classes/BehaviorTreeView.xml new file mode 100644 index 0000000..3afa8d0 --- /dev/null +++ b/doc_classes/BehaviorTreeView.xml @@ -0,0 +1,20 @@ + + + + Visualizes the current state of a [BehaviorTree] instance. + + + Visualizes the current state of a [BehaviorTree] instance. See also [BehaviorTreeData]. + + + + + + + + + Updates the representation of a [BehaviorTree] instance. See also [BehaviorTreeData]. + + + + diff --git a/editor/debugger/behavior_tree_data.cpp b/editor/debugger/behavior_tree_data.cpp index 47a7cab..9626bb4 100644 --- a/editor/debugger/behavior_tree_data.cpp +++ b/editor/debugger/behavior_tree_data.cpp @@ -120,8 +120,8 @@ Ref BehaviorTreeData::create_from_tree_instance(const Refconnect(LW_NAME(item_collapsed), callable_mp(this, &BehaviorTreeView::_item_collapsed)); } break; - case NOTIFICATION_POSTINITIALIZE: case NOTIFICATION_LAYOUT_DIRECTION_CHANGED: case NOTIFICATION_TRANSLATION_CHANGED: case NOTIFICATION_THEME_CHANGED: {