Compare commits

...

5 Commits

Author SHA1 Message Date
Alexander Montag 5ebb36077a
Implement Tree Search Functionality with Highlighting and Filtering
This commit introduces a comprehensive Tree Search feature, including:
- Tree highlighting: Highlights items that match the search query.
- Counting descendants: Shows the number of matching items within collapsed branches.
- Jump to next match: on enter.
- (Limbo-)Shortcut: Default CTRL-F.
- Menu entry: Misc->Search Tree.
- Remember separate SearchInfo for each tab.

Key implementation details:
- Optimized performance for large trees
- Implemented recursive filtering for efficiency
- Added UI elements including next/previous match buttons

Development History:
- Initial implementation of highlighting and filtering
- Multiple rounds of performance optimization
- Bug fixes and refactoring for correctness
- UI enhancements and polish
- Code cleanup and style improvements
2024-10-04 16:55:53 +02:00
Serhii Snitsaruk 760af804c0
Merge pull request #230 from limbonaut/fix-docs
Fix and update docs
2024-09-30 12:36:57 +02:00
Serhii Snitsaruk c49e5142a5
Fix and update docs 2024-09-30 11:17:01 +02:00
Serhii Snitsaruk 60a767032e
Merge pull request #226 from limbonaut/fix-hsm-exit-crash
Fix invalid access errors on exit in LimboHSM
2024-09-26 16:54:31 +02:00
Serhii Snitsaruk 60142b191d
Fix invalid access crash on exit in LimboHSM
Since #131, `LimboState::_exit()` became a source of potential crashes
if object references are used without a validity check. It's too easy
to miss this, which can lead to game crashing during runtime.

This fix reverts #131 change and proposes alternative approach of
re-activating root HSM upon tree entering if it was previously active.
Note that it's not an ideal solution, as some state will be lost upon
re-parenting: HSM exits and then re-activates and enters its initial state.
2024-09-22 13:57:15 +02:00
107 changed files with 1136 additions and 247 deletions

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBAabb.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBAabb.xml.
.. _class_BBAabb:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBArray.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBArray.xml.
.. _class_BBArray:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBBasis.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBBasis.xml.
.. _class_BBBasis:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBBool.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBBool.xml.
.. _class_BBBool:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBByteArray.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBByteArray.xml.
.. _class_BBByteArray:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBColor.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBColor.xml.
.. _class_BBColor:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBColorArray.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBColorArray.xml.
.. _class_BBColorArray:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBDictionary.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBDictionary.xml.
.. _class_BBDictionary:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBFloat.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBFloat.xml.
.. _class_BBFloat:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBFloat32Array.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBFloat32Array.xml.
.. _class_BBFloat32Array:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBFloat64Array.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBFloat64Array.xml.
.. _class_BBFloat64Array:

View File

