From 1cb3b64a29a0d8b5c97efc66686eaa14e1bb48db Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Mon, 21 Aug 2023 11:51:19 +0200 Subject: [PATCH] Add "Misc>Project Settings..." menu option --- editor/limbo_ai_editor_plugin.cpp | 6 ++++++ editor/limbo_ai_editor_plugin.h | 1 + 2 files changed, 7 insertions(+) diff --git a/editor/limbo_ai_editor_plugin.cpp b/editor/limbo_ai_editor_plugin.cpp index 587474e..840cfcb 100644 --- a/editor/limbo_ai_editor_plugin.cpp +++ b/editor/limbo_ai_editor_plugin.cpp @@ -62,6 +62,7 @@ #include "editor/editor_undo_redo_manager.h" #include "editor/inspector_dock.h" #include "editor/plugins/script_editor_plugin.h" +#include "editor/project_settings_editor.h" #include "scene/gui/box_container.h" #include "scene/gui/button.h" #include "scene/gui/control.h" @@ -1091,6 +1092,10 @@ void LimboAIEditor::_misc_option_selected(int p_id) { LimboDebuggerPlugin::get_singleton()->get_session_tab_index()); } } break; + case MISC_PROJECT_SETTINGS: { + ProjectSettingsEditor::get_singleton()->set_general_page("limbo_ai/behavior_tree"); + ProjectSettingsEditor::get_singleton()->popup_project_settings(); + } break; } } @@ -1314,6 +1319,7 @@ void LimboAIEditor::_notification(int p_what) { PopupMenu *misc_menu = misc_btn->get_popup(); misc_menu->clear(); misc_menu->add_icon_shortcut(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("Debug"), SNAME("EditorIcons")), ED_GET_SHORTCUT("limbo_ai/open_debugger"), MISC_OPEN_DEBUGGER); + misc_menu->add_item(TTR("Project Settings..."), MISC_PROJECT_SETTINGS); _update_favorite_tasks(); _update_header(); diff --git a/editor/limbo_ai_editor_plugin.h b/editor/limbo_ai_editor_plugin.h index cb843cc..8ead5e9 100644 --- a/editor/limbo_ai_editor_plugin.h +++ b/editor/limbo_ai_editor_plugin.h @@ -157,6 +157,7 @@ private: enum MiscMenu { MISC_OPEN_DEBUGGER, + MISC_PROJECT_SETTINGS, }; Vector> history;