From df92ea02f0194b2c2085a81eee64ca74d3e152fb Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Mon, 28 Aug 2023 13:23:25 +0200 Subject: [PATCH] Remove hard-coded BTComment from toolbar and add it to favorite default instead --- editor/limbo_ai_editor_plugin.cpp | 11 +---------- editor/limbo_ai_editor_plugin.h | 1 - 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/editor/limbo_ai_editor_plugin.cpp b/editor/limbo_ai_editor_plugin.cpp index 0e33d31..3a5a870 100644 --- a/editor/limbo_ai_editor_plugin.cpp +++ b/editor/limbo_ai_editor_plugin.cpp @@ -823,21 +823,12 @@ LimboAIEditor::LimboAIEditor() { PackedStringArray favorite_tasks_default; favorite_tasks_default.append("BTSelector"); favorite_tasks_default.append("BTSequence"); - favorite_tasks_default.append("BTParallel"); + favorite_tasks_default.append("BTComment"); GLOBAL_DEF(PropertyInfo(Variant::PACKED_STRING_ARRAY, "limbo_ai/behavior_tree/favorite_tasks", PROPERTY_HINT_ARRAY_TYPE, "String"), favorite_tasks_default); fav_tasks_hbox = memnew(HBoxContainer); toolbar->add_child(fav_tasks_hbox); - comment_btn = memnew(Button); - comment_btn->set_text(TTR("Comment")); - comment_btn->set_icon(LimboUtility::get_singleton()->get_task_icon("BTComment")); - comment_btn->set_tooltip_text(TTR("Add a BTComment task.")); - comment_btn->set_flat(true); - comment_btn->set_focus_mode(Control::FOCUS_NONE); - comment_btn->connect("pressed", callable_mp(this, &LimboAIEditor::_add_task_by_class_or_path).bind("BTComment")); - toolbar->add_child(comment_btn); - toolbar->add_child(memnew(VSeparator)); new_btn = memnew(Button); diff --git a/editor/limbo_ai_editor_plugin.h b/editor/limbo_ai_editor_plugin.h index 27fc67d..b7dcd01 100644 --- a/editor/limbo_ai_editor_plugin.h +++ b/editor/limbo_ai_editor_plugin.h @@ -74,7 +74,6 @@ private: TaskPalette *task_palette; HBoxContainer *fav_tasks_hbox; - Button *comment_btn; Button *new_btn; Button *load_btn; Button *save_btn;