@ -1,23 +0,0 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.2/modules/limboai/doc_classes/BBFloatArray.xml.
.. _class_BBFloatArray:
BBFloatArray
============
**Inherits:** :ref:`BBParam<class_BBParam>`
FloatArray-type parameter for :ref:`BehaviorTree<class_BehaviorTree>` tasks. See :ref:`BBParam<class_BBParam>`.
.. |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.)`
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBInt.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBInt.xml.
.. _class_BBInt:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBInt32Array.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBInt32Array.xml.
.. _class_BBInt32Array:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBInt64Array.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBInt64Array.xml.
.. _class_BBInt64Array:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBNode.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBNode.xml.
.. _class_BBNode:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBParam.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBParam.xml.
.. _class_BBParam:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBPlane.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBPlane.xml.
.. _class_BBPlane:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBProjection.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBProjection.xml.
.. _class_BBProjection:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBQuaternion.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBQuaternion.xml.
.. _class_BBQuaternion:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBRect2.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBRect2.xml.
.. _class_BBRect2:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBRect2i.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBRect2i.xml.
.. _class_BBRect2i:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBString.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBString.xml.
.. _class_BBString:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBStringArray.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBStringArray.xml.
.. _class_BBStringArray:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBStringName.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBStringName.xml.
.. _class_BBStringName:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBTransform2D.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBTransform2D.xml.
.. _class_BBTransform2D:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBTransform3D.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBTransform3D.xml.
.. _class_BBTransform3D:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBVariant.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBVariant.xml.
.. _class_BBVariant:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBVector2.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBVector2.xml.
.. _class_BBVector2:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBVector2Array.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBVector2Array.xml.
.. _class_BBVector2Array:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBVector2i.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBVector2i.xml.
.. _class_BBVector2i:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBVector3.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBVector3.xml.
.. _class_BBVector3:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBVector3Array.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBVector3Array.xml.
.. _class_BBVector3Array:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBVector3i.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBVector3i.xml.
.. _class_BBVector3i:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBVector4.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBVector4.xml.
.. _class_BBVector4:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BBVector4i.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BBVector4i.xml.
.. _class_BBVector4i:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BehaviorTree.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BehaviorTree.xml.
.. _class_BehaviorTree:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BehaviorTreeData.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BehaviorTreeData.xml.
.. _class_BehaviorTreeData:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BehaviorTreeView.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BehaviorTreeView.xml.
.. _class_BehaviorTreeView:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/Blackboard.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/Blackboard.xml.
.. _class_Blackboard:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BlackboardPlan.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BlackboardPlan.xml.
.. _class_BlackboardPlan:
@ -34,23 +34,23 @@ Methods
.. table::
:widths: auto
+---------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Blackboard<class_Blackboard>` | :ref:`create_blackboard<class_BlackboardPlan_method_create_blackboard>`\ (\ node\: ``Node``, parent_scope\: :ref:`Blackboard<class_Blackboard>` = null\ ) |
+---------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Blackboard<class_Blackboard>` | :ref:`create_blackboard<class_BlackboardPlan_method_create_blackboard>`\ (\ prefetch_root\: ``Node``, parent_scope\: :ref:`Blackboard<class_Blackboard>` = null, prefetch_root_for_base_plan\: ``Node`` = null\ ) |
+---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`BlackboardPlan<class_BlackboardPlan>` | :ref:`get_base_plan<class_BlackboardPlan_method_get_base_plan>`\ (\ ) |const| |
+---------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ``Callable`` | :ref:`get_parent_scope_plan_provider<class_BlackboardPlan_method_get_parent_scope_plan_provider>`\ (\ ) |const| |
+---------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ``bool`` | :ref:`is_derived<class_BlackboardPlan_method_is_derived>`\ (\ ) |const| |
+---------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`populate_blackboard<class_BlackboardPlan_method_populate_blackboard>`\ (\ blackboard\: :ref:`Blackboard<class_Blackboard>`, overwrite\: ``bool``, node\: ``Node``\ ) |
+---------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`populate_blackboard<class_BlackboardPlan_method_populate_blackboard>`\ (\ blackboard\: :ref:`Blackboard<class_Blackboard>`, overwrite\: ``bool``, prefetch_root\: ``Node``, prefetch_root_for_base_plan\: ``Node`` = null\ ) |
+---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_base_plan<class_BlackboardPlan_method_set_base_plan>`\ (\ blackboard_plan\: :ref:`BlackboardPlan<class_BlackboardPlan>`\ ) |
+---------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_parent_scope_plan_provider<class_BlackboardPlan_method_set_parent_scope_plan_provider>`\ (\ callable\: ``Callable``\ ) |
+---------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`sync_with_base_plan<class_BlackboardPlan_method_sync_with_base_plan>`\ (\ ) |
+---------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
@ -87,9 +87,9 @@ Method Descriptions
.. rst-class:: classref-method
:ref:`Blackboard<class_Blackboard>` **create_blackboard**\ (\ node\: ``Node``, parent_scope\: :ref:`Blackboard<class_Blackboard>` = null\ ) :ref:`🔗<class_BlackboardPlan_method_create_blackboard>`
:ref:`Blackboard<class_Blackboard>` **create_blackboard**\ (\ prefetch_root\: ``Node``, parent_scope\: :ref:`Blackboard<class_Blackboard>` = null, prefetch_root_for_base_plan\: ``Node`` = null\ ) :ref:`🔗<class_BlackboardPlan_method_create_blackboard>`
Constructs a new instance of a :ref:`Blackboard<class_Blackboard>` using this plan. If ``NodePath`` prefetching is enabled, ``node`` will be used to retrieve node instances for ``NodePath`` variables and substitute their values.
Constructs a new instance of a :ref:`Blackboard<class_Blackboard>` using this plan. If ``NodePath`` prefetching is enabled, ``prefetch_root`` will be used to retrieve node instances for ``NodePath`` variables and substitute their values.
.. rst-class:: classref-item-separator
@ -135,9 +135,9 @@ Returns ``true`` if this plan is derived from another, i.e., the base plan is no
.. rst-class:: classref-method
|void| **populate_blackboard**\ (\ blackboard\: :ref:`Blackboard<class_Blackboard>`, overwrite\: ``bool``, node\: ``Node``\ ) :ref:`🔗<class_BlackboardPlan_method_populate_blackboard>`
|void| **populate_blackboard**\ (\ blackboard\: :ref:`Blackboard<class_Blackboard>`, overwrite\: ``bool``, prefetch_root\: ``Node``, prefetch_root_for_base_plan\: ``Node`` = null\ ) :ref:`🔗<class_BlackboardPlan_method_populate_blackboard>`
Populates ``blackboard`` with the variables from this plan. If ``overwrite`` is ``true``, existing variables with the same names will be overwritten. If ``NodePath`` prefetching is enabled, ``node`` will be used to retrieve node instances for ``NodePath`` variables and substitute their values.
Populates ``blackboard`` with the variables from this plan. If ``overwrite`` is ``true``, existing variables with the same names will be overwritten. If ``NodePath`` prefetching is enabled, ``prefetch_root`` will be used to retrieve node instances for ``NodePath`` variables and substitute their values.
.. rst-class:: classref-item-separator

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BT.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BT.xml.
.. _class_BT:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTAction.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTAction.xml.
.. _class_BTAction:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTAlwaysFail.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTAlwaysFail.xml.
.. _class_BTAlwaysFail:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTAlwaysSucceed.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTAlwaysSucceed.xml.
.. _class_BTAlwaysSucceed:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTAwaitAnimation.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTAwaitAnimation.xml.
.. _class_BTAwaitAnimation:
@ -95,7 +95,7 @@ Parameter that specifies the ``AnimationPlayer`` node.
- |void| **set_max_time**\ (\ value\: ``float``\ )
- ``float`` **get_max_time**\ (\ )
The maximum duration to wait for the animation to complete (in seconds). If the animation doesn't finish within this time, BTAwaitAnimation will return ``FAILURE``.
The maximum duration to wait for the animation to complete (in seconds). If the animation doesn't finish within this time, BTAwaitAnimation will stop waiting and return ``SUCCESS``.
.. |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.)`

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTCallMethod.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTCallMethod.xml.
.. _class_BTCallMethod:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTCheckAgentProperty.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTCheckAgentProperty.xml.
.. _class_BTCheckAgentProperty:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTCheckTrigger.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTCheckTrigger.xml.
.. _class_BTCheckTrigger:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTCheckVar.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTCheckVar.xml.
.. _class_BTCheckVar:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTComment.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTComment.xml.
.. _class_BTComment:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTComposite.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTComposite.xml.
.. _class_BTComposite:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTCondition.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTCondition.xml.
.. _class_BTCondition:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTConsolePrint.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTConsolePrint.xml.
.. _class_BTConsolePrint:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTCooldown.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTCooldown.xml.
.. _class_BTCooldown:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTDecorator.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTDecorator.xml.
.. _class_BTDecorator:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTDelay.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTDelay.xml.
.. _class_BTDelay:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTDynamicSelector.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTDynamicSelector.xml.
.. _class_BTDynamicSelector:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTDynamicSequence.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTDynamicSequence.xml.
.. _class_BTDynamicSequence:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTEvaluateExpression.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTEvaluateExpression.xml.
.. _class_BTEvaluateExpression:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTFail.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTFail.xml.
.. _class_BTFail:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTForEach.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTForEach.xml.
.. _class_BTForEach:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTInstance.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTInstance.xml.
.. _class_BTInstance:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTInvert.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTInvert.xml.
.. _class_BTInvert:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTNewScope.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTNewScope.xml.
.. _class_BTNewScope:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTParallel.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTParallel.xml.
.. _class_BTParallel:
@ -65,7 +65,7 @@ Property Descriptions
- |void| **set_num_failures_required**\ (\ value\: ``int``\ )
- ``int`` **get_num_failures_required**\ (\ )
If the specified number of child tasks return ``SUCCESS``, BTParallel will also return ``SUCCESS``.
If the specified number of child tasks return ``FAILURE``, BTParallel will also return ``FAILURE``.
.. rst-class:: classref-item-separator
@ -82,7 +82,7 @@ If the specified number of child tasks return ``SUCCESS``, BTParallel will also
- |void| **set_num_successes_required**\ (\ value\: ``int``\ )
- ``int`` **get_num_successes_required**\ (\ )
If the specified number of child tasks return ``FAILURE``, BTParallel will also return ``FAILURE``.
If the specified number of child tasks return ``SUCCESS``, BTParallel will also return ``SUCCESS``.
.. rst-class:: classref-item-separator

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTPauseAnimation.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTPauseAnimation.xml.
.. _class_BTPauseAnimation:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTPlayAnimation.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTPlayAnimation.xml.
.. _class_BTPlayAnimation:
@ -103,7 +103,7 @@ Parameter that specifies the ``AnimationPlayer`` node.
- |void| **set_await_completion**\ (\ value\: ``float``\ )
- ``float`` **get_await_completion**\ (\ )
The maximum duration to wait for the animation to complete (in seconds). If the animation doesn't finish within this time, BTAwaitAnimation will return ``FAILURE``. If set to ``0``, BTPlayAnimation doesn't wait for the animation to finish and immediately returns ``SUCCESS``.
The maximum duration to wait for the animation to complete (in seconds). If the animation doesn't finish within this time, BTPlayAnimation will stop waiting and return ``SUCCESS``.
.. rst-class:: classref-item-separator

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTPlayer.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTPlayer.xml.
.. _class_BTPlayer:
@ -241,6 +241,11 @@ Stores and manages variables that will be used in constructing new :ref:`Blackbo
``bool`` **monitor_performance** = ``false`` :ref:`🔗<class_BTPlayer_property_monitor_performance>`
.. rst-class:: classref-property-setget
- |void| **set_monitor_performance**\ (\ value\: ``bool``\ )
- ``bool`` **get_monitor_performance**\ (\ )
If ``true``, adds a performance monitor to "Debugger->Monitors" for each instance of this **BTPlayer** node.
.. rst-class:: classref-item-separator

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTProbability.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTProbability.xml.
.. _class_BTProbability:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTProbabilitySelector.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTProbabilitySelector.xml.
.. _class_BTProbabilitySelector:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTRandomSelector.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTRandomSelector.xml.
.. _class_BTRandomSelector:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTRandomSequence.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTRandomSequence.xml.
.. _class_BTRandomSequence:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTRandomWait.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTRandomWait.xml.
.. _class_BTRandomWait:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTRepeat.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTRepeat.xml.
.. _class_BTRepeat:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTRepeatUntilFailure.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTRepeatUntilFailure.xml.
.. _class_BTRepeatUntilFailure:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTRepeatUntilSuccess.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTRepeatUntilSuccess.xml.
.. _class_BTRepeatUntilSuccess:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTRunLimit.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTRunLimit.xml.
.. _class_BTRunLimit:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTSelector.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTSelector.xml.
.. _class_BTSelector:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTSequence.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTSequence.xml.
.. _class_BTSequence:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTSetAgentProperty.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTSetAgentProperty.xml.
.. _class_BTSetAgentProperty:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTSetVar.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTSetVar.xml.
.. _class_BTSetVar:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTState.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTState.xml.
.. _class_BTState:
@ -102,6 +102,11 @@ HSM event that will be dispatched when the behavior tree results in ``FAILURE``.
``bool`` **monitor_performance** = ``false`` :ref:`🔗<class_BTState_property_monitor_performance>`
.. rst-class:: classref-property-setget
- |void| **set_monitor_performance**\ (\ value\: ``bool``\ )
- ``bool`` **get_monitor_performance**\ (\ )
If ``true``, adds a performance monitor to "Debugger->Monitors" for each instance of this **BTState** node.
.. rst-class:: classref-item-separator

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTStopAnimation.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTStopAnimation.xml.
.. _class_BTStopAnimation:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTSubtree.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTSubtree.xml.
.. _class_BTSubtree:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTTask.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTTask.xml.
.. _class_BTTask:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTTimeLimit.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTTimeLimit.xml.
.. _class_BTTimeLimit:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTWait.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTWait.xml.
.. _class_BTWait:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTWaitTicks.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTWaitTicks.xml.
.. _class_BTWaitTicks:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/LimboHSM.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/LimboHSM.xml.
.. _class_LimboHSM:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/LimboState.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/LimboState.xml.
.. _class_LimboState:

View File

@ -2,8 +2,8 @@
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/LimboUtility.xml.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/LimboUtility.xml.
.. _class_LimboUtility:

View File

@ -18,7 +18,7 @@
Parameter that specifies the [AnimationPlayer] node.
</member>
<member name="max_time" type="float" setter="set_max_time" getter="get_max_time" default="1.0">
The maximum duration to wait for the animation to complete (in seconds). If the animation doesn't finish within this time, BTAwaitAnimation will return [code]FAILURE[/code].
The maximum duration to wait for the animation to complete (in seconds). If the animation doesn't finish within this time, BTAwaitAnimation will stop waiting and return [code]SUCCESS[/code].
</member>
</members>
</class>

View File

@ -14,10 +14,10 @@
</tutorials>
<members>
<member name="num_failures_required" type="int" setter="set_num_failures_required" getter="get_num_failures_required" default="1">
If the specified number of child tasks return [code]SUCCESS[/code], BTParallel will also return [code]SUCCESS[/code].
If the specified number of child tasks return [code]FAILURE[/code], BTParallel will also return [code]FAILURE[/code].
</member>
<member name="num_successes_required" type="int" setter="set_num_successes_required" getter="get_num_successes_required" default="1">
If the specified number of child tasks return [code]FAILURE[/code], BTParallel will also return [code]FAILURE[/code].
If the specified number of child tasks return [code]SUCCESS[/code], BTParallel will also return [code]SUCCESS[/code].
</member>
<member name="repeat" type="bool" setter="set_repeat" getter="get_repeat" default="false">
When [code]true[/code], the child tasks will be executed again, regardless of whether they previously resulted in a [code]SUCCESS[/code] or [code]FAILURE[/code].

View File

@ -19,7 +19,7 @@
Parameter that specifies the [AnimationPlayer] node.
</member>
<member name="await_completion" type="float" setter="set_await_completion" getter="get_await_completion" default="0.0">
The maximum duration to wait for the animation to complete (in seconds). If the animation doesn't finish within this time, BTAwaitAnimation will return [code]FAILURE[/code]. If set to [code]0[/code], BTPlayAnimation doesn't wait for the animation to finish and immediately returns [code]SUCCESS[/code].
The maximum duration to wait for the animation to complete (in seconds). If the animation doesn't finish within this time, BTPlayAnimation will stop waiting and return [code]SUCCESS[/code].
</member>
<member name="blend" type="float" setter="set_blend" getter="get_blend" default="-1.0">
Custom blend time (in seconds). See [method AnimationPlayer.play].

View File

@ -261,6 +261,10 @@ void LimboAIEditor::edit_bt(const Ref<BehaviorTree> &p_behavior_tree, bool p_for
p_behavior_tree->editor_set_section_unfold("blackboard_plan", true);
p_behavior_tree->notify_property_list_changed();
#endif // LIMBOAI_MODULE
// Remember current search info.
if (idx_history >= 0 && idx_history < history.size()) {
tab_search_context.insert(history[idx_history], task_tree->tree_search_get_search_info());
}
task_tree->load_bt(p_behavior_tree);
@ -280,6 +284,18 @@ void LimboAIEditor::edit_bt(const Ref<BehaviorTree> &p_behavior_tree, bool p_for
task_tree->show();
task_palette->show();
// Restore search info from [tab_search_context].
if (idx_history >= 0 && idx_history < history.size()) {
// info for BehaviorTree available. Restore!
if (tab_search_context.has(history[idx_history])) {
task_tree->tree_search_set_search_info(tab_search_context[history[idx_history]]);
}
// new SearchContext.
else {
task_tree->tree_search_set_search_info(TreeSearch::SearchInfo());
}
}
_update_tabs();
}
@ -457,6 +473,8 @@ void LimboAIEditor::_process_shortcut_input(const Ref<InputEvent> &p_event) {
_on_save_pressed();
} else if (LW_IS_SHORTCUT("limbo_ai/load_behavior_tree", p_event)) {
_popup_file_dialog(load_dialog);
} else if (LW_IS_SHORTCUT("limbo_ai/find_task", p_event)) {
task_tree->tree_search_show_and_focus();
} else {
handled = false;
}
@ -799,6 +817,9 @@ void LimboAIEditor::_misc_option_selected(int p_id) {
EDITOR_FILE_SYSTEM()->scan();
EDIT_SCRIPT(template_path);
} break;
case MISC_SEARCH_TREE: {
task_tree->tree_search_show_and_focus();
}
}
}
@ -1319,6 +1340,9 @@ void LimboAIEditor::_update_misc_menu() {
misc_menu->add_item(
FILE_EXISTS(_get_script_template_path()) ? TTR("Edit Script Template") : TTR("Create Script Template"),
MISC_CREATE_SCRIPT_TEMPLATE);
misc_menu->add_separator();
misc_menu->add_icon_shortcut(theme_cache.search_icon, LW_GET_SHORTCUT("limbo_ai/find_task"), MISC_SEARCH_TREE);
}
void LimboAIEditor::_update_banners() {
@ -1381,6 +1405,7 @@ void LimboAIEditor::_do_update_theme_item_cache() {
theme_cache.cut_icon = get_theme_icon(LW_NAME(ActionCut), LW_NAME(EditorIcons));
theme_cache.copy_icon = get_theme_icon(LW_NAME(ActionCopy), LW_NAME(EditorIcons));
theme_cache.paste_icon = get_theme_icon(LW_NAME(ActionPaste), LW_NAME(EditorIcons));
theme_cache.search_icon = get_theme_icon(LW_NAME(Search), LW_NAME(EditorIcons));
theme_cache.behavior_tree_icon = LimboUtility::get_singleton()->get_task_icon("BehaviorTree");
theme_cache.percent_icon = LimboUtility::get_singleton()->get_task_icon("LimboPercent");
@ -1512,6 +1537,8 @@ LimboAIEditor::LimboAIEditor() {
LW_SHORTCUT("limbo_ai/open_debugger", TTR("Open Debugger"), (Key)(LW_KEY_MASK(CMD_OR_CTRL) | LW_KEY_MASK(ALT) | LW_KEY(D)));
LW_SHORTCUT("limbo_ai/jump_to_owner", TTR("Jump to Owner"), (Key)(LW_KEY_MASK(CMD_OR_CTRL) | LW_KEY(J)));
LW_SHORTCUT("limbo_ai/close_tab", TTR("Close Tab"), (Key)(LW_KEY_MASK(CMD_OR_CTRL) | LW_KEY(W)));
LW_SHORTCUT("limbo_ai/find_task", TTR("Find Task"), (Key)(LW_KEY_MASK(CMD_OR_CTRL) | LW_KEY(F)));
LW_SHORTCUT("limbo_ai/hide_tree_search", TTR("Close Search"), (Key)(LW_KEY(ESCAPE)));
set_process_shortcut_input(true);

View File

@ -20,6 +20,7 @@
#include "owner_picker.h"
#include "task_palette.h"
#include "task_tree.h"
#include "tree_search.h"
#ifdef LIMBOAI_MODULE
#include "core/object/class_db.h"
@ -47,6 +48,7 @@
#ifdef LIMBOAI_GDEXTENSION
#include "godot_cpp/classes/accept_dialog.hpp"
#include <godot_cpp/classes/config_file.hpp>
#include <godot_cpp/classes/control.hpp>
#include <godot_cpp/classes/editor_plugin.hpp>
#include <godot_cpp/classes/editor_spin_slider.hpp>
@ -63,7 +65,6 @@
#include <godot_cpp/classes/texture2d.hpp>
#include <godot_cpp/variant/packed_string_array.hpp>
#include <godot_cpp/variant/variant.hpp>
#include <godot_cpp/classes/config_file.hpp>
using namespace godot;
@ -100,6 +101,7 @@ private:
MISC_LAYOUT_WIDESCREEN_OPTIMIZED,
MISC_PROJECT_SETTINGS,
MISC_CREATE_SCRIPT_TEMPLATE,
MISC_SEARCH_TREE
};
enum TabMenu {
@ -134,12 +136,14 @@ private:
Ref<Texture2D> cut_icon;
Ref<Texture2D> copy_icon;
Ref<Texture2D> paste_icon;
Ref<Texture2D> search_icon;
} theme_cache;
EditorPlugin *plugin;
EditorLayout editor_layout;
Vector<Ref<BehaviorTree>> history;
int idx_history;
HashMap<Ref<BehaviorTree>, TreeSearch::SearchInfo> tab_search_context;
bool updating_tabs = false;
bool request_update_tabs = false;
HashSet<Ref<BehaviorTree>> dirty;

View File

@ -17,22 +17,23 @@
#include "../bt/tasks/composites/bt_probability_selector.h"
#include "../util/limbo_compat.h"
#include "../util/limbo_utility.h"
#include "tree_search.h"
#ifdef LIMBOAI_MODULE
#include "core/object/script_language.h"
#include "editor/themes/editor_scale.h"
#include "scene/gui/box_container.h"
#include "scene/gui/texture_rect.h"
#include "scene/gui/label.h"
#include "scene/gui/texture_rect.h"
#endif // LIMBOAI_MODULE
#ifdef LIMBOAI_GDEXTENSION
#include <godot_cpp/classes/editor_interface.hpp>
#include <godot_cpp/classes/script.hpp>
#include <godot_cpp/classes/h_box_container.hpp>
#include <godot_cpp/classes/v_box_container.hpp>
#include <godot_cpp/classes/texture_rect.hpp>
#include <godot_cpp/classes/label.hpp>
#include <godot_cpp/classes/script.hpp>
#include <godot_cpp/classes/texture_rect.hpp>
#include <godot_cpp/classes/v_box_container.hpp>
using namespace godot;
#endif // LIMBOAI_GDEXTENSION
@ -46,6 +47,12 @@ TreeItem *TaskTree::_create_tree(const Ref<BTTask> &p_task, TreeItem *p_parent,
_create_tree(p_task->get_child(i), item);
}
_update_item(item);
// update TreeSearch if root task was created
if (tree->get_root() == item) {
tree_search->update_search(tree);
}
return item;
}
@ -105,6 +112,7 @@ void TaskTree::_update_item(TreeItem *p_item) {
if (!warning_text.is_empty()) {
p_item->add_button(0, theme_cache.task_warning_icon, 0, false, warning_text);
}
tree_search->notify_item_edited(p_item); // this is necessary to preserve custom drawing from tree search.
}
void TaskTree::_update_tree() {
@ -434,7 +442,7 @@ void TaskTree::_normalize_drop(TreeItem *item, int type, int &to_pos, Ref<BTTask
to_pos = to_task->get_index();
{
Vector<Ref<BTTask>> selected = get_selected_tasks();
if (to_task == selected[selected.size()-1]) {
if (to_task == selected[selected.size() - 1]) {
to_pos += 1;
}
}
@ -530,6 +538,8 @@ void TaskTree::_notification(int p_what) {
tree->connect("multi_selected", callable_mp(this, &TaskTree::_on_item_selected).unbind(3), CONNECT_DEFERRED);
tree->connect("item_activated", callable_mp(this, &TaskTree::_on_item_activated));
tree->connect("item_collapsed", callable_mp(this, &TaskTree::_on_item_collapsed));
tree_search_panel->connect("update_requested", callable_mp(tree_search.ptr(), &TreeSearch::update_search).bind(tree));
tree_search_panel->connect("visibility_changed", callable_mp(tree_search.ptr(), &TreeSearch::update_search).bind(tree));
} break;
case NOTIFICATION_THEME_CHANGED: {
_do_update_theme_item_cache();
@ -562,12 +572,38 @@ void TaskTree::_bind_methods() {
PropertyInfo(Variant::INT, "type")));
}
// TreeSearch API
void TaskTree::tree_search_show_and_focus() {
ERR_FAIL_NULL(tree_search);
tree_search_panel->set_visible(true);
tree_search_panel->focus_editor();
}
TreeSearch::SearchInfo TaskTree::tree_search_get_search_info() const {
if (!tree_search.is_valid()) {
return TreeSearch::SearchInfo();
}
return tree_search_panel->get_search_info();
}
void TaskTree::tree_search_set_search_info(const TreeSearch::SearchInfo &p_search_info) {
ERR_FAIL_NULL(tree_search);
tree_search_panel->set_search_info(p_search_info);
}
// TreeSearch Api ^
TaskTree::TaskTree() {
editable = true;
updating_tree = false;
VBoxContainer *vbox_container = memnew(VBoxContainer);
add_child(vbox_container);
vbox_container->set_anchors_preset(PRESET_FULL_RECT);
tree = memnew(Tree);
add_child(tree);
tree->set_v_size_flags(Control::SIZE_EXPAND_FILL);
vbox_container->add_child(tree);
tree->set_columns(2);
tree->set_column_expand(0, true);
tree->set_column_expand(1, false);
@ -578,6 +614,10 @@ TaskTree::TaskTree() {
tree->set_select_mode(Tree::SelectMode::SELECT_MULTI);
tree->set_drag_forwarding(callable_mp(this, &TaskTree::_get_drag_data_fw), callable_mp(this, &TaskTree::_can_drop_data_fw), callable_mp(this, &TaskTree::_drop_data_fw));
tree_search_panel = memnew(TreeSearchPanel);
tree_search = Ref(memnew(TreeSearch(tree_search_panel)));
vbox_container->add_child(tree_search_panel);
}
TaskTree::~TaskTree() {

View File

@ -9,9 +9,13 @@
* =============================================================================
*/
#ifndef TASK_TREE_H
#define TASK_TREE_H
#ifdef TOOLS_ENABLED
#include "../bt/behavior_tree.h"
#include "tree_search.h"
#ifdef LIMBOAI_MODULE
#include "scene/gui/control.h"
@ -43,6 +47,9 @@ private:
bool updating_tree;
HashMap<RECT_CACHE_KEY, Rect2> probability_rect_cache;
Ref<TreeSearch> tree_search;
TreeSearchPanel *tree_search_panel;
struct ThemeCache {
Ref<Font> comment_font;
Ref<Font> name_font;
@ -96,12 +103,16 @@ public:
Ref<BTTask> get_selected() const;
Vector<Ref<BTTask>> get_selected_tasks() const;
void clear_selection();
Rect2 get_selected_probability_rect() const;
double get_selected_probability_weight() const;
double get_selected_probability_percent() const;
bool selected_has_probability() const;
// TreeSearch API
void tree_search_show_and_focus();
TreeSearch::SearchInfo tree_search_get_search_info() const;
void tree_search_set_search_info(const TreeSearch::SearchInfo &p_search_info);
virtual bool editor_can_reload_from_file() { return false; }
TaskTree();
@ -109,3 +120,4 @@ public:
};
#endif // ! TOOLS_ENABLED
#endif // ! TASK_TREE_H

632
editor/tree_search.cpp Normal file
View File

@ -0,0 +1,632 @@
/**
* tree_search.cpp
* =============================================================================
* Copyright 2021-2024 Serhii Snitsaruk
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
#ifdef TOOLS_ENABLED
#include "tree_search.h"
#include "../util/limbo_compat.h" // for edscale
#include "../util/limbo_string_names.h"
#include "../util/limbo_utility.h"
#ifdef LIMBOAI_MODULE
#include "core/math/math_funcs.h"
#include "editor/editor_interface.h"
#include "editor/themes/editor_scale.h"
#include "scene/main/viewport.h"
#include "scene/resources/font.h"
#include "scene/resources/style_box_flat.h"
#endif // LIMBOAI_MODULE
#ifdef LIMBOAI_GDEXTENSION
#include <godot_cpp/classes/editor_interface.hpp> // for edge scale
#include <godot_cpp/classes/font.hpp>
#include <godot_cpp/classes/style_box_flat.hpp>
#include <godot_cpp/classes/viewport.hpp>
#include <godot_cpp/core/math.hpp>
#endif // LIMBOAI_GDEXTENSION
#define UPPER_BOUND (1 << 15) // for substring search.
/* ------- TreeSearch ------- */
void TreeSearch::_clean_callable_cache() {
ERR_FAIL_COND(!tree_reference);
HashMap<TreeItem *, Callable> new_callable_cache;
new_callable_cache.reserve(callable_cache.size());
for (int i = 0; i < ordered_tree_items.size(); i++) {
TreeItem *cur_item = ordered_tree_items[i];
if (callable_cache.has(cur_item)) {
new_callable_cache[cur_item] = callable_cache[cur_item];
}
}
callable_cache = new_callable_cache;
}
void TreeSearch::_filter_tree() {
ERR_FAIL_COND(!tree_reference);
if (matching_entries.is_empty()) {
return;
}
_filter_tree(tree_reference->get_root(), false);
}
void TreeSearch::_filter_tree(TreeItem *p_item, bool p_parent_matching) {
bool visible = (number_matches.has(p_item) && (number_matches.get(p_item) > 0)) || p_parent_matching;
p_item->set_visible(visible);
bool is_matching = _vector_has_bsearch(matching_entries, p_item);
for (int i = 0; i < p_item->get_child_count(); i++) {
_filter_tree(p_item->get_child(i), is_matching | p_parent_matching);
}
}
// Makes all tree items visible.
void TreeSearch::_clear_filter() {
ERR_FAIL_COND(!tree_reference);
Vector<TreeItem *> items = { tree_reference->get_root() };
for (int idx = 0; idx < items.size(); idx++) {
TreeItem *cur_item = items[idx];
cur_item->set_visible(true);
for (int i = 0; i < cur_item->get_child_count(); i++) {
items.push_back(cur_item->get_child(i));
}
}
}
void TreeSearch::_highlight_tree() {
ERR_FAIL_COND(!tree_reference);
for (HashMap<TreeItem *, int>::Iterator it = number_matches.begin(); it != number_matches.end(); ++it) {
TreeItem *tree_item = it->key;
_highlight_tree_item(tree_item);
}
tree_reference->queue_redraw();
}
void TreeSearch::_highlight_tree_item(TreeItem *p_tree_item) {
int num_m = number_matches.has(p_tree_item) ? number_matches.get(p_tree_item) : 0;
if (num_m == 0) {
return;
}
// Make sure to also call any draw method already defined.
Callable parent_draw_method;
if (p_tree_item->get_cell_mode(0) == TreeItem::CELL_MODE_CUSTOM) {
parent_draw_method = p_tree_item->get_custom_draw_callback(0);
}
// If the cached draw method is already applied, do nothing.
if (callable_cache.has(p_tree_item) && parent_draw_method == callable_cache.get(p_tree_item)) {
return;
}
Callable draw_callback = callable_mp(this, &TreeSearch::_draw_highlight_item).bind(parent_draw_method);
callable_cache[p_tree_item] = draw_callback;
// This is necessary because of the modularity of this implementation.
// Cache render properties of entry.
String cached_text = p_tree_item->get_text(0);
Ref<Texture2D> cached_icon = p_tree_item->get_icon(0);
int cached_max_width = p_tree_item->get_icon_max_width(0);
// This removes render properties in entry.
p_tree_item->set_custom_draw_callback(0, draw_callback);
p_tree_item->set_cell_mode(0, TreeItem::CELL_MODE_CUSTOM);
// Restore render properties.
p_tree_item->set_text(0, cached_text);
p_tree_item->set_icon(0, cached_icon);
p_tree_item->set_icon_max_width(0, cached_max_width);
}
// Custom draw callback for highlighting (bind the parent_draw_method to this)
void TreeSearch::_draw_highlight_item(TreeItem *p_tree_item, const Rect2 p_rect, const Callable p_parent_draw_method) {
if (!p_tree_item) {
return;
}
// Call any parent draw methods such as for probability FIRST.
p_parent_draw_method.call(p_tree_item, p_rect);
// First part: outline
if (matching_entries.has(p_tree_item)) {
// Font info
Ref<Font> font = p_tree_item->get_custom_font(0);
if (font.is_null()) {
font = p_tree_item->get_tree()->get_theme_font(LW_NAME(font));
}
ERR_FAIL_NULL(font);
float font_size = p_tree_item->get_custom_font_size(0);
if (font_size == -1) {
font_size = p_tree_item->get_tree()->get_theme_font_size(LW_NAME(font));
}
// Substring size
String string_full = p_tree_item->get_text(0);
StringSearchIndices substring_idx = _substring_bounds(string_full, _get_search_mask());
String substring_match = string_full.substr(substring_idx.lower, substring_idx.upper - substring_idx.lower);
Vector2 substring_match_size = font->get_string_size(substring_match, HORIZONTAL_ALIGNMENT_LEFT, -1.f, font_size);
String substring_before = string_full.substr(0, substring_idx.lower);
Vector2 substring_before_size = font->get_string_size(substring_before, HORIZONTAL_ALIGNMENT_LEFT, -1.f, font_size);
// Stylebox
Ref<StyleBox> stylebox = p_tree_item->get_tree()->get_theme_stylebox(LW_NAME(Focus));
ERR_FAIL_NULL(stylebox);
// Extract separation
float h_sep = p_tree_item->get_tree()->get_theme_constant(LW_NAME(h_separation));
// Compose draw rect
const Vector2 PADDING = Vector2(4., 2.);
Rect2 draw_rect = p_rect;
Vector2 rect_offset = Vector2(substring_before_size.x, 0);
rect_offset.x += p_tree_item->get_icon_max_width(0);
rect_offset.x += (h_sep + 4. * EDSCALE);
rect_offset.y = (p_rect.size.y - substring_match_size.y) / 2; // center box vertically
draw_rect.position += rect_offset - PADDING / 2;
draw_rect.size = substring_match_size + PADDING;
// Draw
stylebox->draw(p_tree_item->get_tree()->get_canvas_item(), draw_rect);
}
// Second part: draw number
int num_mat = number_matches.has(p_tree_item) ? number_matches.get(p_tree_item) : 0;
if (num_mat > 0) {
float h_sep = p_tree_item->get_tree()->get_theme_constant(LW_NAME(h_separation));
Ref<Font> font = tree_reference->get_theme_font(LW_NAME(font));
float font_size = tree_reference->get_theme_font_size(LW_NAME(font)) * 0.75;
String num_string = String::num_int64(num_mat);
Vector2 string_size = font->get_string_size(num_string, HORIZONTAL_ALIGNMENT_CENTER, -1, font_size);
Vector2 text_pos = p_rect.position;
text_pos.x += p_rect.size.x - string_size.x - h_sep;
text_pos.y += font->get_descent(font_size) + p_rect.size.y / 2.; // center vertically
font->draw_string(tree_reference->get_canvas_item(), text_pos, num_string, HORIZONTAL_ALIGNMENT_CENTER, -1, font_size);
}
}
void TreeSearch::_update_matching_entries(const String &p_search_mask) {
Vector<TreeItem *> accum;
_find_matching_entries(tree_reference->get_root(), p_search_mask, accum);
matching_entries = accum;
}
/* Linaerizes the tree into [ordered_tree_items] like so:
- i1
- i2
- i3
- i4 ---> [i1,i2,i3,i4]
*/
void TreeSearch::_update_ordered_tree_items(TreeItem *p_tree_item) {
if (!p_tree_item)
return;
if (p_tree_item == p_tree_item->get_tree()->get_root()) {
ordered_tree_items.clear();
}
// Add the current item to the list.
ordered_tree_items.push_back(p_tree_item);
// Recursively collect items from the first child.
TreeItem *child = p_tree_item->get_first_child();
while (child) {
_update_ordered_tree_items(child);
child = child->get_next();
}
}
void TreeSearch::_update_number_matches() {
ERR_FAIL_COND(!tree_reference);
number_matches.clear();
number_matches.reserve(ordered_tree_items.size());
_update_number_matches(tree_reference->get_root());
}
void TreeSearch::_update_number_matches(TreeItem *item) {
for (int i = 0; i < item->get_child_count(); i++) {
TreeItem *child = item->get_child(i);
_update_number_matches(child);
}
int count = _vector_has_bsearch(matching_entries, item) ? 1 : 0;
for (int i = 0; i < item->get_child_count(); i++) {
TreeItem *child = item->get_child(i);
count += number_matches.has(child) ? number_matches.get(child) : 0;
}
if (count == 0) {
return;
}
number_matches[item] = count;
}
String TreeSearch::_get_search_mask() const {
ERR_FAIL_COND_V(!search_panel, "");
return search_panel->get_text();
}
void TreeSearch::_find_matching_entries(TreeItem *p_tree_item, const String &p_search_mask, Vector<TreeItem *> &p_accum) const {
if (!p_tree_item) {
return;
}
StringSearchIndices item_search_indices = _substring_bounds(p_tree_item->get_text(0), p_search_mask);
if (item_search_indices.hit()) {
p_accum.push_back(p_tree_item);
}
for (int i = 0; i < p_tree_item->get_child_count(); i++) {
TreeItem *child = p_tree_item->get_child(i);
_find_matching_entries(child, p_search_mask, p_accum);
}
// Sort the result if we are at the root.
if (p_tree_item == p_tree_item->get_tree()->get_root()) {
p_accum.sort();
}
return;
}
// Returns the lower and upper bounds of a substring. Does fuzzy search: Simply looks if words exist in right ordering.
// Also ignores case if p_search_mask is lowercase. Example:
// p_searcheable = "TimeLimit 2 sec", p_search_mask = limit 2 sec -> [4,14]. With p_search_mask = "LimiT 2 SEC" or "Limit sec 2" -> [-1,-1]
TreeSearch::StringSearchIndices TreeSearch::_substring_bounds(const String &p_searchable, const String &p_search_mask) const {
StringSearchIndices result;
result.lower = UPPER_BOUND;
result.upper = 0;
if (p_search_mask.is_empty()) {
return result; // Early return if search_mask is empty.
}
// Determine if the search should be case-insensitive.
bool is_case_insensitive = (p_search_mask == p_search_mask.to_lower());
String searchable_processed = is_case_insensitive ? p_searchable.to_lower() : p_searchable;
PackedStringArray words = p_search_mask.split(" ");
int word_position = 0;
for (const String &word : words) {
if (word.is_empty()) {
continue; // Skip empty words.
}
String word_processed = is_case_insensitive ? word.to_lower() : word;
// Find the position of the next word in the searchable string.
word_position = searchable_processed.find(word_processed, word_position);
if (word_position < 0) {
// If any word is not found, return an empty StringSearchIndices.
return StringSearchIndices();
}
// Update lower and upper bounds.
result.lower = MIN(result.lower, word_position);
result.upper = MAX(result.upper, static_cast<int>(word_position + word.length()));
}
return result;
}
void TreeSearch::_select_item(TreeItem *p_item) {
if (!p_item)
return;
ERR_FAIL_COND(!tree_reference || p_item->get_tree() != tree_reference);
// First unfold ancestors
TreeItem *ancestor = p_item->get_parent();
while (ancestor) {
ancestor->set_collapsed(false);
ancestor = ancestor->get_parent();
}
// Then scroll to [item]
tree_reference->scroll_to_item(p_item);
// ...and select it
tree_reference->deselect_all();
tree_reference->set_selected(p_item, 0);
}
void TreeSearch::_select_first_match() {
if (matching_entries.size() == 0) {
return;
}
for (int i = 0; i < ordered_tree_items.size(); i++) {
TreeItem *item = ordered_tree_items[i];
if (!_vector_has_bsearch(matching_entries, item)) {
continue;
}
_select_item(item);
return;
}
}
void TreeSearch::_select_last_match() {
if (matching_entries.size() == 0) {
return;
}
for (int i = ordered_tree_items.size() - 1; i >= 0; i--) {
TreeItem *item = ordered_tree_items[i];
if (!_vector_has_bsearch(matching_entries, item)) {
continue;
}
_select_item(item);
return;
}
}
void TreeSearch::_select_previous_match() {
if (matching_entries.size() == 0) {
return;
}
TreeItem *selected = tree_reference->get_selected();
if (!selected) {
_select_last_match();
return;
}
// Find [selected_idx] among ordered_tree_items.
int selected_idx = 0;
for (int i = ordered_tree_items.size() - 1; i >= 0; i--) {
if (ordered_tree_items[i] == selected) {
selected_idx = i;
break;
}
}
// Find first entry before [selected_idx].
for (int i = MIN(ordered_tree_items.size() - 1, selected_idx) - 1; i >= 0; i--) {
TreeItem *item = ordered_tree_items[i];
if (_vector_has_bsearch(matching_entries, item)) {
_select_item(item);
return;
}
}
// Wrap around.
_select_last_match();
}
void TreeSearch::_select_next_match() {
if (matching_entries.size() == 0) {
return;
}
TreeItem *selected = tree_reference->get_selected();
if (!selected) {
_select_first_match();
return;
}
// Find [selected_idx] among ordered_tree_items
int selected_idx = 0;
for (int i = 0; i < ordered_tree_items.size(); i++) {
if (ordered_tree_items[i] == selected) {
selected_idx = i;
break;
}
}
// Find first entry after [selected_idx].
for (int i = MAX(0, selected_idx) + 1; i < ordered_tree_items.size(); i++) {
TreeItem *item = ordered_tree_items[i];
if (_vector_has_bsearch(matching_entries, item)) {
_select_item(item);
return;
}
}
// Wrap around.
_select_first_match();
}
void TreeSearch::_on_search_panel_closed() {
if (!tree_reference) {
return;
}
tree_reference->grab_focus();
}
template <typename T>
inline bool TreeSearch::_vector_has_bsearch(Vector<T *> &p_vec, T *element) const {
int idx = p_vec.bsearch(element, true);
bool in_array = idx >= 0 && idx < p_vec.size();
return in_array && p_vec[idx] == element;
}
void TreeSearch::notify_item_edited(TreeItem *item) {
if (item->get_cell_mode(0) != TreeItem::CELL_MODE_CUSTOM) {
return;
}
_highlight_tree_item(item);
}
// Called as a post-processing step for the already constructed tree.
void TreeSearch::update_search(Tree *p_tree) {
ERR_FAIL_COND(!search_panel || !p_tree);
tree_reference = p_tree;
if (!search_panel->is_visible() || search_panel->get_text().length() == 0) {
// Clear and redraw if search was active recently.
if (was_searched_recently) {
_clear_filter();
number_matches.clear();
matching_entries.clear();
was_searched_recently = false;
p_tree->queue_redraw();
}
return;
}
was_searched_recently = true;
String search_mask = search_panel->get_text();
TreeSearchMode search_mode = search_panel->get_search_mode();
_update_ordered_tree_items(p_tree->get_root());
_update_matching_entries(search_mask);
_update_number_matches();
_highlight_tree();
if (search_mode == TreeSearchMode::FILTER) {
_filter_tree();
was_filtered_recently = true;
} else if (was_filtered_recently) {
_clear_filter();
was_filtered_recently = false;
}
_clean_callable_cache();
}
TreeSearch::TreeSearch(TreeSearchPanel *p_search_panel) {
search_panel = p_search_panel;
search_panel->connect(LW_NAME(text_submitted), callable_mp(this, &TreeSearch::_select_next_match));
search_panel->connect(LW_NAME(Close), callable_mp(this, &TreeSearch::_on_search_panel_closed));
search_panel->connect("select_previous_match", callable_mp(this, &TreeSearch::_select_previous_match));
}
/* !TreeSearch */
/* ------- TreeSearchPanel ------- */
void TreeSearchPanel::_initialize_controls() {
line_edit_search = memnew(LineEdit);
check_button_filter_highlight = memnew(CheckBox);
close_button = memnew(Button);
find_next_button = memnew(Button);
find_prev_button = memnew(Button);
label_filter = memnew(Label);
line_edit_search->set_placeholder(TTR("Search tree"));
close_button->set_theme_type_variation(LW_NAME(FlatButton));
find_next_button->set_theme_type_variation(LW_NAME(FlatButton));
find_prev_button->set_theme_type_variation(LW_NAME(FlatButton));
close_button->set_tooltip_text("Hide");
find_next_button->set_tooltip_text("Next Match");
find_prev_button->set_tooltip_text("Previous Match");
// Positioning and sizing
set_anchors_and_offsets_preset(LayoutPreset::PRESET_BOTTOM_WIDE);
set_v_size_flags(SIZE_SHRINK_CENTER); // Do not expand vertically
line_edit_search->set_h_size_flags(SIZE_EXPAND_FILL);
_add_spacer(0.1); // -> Otherwise the lineedits expand margin touches the left border.
add_child(line_edit_search);
add_child(find_prev_button);
add_child(find_next_button);
_add_spacer(0.25);
add_child(check_button_filter_highlight);
add_child(label_filter);
_add_spacer(0.25);
add_child(close_button);
}
void TreeSearchPanel::_add_spacer(float p_width_multiplier) {
Control *spacer = memnew(Control);
spacer->set_custom_minimum_size(Vector2(8.0 * EDSCALE * p_width_multiplier, 0.0));
add_child(spacer);
}
void TreeSearchPanel::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_READY: {
// Close callbacks
close_button->connect(LW_NAME(pressed), Callable(this, LW_NAME(set_visible)).bind(false));
close_button->connect(LW_NAME(pressed), Callable(this, LW_NAME(emit_signal)).bind(LW_NAME(Close)));
close_button->set_shortcut(LW_GET_SHORTCUT("limbo_ai/hide_tree_search")); // TODO: use internal shortcut.
// Search callbacks
Callable c_update_requested = Callable(this, LW_NAME(emit_signal)).bind("update_requested");
Callable c_text_submitted = Callable(this, LW_NAME(emit_signal)).bind(LW_NAME(text_submitted));
Callable c_select_previous_match = Callable(this, LW_NAME(emit_signal)).bind("select_previous_match");
find_next_button->connect(LW_NAME(pressed), c_text_submitted);
find_prev_button->connect(LW_NAME(pressed), c_select_previous_match);
line_edit_search->connect(LW_NAME(text_changed), c_update_requested.unbind(1));
check_button_filter_highlight->connect(LW_NAME(pressed), c_update_requested);
line_edit_search->connect(LW_NAME(text_submitted), c_text_submitted.unbind(1));
break;
}
case NOTIFICATION_THEME_CHANGED: {
BUTTON_SET_ICON(close_button, get_theme_icon(LW_NAME(Close), LW_NAME(EditorIcons)));
BUTTON_SET_ICON(find_prev_button, get_theme_icon("MoveUp", LW_NAME(EditorIcons)));
BUTTON_SET_ICON(find_next_button, get_theme_icon("MoveDown", LW_NAME(EditorIcons)));
label_filter->set_text(TTR("Filter"));
break;
}
}
}
void TreeSearchPanel::_bind_methods() {
ADD_SIGNAL(MethodInfo("update_requested"));
ADD_SIGNAL(MethodInfo(LW_NAME(text_submitted)));
ADD_SIGNAL(MethodInfo("select_previous_match"));
ADD_SIGNAL(MethodInfo(LW_NAME(Close)));
}
TreeSearchPanel::TreeSearchPanel() {
_initialize_controls();
set_visible(false);
}
TreeSearch::TreeSearchMode TreeSearchPanel::get_search_mode() const {
if (!check_button_filter_highlight || !check_button_filter_highlight->is_pressed()) {
return TreeSearch::TreeSearchMode::HIGHLIGHT;
}
return TreeSearch::TreeSearchMode::FILTER;
}
String TreeSearchPanel::get_text() const {
if (!line_edit_search) {
return String();
}
return line_edit_search->get_text();
}
TreeSearch::SearchInfo TreeSearchPanel::get_search_info() const {
TreeSearch::SearchInfo result;
result.search_mask = get_text();
result.search_mode = get_search_mode();
result.visible = is_visible();
return result;
}
void TreeSearchPanel::set_search_info(const TreeSearch::SearchInfo &p_search_info) {
line_edit_search->set_text(p_search_info.search_mask);
check_button_filter_highlight->set_pressed(p_search_info.search_mode == TreeSearch::TreeSearchMode::FILTER);
set_visible(p_search_info.visible);
emit_signal("update_requested");
}
void TreeSearchPanel::focus_editor() {
line_edit_search->grab_focus();
}
/* !TreeSearchPanel */
#endif // TOOLS_ENABLED

Some files were not shown because too many files have changed in this diff Show More