From 9410031d4568e9515f8ea7e067c3bdecc5880eda Mon Sep 17 00:00:00 2001 From: "Wilson E. Alvarez" Date: Fri, 2 Feb 2024 15:04:19 -0500 Subject: [PATCH 1/8] Fix upstream EditorScale header locations Due to upstream change: https://github.com/godotengine/godot/commit/4b55c81ebae48c53e88654a42c04365391b6159d --- editor/action_banner.cpp | 2 +- editor/blackboard_plan_editor.cpp | 2 +- editor/debugger/behavior_tree_view.cpp | 2 +- editor/debugger/limbo_debugger_plugin.cpp | 2 +- editor/limbo_ai_editor_plugin.cpp | 2 +- editor/task_palette.cpp | 2 +- editor/task_tree.cpp | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/editor/action_banner.cpp b/editor/action_banner.cpp index b3764a1e..c779e1c0 100644 --- a/editor/action_banner.cpp +++ b/editor/action_banner.cpp @@ -17,7 +17,7 @@ #include "../util/limbo_string_names.h" #ifdef LIMBOAI_MODULE -#include "editor/editor_scale.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/button.h" #endif // LIMBOAI_MODULE diff --git a/editor/blackboard_plan_editor.cpp b/editor/blackboard_plan_editor.cpp index 82333d2c..9ae3f2b6 100644 --- a/editor/blackboard_plan_editor.cpp +++ b/editor/blackboard_plan_editor.cpp @@ -19,7 +19,7 @@ #ifdef LIMBOAI_MODULE #include "editor/editor_interface.h" -#include "editor/editor_scale.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/line_edit.h" #include "scene/gui/panel_container.h" #include "scene/resources/style_box_flat.h" diff --git a/editor/debugger/behavior_tree_view.cpp b/editor/debugger/behavior_tree_view.cpp index 9520e748..11cba932 100644 --- a/editor/debugger/behavior_tree_view.cpp +++ b/editor/debugger/behavior_tree_view.cpp @@ -24,7 +24,7 @@ #include "core/object/callable_method_pointer.h" #include "core/os/time.h" #include "core/typedefs.h" -#include "editor/editor_scale.h" +#include "editor/themes/editor_scale.h" #include "editor/editor_settings.h" #include "scene/resources/style_box.h" #endif // LIMBOAI_MODULE diff --git a/editor/debugger/limbo_debugger_plugin.cpp b/editor/debugger/limbo_debugger_plugin.cpp index 762b78bf..697796f5 100644 --- a/editor/debugger/limbo_debugger_plugin.cpp +++ b/editor/debugger/limbo_debugger_plugin.cpp @@ -31,9 +31,9 @@ #include "core/variant/array.h" #include "editor/editor_interface.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" #include "editor/filesystem_dock.h" #include "editor/plugins/editor_debugger_plugin.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/box_container.h" #include "scene/gui/control.h" #include "scene/gui/item_list.h" diff --git a/editor/limbo_ai_editor_plugin.cpp b/editor/limbo_ai_editor_plugin.cpp index 467af765..1b7e16ec 100644 --- a/editor/limbo_ai_editor_plugin.cpp +++ b/editor/limbo_ai_editor_plugin.cpp @@ -35,13 +35,13 @@ #include "editor/editor_file_system.h" #include "editor/editor_help.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_undo_redo_manager.h" #include "editor/filesystem_dock.h" #include "editor/inspector_dock.h" #include "editor/plugins/script_editor_plugin.h" #include "editor/project_settings_editor.h" +#include "editor/themes/editor_scale.h" #include "scene/gui/panel_container.h" #include "scene/gui/separator.h" #endif // LIMBOAI_MODULE diff --git a/editor/task_palette.cpp b/editor/task_palette.cpp index 8067b25f..19873225 100644 --- a/editor/task_palette.cpp +++ b/editor/task_palette.cpp @@ -24,7 +24,7 @@ #include "editor/editor_help.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" -#include "editor/editor_scale.h" +#include "editor/themes/editor_scale.h" #include "editor/plugins/script_editor_plugin.h" #include "scene/gui/check_box.h" #endif // LIMBO_MODULE diff --git a/editor/task_tree.cpp b/editor/task_tree.cpp index d28297b7..cbd857c4 100644 --- a/editor/task_tree.cpp +++ b/editor/task_tree.cpp @@ -20,7 +20,7 @@ #ifdef LIMBOAI_MODULE #include "core/object/script_language.h" -#include "editor/editor_scale.h" +#include "editor/themes/editor_scale.h" #endif // LIMBOAI_MODULE #ifdef LIMBOAI_GDEXTENSION From 8f294ac5ea0971980567851027f0cbe9039fe705 Mon Sep 17 00:00:00 2001 From: "Wilson E. Alvarez" Date: Sun, 18 Feb 2024 18:36:36 -0500 Subject: [PATCH 2/8] Migrate to Tree::set_custom_draw_callback Due to upstream change: https://github.com/godotengine/godot/commit/a32a2eaedc5eb8b3e9a01f0458bdd37485037ce9 --- editor/debugger/behavior_tree_view.cpp | 14 +++++++------- editor/task_tree.cpp | 2 +- util/limbo_string_names.cpp | 5 ----- util/limbo_string_names.h | 5 ----- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/editor/debugger/behavior_tree_view.cpp b/editor/debugger/behavior_tree_view.cpp index 11cba932..c8541a7c 100644 --- a/editor/debugger/behavior_tree_view.cpp +++ b/editor/debugger/behavior_tree_view.cpp @@ -127,16 +127,16 @@ void BehaviorTreeView::_update_tree(const Ref &p_data) { if (status_changed) { item->set_metadata(1, current_status); if (current_status == BTTask::SUCCESS) { - item->set_custom_draw(0, this, LW_NAME(_draw_success_status)); + item->set_custom_draw_callback(0, callable_mp(this, &BehaviorTreeView::_draw_success_status)); item->set_icon(1, theme_cache.icon_success); } else if (current_status == BTTask::FAILURE) { - item->set_custom_draw(0, this, LW_NAME(_draw_failure_status)); + item->set_custom_draw_callback(0, callable_mp(this, &BehaviorTreeView::_draw_failure_status)); item->set_icon(1, theme_cache.icon_failure); } else if (current_status == BTTask::RUNNING) { - item->set_custom_draw(0, this, LW_NAME(_draw_running_status)); + item->set_custom_draw_callback(0, callable_mp(this, &BehaviorTreeView::_draw_running_status)); item->set_icon(1, theme_cache.icon_running); } else { - item->set_custom_draw(0, this, LW_NAME(_draw_fresh)); + item->set_custom_draw_callback(0, callable_mp(this, &BehaviorTreeView::_draw_fresh)); item->set_icon(1, nullptr); } } @@ -204,13 +204,13 @@ void BehaviorTreeView::_update_tree(const Ref &p_data) { item->set_icon_max_width(0, 16 * _get_editor_scale()); // Force user icon size. if (task_data.status == BTTask::SUCCESS) { - item->set_custom_draw(0, this, LW_NAME(_draw_success_status)); + item->set_custom_draw_callback(0, callable_mp(this, &BehaviorTreeView::_draw_success_status)); item->set_icon(1, theme_cache.icon_success); } else if (task_data.status == BTTask::FAILURE) { - item->set_custom_draw(0, this, LW_NAME(_draw_failure_status)); + item->set_custom_draw_callback(0, callable_mp(this, &BehaviorTreeView::_draw_failure_status)); item->set_icon(1, theme_cache.icon_failure); } else if (task_data.status == BTTask::RUNNING) { - item->set_custom_draw(0, this, LW_NAME(_draw_running_status)); + item->set_custom_draw_callback(0, callable_mp(this, &BehaviorTreeView::_draw_running_status)); item->set_icon(1, theme_cache.icon_running); } diff --git a/editor/task_tree.cpp b/editor/task_tree.cpp index cbd857c4..7f60119b 100644 --- a/editor/task_tree.cpp +++ b/editor/task_tree.cpp @@ -50,7 +50,7 @@ void TaskTree::_update_item(TreeItem *p_item) { if (p_item->get_parent()) { Ref sel = p_item->get_parent()->get_metadata(0); if (sel.is_valid() && sel->has_probability(p_item->get_index())) { - p_item->set_custom_draw(0, this, LW_NAME(_draw_probability)); + p_item->set_custom_draw_callback(0, callable_mp(this, &TaskTree::_draw_probability)); p_item->set_cell_mode(0, TreeItem::CELL_MODE_CUSTOM); } } diff --git a/util/limbo_string_names.cpp b/util/limbo_string_names.cpp index be1b6f76..32260223 100644 --- a/util/limbo_string_names.cpp +++ b/util/limbo_string_names.cpp @@ -27,11 +27,6 @@ LimboStringNames *LimboStringNames::singleton = nullptr; LimboStringNames::LimboStringNames() { - _draw_failure_status = SN("_draw_failure_status"); - _draw_fresh = SN("_draw_fresh"); - _draw_probability = SN("_draw_probability"); - _draw_running_status = SN("_draw_running_status"); - _draw_success_status = SN("_draw_success_status"); _enter = SN("_enter"); _exit = SN("_exit"); _generate_name = SN("_generate_name"); diff --git a/util/limbo_string_names.h b/util/limbo_string_names.h index 6a7c1483..641b1212 100644 --- a/util/limbo_string_names.h +++ b/util/limbo_string_names.h @@ -43,11 +43,6 @@ class LimboStringNames { public: _FORCE_INLINE_ static LimboStringNames *get_singleton() { return singleton; } - StringName _draw_failure_status; - StringName _draw_fresh; - StringName _draw_probability; - StringName _draw_running_status; - StringName _draw_success_status; StringName _enter; StringName _exit; StringName _generate_name; From ce28ed92d2f4d5b88d7e6e82037c0784c5bac353 Mon Sep 17 00:00:00 2001 From: "Wilson E. Alvarez" Date: Sat, 2 Mar 2024 10:59:01 -0500 Subject: [PATCH 3/8] Fix bottom panel visbility calls Due to upstream change: https://github.com/godotengine/godot/commit/eb6ca91ba6f04a4ff2e21b3ca097c92b6a68dbc8 --- editor/limbo_ai_editor_plugin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/limbo_ai_editor_plugin.cpp b/editor/limbo_ai_editor_plugin.cpp index 1b7e16ec..980bd21b 100644 --- a/editor/limbo_ai_editor_plugin.cpp +++ b/editor/limbo_ai_editor_plugin.cpp @@ -38,6 +38,7 @@ #include "editor/editor_settings.h" #include "editor/editor_undo_redo_manager.h" #include "editor/filesystem_dock.h" +#include "editor/gui/editor_bottom_panel.h" #include "editor/inspector_dock.h" #include "editor/plugins/script_editor_plugin.h" #include "editor/project_settings_editor.h" @@ -690,7 +691,7 @@ void LimboAIEditor::_misc_option_selected(int p_id) { LimboDebuggerPlugin::get_singleton()->get_first_session_window()->set_window_enabled(true); } else { #ifdef LIMBOAI_MODULE - EditorNode::get_singleton()->make_bottom_panel_item_visible(EditorDebuggerNode::get_singleton()); + EditorNode::get_bottom_panel()->make_item_visible(EditorDebuggerNode::get_singleton()); EditorDebuggerNode::get_singleton()->get_default_debugger()->switch_to_debugger( LimboDebuggerPlugin::get_singleton()->get_first_session_tab_index()); #elif LIMBOAI_GDEXTENSION From 022d95434d9c98856e2ae34c641c797b4b37ea09 Mon Sep 17 00:00:00 2001 From: "Wilson E. Alvarez" Date: Sat, 2 Mar 2024 11:09:11 -0500 Subject: [PATCH 4/8] Add missing MarginContainer header Due to upstream change: https://github.com/godotengine/godot/commit/7884d632812996ef26184412846c533276cb4cc0 --- editor/blackboard_plan_editor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/editor/blackboard_plan_editor.cpp b/editor/blackboard_plan_editor.cpp index 9ae3f2b6..5e509c0b 100644 --- a/editor/blackboard_plan_editor.cpp +++ b/editor/blackboard_plan_editor.cpp @@ -21,6 +21,7 @@ #include "editor/editor_interface.h" #include "editor/themes/editor_scale.h" #include "scene/gui/line_edit.h" +#include "scene/gui/margin_container.h" #include "scene/gui/panel_container.h" #include "scene/resources/style_box_flat.h" #endif // LIMBOAI_MODULE From 2f1fd6fb6254274cb89fcd6da1a1ee0655835a96 Mon Sep 17 00:00:00 2001 From: "Wilson E. Alvarez" Date: Sun, 21 Apr 2024 16:26:10 -0400 Subject: [PATCH 5/8] Update EditorHelpBit calls Due to upstream change: https://github.com/godotengine/godot/commit/a714cb9f65faefaa21bef240397ca6d249edd53c --- editor/task_palette.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/task_palette.cpp b/editor/task_palette.cpp index 19873225..f49bb934 100644 --- a/editor/task_palette.cpp +++ b/editor/task_palette.cpp @@ -60,7 +60,7 @@ void TaskButton::_bind_methods() { Control *TaskButton::_do_make_tooltip(const String &p_text) const { #ifdef LIMBOAI_MODULE EditorHelpBit *help_bit = memnew(EditorHelpBit); - help_bit->get_rich_text()->set_custom_minimum_size(Size2(360 * EDSCALE, 1)); + help_bit->set_content_height_limits(1, 360 * EDSCALE); String help_text; if (!p_text.is_empty()) { @@ -69,7 +69,7 @@ Control *TaskButton::_do_make_tooltip(const String &p_text) const { help_text = "[i]" + TTR("No description.") + "[/i]"; } - help_bit->set_text(help_text); + help_bit->set_custom_text(String(), String(), help_text); return help_bit; #endif // LIMBOAI_MODULE From d20d28be78923d6bc2d1b85191807c03615c3f7b Mon Sep 17 00:00:00 2001 From: "Wilson E. Alvarez" Date: Mon, 29 Apr 2024 10:22:08 -0400 Subject: [PATCH 6/8] Update EditorPlugin header location Due to upstream change: https://github.com/godotengine/godot/commit/1bcbbe96c4dcff1b80ac9df12b59d765e2b1efd6 --- editor/limbo_ai_editor_plugin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/limbo_ai_editor_plugin.h b/editor/limbo_ai_editor_plugin.h index 03e74ec9..8d5f8f1e 100644 --- a/editor/limbo_ai_editor_plugin.h +++ b/editor/limbo_ai_editor_plugin.h @@ -26,7 +26,7 @@ #include "core/object/object.h" #include "core/templates/hash_set.h" #include "editor/editor_node.h" -#include "editor/editor_plugin.h" +#include "editor/plugins/editor_plugin.h" #include "editor/gui/editor_spin_slider.h" #include "scene/gui/box_container.h" #include "scene/gui/control.h" From fe597a5a4604d224ad46e63b82d0943a32cea301 Mon Sep 17 00:00:00 2001 From: "Wilson E. Alvarez" Date: Sun, 5 May 2024 08:47:27 -0400 Subject: [PATCH 7/8] Fix GCC warning for unhandled 'PACKED_VECTOR4_ARRAY' in switch Due to upstream change: https://github.com/godotengine/godot/commit/f9b488508ccc294db03d427c15c182864fae74de --- util/limbo_utility.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/util/limbo_utility.cpp b/util/limbo_utility.cpp index 0ab89645..8e6931a5 100644 --- a/util/limbo_utility.cpp +++ b/util/limbo_utility.cpp @@ -516,6 +516,7 @@ PackedInt32Array LimboUtility::get_property_hints_allowed_for_type(Variant::Type case Variant::Type::PACKED_STRING_ARRAY: case Variant::Type::PACKED_VECTOR2_ARRAY: case Variant::Type::PACKED_VECTOR3_ARRAY: + case Variant::Type::PACKED_VECTOR4_ARRAY: case Variant::Type::PACKED_COLOR_ARRAY: case Variant::Type::VARIANT_MAX: { } break; From d2ca303c5ef4756c3fd083f78d669b1b20ddc27f Mon Sep 17 00:00:00 2001 From: "Wilson E. Alvarez" Date: Tue, 7 May 2024 09:17:04 -0400 Subject: [PATCH 8/8] Fix List access Due to upstream change: https://github.com/godotengine/godot/commit/955d5affa857ec1f358c56da8fb1ff4ab6590704 --- blackboard/blackboard_plan.cpp | 2 +- editor/debugger/behavior_tree_data.cpp | 4 ++-- editor/debugger/behavior_tree_view.cpp | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/blackboard/blackboard_plan.cpp b/blackboard/blackboard_plan.cpp index 25ddf9e3..282a5b1f 100644 --- a/blackboard/blackboard_plan.cpp +++ b/blackboard/blackboard_plan.cpp @@ -237,7 +237,7 @@ BBVariable BlackboardPlan::get_var(const StringName &p_name) { Pair BlackboardPlan::get_var_by_index(int p_index) { Pair ret; ERR_FAIL_INDEX_V(p_index, (int)var_map.size(), ret); - return var_list[p_index]; + return var_list.get(p_index); } TypedArray BlackboardPlan::list_vars() const { diff --git a/editor/debugger/behavior_tree_data.cpp b/editor/debugger/behavior_tree_data.cpp index b86265f6..c82312f8 100644 --- a/editor/debugger/behavior_tree_data.cpp +++ b/editor/debugger/behavior_tree_data.cpp @@ -26,7 +26,7 @@ Array BehaviorTreeData::serialize(const Ref &p_tree_instance, const Node List> stack; stack.push_back(p_tree_instance); while (stack.size()) { - Ref task = stack[0]; + Ref task = stack.front()->get(); stack.pop_front(); int num_children = task->get_child_count(); @@ -87,7 +87,7 @@ Ref BehaviorTreeData::create_from_tree_instance(const Ref> stack; stack.push_back(p_tree_instance); while (stack.size()) { - Ref task = stack[0]; + Ref task = stack.front()->get(); stack.pop_front(); int num_children = task->get_child_count(); diff --git a/editor/debugger/behavior_tree_view.cpp b/editor/debugger/behavior_tree_view.cpp index c8541a7c..87fd9343 100644 --- a/editor/debugger/behavior_tree_view.cpp +++ b/editor/debugger/behavior_tree_view.cpp @@ -24,8 +24,8 @@ #include "core/object/callable_method_pointer.h" #include "core/os/time.h" #include "core/typedefs.h" -#include "editor/themes/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/themes/editor_scale.h" #include "scene/resources/style_box.h" #endif // LIMBOAI_MODULE @@ -111,7 +111,7 @@ void BehaviorTreeView::_update_tree(const Ref &p_data) { selected_id = item_get_task_id(tree->get_selected()); } - if (last_root_id != 0 && p_data->tasks.size() > 0 && last_root_id == (uint64_t)p_data->tasks[0].id) { + if (last_root_id != 0 && p_data->tasks.size() > 0 && last_root_id == (uint64_t)p_data->tasks.front()->get().id) { // * Update tree. // ! Update routine is built on assumption that the behavior tree does NOT mutate. With little work it could detect mutations. @@ -120,9 +120,9 @@ void BehaviorTreeView::_update_tree(const Ref &p_data) { while (item) { ERR_FAIL_COND(idx >= p_data->tasks.size()); - const BTTask::Status current_status = (BTTask::Status)p_data->tasks[idx].status; + const BTTask::Status current_status = (BTTask::Status)p_data->tasks.get(idx).status; const BTTask::Status last_status = item_get_task_status(item); - const bool status_changed = last_status != p_data->tasks[idx].status; + const bool status_changed = last_status != p_data->tasks.get(idx).status; if (status_changed) { item->set_metadata(1, current_status); @@ -142,7 +142,7 @@ void BehaviorTreeView::_update_tree(const Ref &p_data) { } if (status_changed || current_status == BTTask::RUNNING) { - _item_set_elapsed_time(item, p_data->tasks[idx].elapsed_time); + _item_set_elapsed_time(item, p_data->tasks.get(idx).elapsed_time); } if (item->get_first_child()) { @@ -165,7 +165,7 @@ void BehaviorTreeView::_update_tree(const Ref &p_data) { } else { // * Create new tree. - last_root_id = p_data->tasks.size() > 0 ? p_data->tasks[0].id : 0; + last_root_id = p_data->tasks.size() > 0 ? p_data->tasks.front()->get().id : 0; tree->clear(); TreeItem *parent = nullptr; @@ -174,7 +174,7 @@ void BehaviorTreeView::_update_tree(const Ref &p_data) { // Figure out parent. parent = nullptr; if (parents.size()) { - Pair &p = parents[0]; + Pair &p = parents.front()->get(); parent = p.first; if (!(--p.second)) { // No children left, remove it.