Editor: Fix issues with property editors & remove old docs

This commit is contained in:
Serhii Snitsaruk 2024-01-29 10:16:24 +01:00
parent 11f43c2494
commit ee0795269d
6 changed files with 15 additions and 53 deletions

View File

@ -27,8 +27,10 @@ extends Resource
@export var dictionary_param: BBDictionary @export var dictionary_param: BBDictionary
@export var array_param: BBArray @export var array_param: BBArray
@export var byte_array_param: BBByteArray @export var byte_array_param: BBByteArray
@export var int_array_param: BBIntArray @export var int32_array_param: BBInt32Array
@export var float_array_param: BBFloatArray @export var int64_array_param: BBInt64Array
@export var float32_array_param: BBFloat32Array
@export var float64_array_param: BBFloat64Array
@export var string_array_param: BBStringArray @export var string_array_param: BBStringArray
@export var vector2_array_param: BBVector2Array @export var vector2_array_param: BBVector2Array
@export var vector3_array_param: BBVector2Array @export var vector3_array_param: BBVector2Array

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/BBFloat.xml.
.. _class_BBFloat:
BBFloat
=======
**Inherits:** :ref:`BBParam<class_BBParam>`
Float-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

@ -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/BBIntArray.xml.
.. _class_BBIntArray:
BBIntArray
==========
**Inherits:** :ref:`BBParam<class_BBParam>`
IntArray-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

@ -280,6 +280,7 @@ void EditorPropertyBBParam::update_property() {
variable_editor->show(); variable_editor->show();
mode_button->call_deferred(SNAME("set_mode"), Mode::BIND_VAR, true); mode_button->call_deferred(SNAME("set_mode"), Mode::BIND_VAR, true);
type_choice->hide(); type_choice->hide();
bottom_container->hide();
} else { } else {
_create_value_editor(param->get_type()); _create_value_editor(param->get_type());
variable_editor->hide(); variable_editor->hide();
@ -316,8 +317,8 @@ void EditorPropertyBBParam::_notification(int p_what) {
// Initialize mode button. // Initialize mode button.
mode_button->clear(); mode_button->clear();
mode_button->add_mode(Mode::SPECIFY_VALUE, get_editor_theme_icon(SNAME("LimboSpecifyValue")), TTR("Mode: Specify value.\nClick to switch mode.")); mode_button->add_mode(Mode::SPECIFY_VALUE, get_editor_theme_icon(SNAME("LimboSpecifyValue")), TTR("Mode: Specify value.\nClick to switch mode."));
mode_button->add_mode(Mode::BIND_VAR, get_editor_theme_icon(SNAME("BTSetVar")), TTR("Mode: Bind blackboard variable.\nClick to switch mode.")); mode_button->add_mode(Mode::BIND_VAR, get_editor_theme_icon(SNAME("BTSetVar")), TTR("Mode: Use blackboard variable.\nClick to switch mode."));
mode_button->set_mode(_get_edited_param()->get_value_source() == BBParam::BLACKBOARD_VAR ? Mode::BIND_VAR : Mode::SPECIFY_VALUE); mode_button->set_mode(_get_edited_param()->get_value_source() == BBParam::BLACKBOARD_VAR ? Mode::BIND_VAR : Mode::SPECIFY_VALUE, true);
bool is_variant_param = _get_edited_param()->is_class_ptr(BBVariant::get_class_ptr_static()); bool is_variant_param = _get_edited_param()->is_class_ptr(BBVariant::get_class_ptr_static());
if (is_variant_param) { if (is_variant_param) {

View File

@ -66,6 +66,8 @@ void EditorPropertyVariableName::_variable_selected(int p_id) {
} }
void EditorPropertyVariableName::_update_status() { void EditorPropertyVariableName::_update_status() {
status_btn->set_visible(plan.is_valid());
drop_btn->set_visible(plan.is_valid());
if (plan.is_null()) { if (plan.is_null()) {
return; return;
} }

View File

@ -256,10 +256,13 @@ void LimboAIEditor::edit_bt(Ref<BehaviorTree> p_behavior_tree, bool p_force_refr
} }
Ref<BlackboardPlan> LimboAIEditor::get_edited_blackboard_plan() { Ref<BlackboardPlan> LimboAIEditor::get_edited_blackboard_plan() {
if (task_tree->get_bt().is_valid()) { if (task_tree->get_bt().is_null()) {
return task_tree->get_bt()->get_blackboard_plan(); return nullptr;
} }
return nullptr; if (task_tree->get_bt()->get_blackboard_plan().is_null()) {
task_tree->get_bt()->set_blackboard_plan(memnew(BlackboardPlan));
}
return task_tree->get_bt()->get_blackboard_plan();
} }
void LimboAIEditor::_mark_as_dirty(bool p_dirty) { void LimboAIEditor::_mark_as_dirty(bool p_dirty) {