From 29077d8713742ce9b9e2ca65c409393a4a48b14b Mon Sep 17 00:00:00 2001 From: "Wilson E. Alvarez" Date: Wed, 11 Sep 2024 10:13:42 -0400 Subject: [PATCH 1/4] Update EditorMainScreen calls after its extraction Due to upstream change: https://github.com/godotengine/godot/commit/5e1c9d68aad00ad025a14f4a1907b92a6f7f6310 --- editor/limbo_ai_editor_plugin.h | 2 ++ util/limbo_compat.cpp | 3 ++- util/limbo_compat.h | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/editor/limbo_ai_editor_plugin.h b/editor/limbo_ai_editor_plugin.h index 42e2839..bdbbde3 100644 --- a/editor/limbo_ai_editor_plugin.h +++ b/editor/limbo_ai_editor_plugin.h @@ -26,6 +26,7 @@ #include "core/object/class_db.h" #include "core/object/object.h" #include "core/templates/hash_set.h" +#include "editor/editor_main_screen.h" #include "editor/editor_node.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_spin_slider.h" @@ -42,6 +43,7 @@ #include "scene/gui/popup.h" #include "scene/gui/popup_menu.h" #include "scene/gui/split_container.h" +#include "scene/gui/tab_bar.h" #include "scene/gui/tree.h" #include "scene/resources/texture.h" #endif // LIMBOAI_MODULE diff --git a/util/limbo_compat.cpp b/util/limbo_compat.cpp index 3be7317..6aab45c 100644 --- a/util/limbo_compat.cpp +++ b/util/limbo_compat.cpp @@ -16,6 +16,7 @@ #ifdef TOOLS_ENABLED #include "core/io/resource.h" #include "core/variant/variant.h" +#include "editor/editor_main_screen.h" #include "editor/editor_node.h" #include "editor/plugins/script_editor_plugin.h" #endif // TOOLS_ENABLED @@ -213,7 +214,7 @@ Variant VARIANT_DEFAULT(Variant::Type p_type) { void SHOW_BUILTIN_DOC(const String &p_topic) { #ifdef LIMBOAI_MODULE ScriptEditor::get_singleton()->goto_help(p_topic); - EditorNode::get_singleton()->set_visible_editor(EditorNode::EDITOR_SCRIPT); + EditorNode::get_singleton()->get_editor_main_screen()->select(EditorMainScreen::EDITOR_SCRIPT); #elif LIMBOAI_GDEXTENSION TypedArray open_editors = EditorInterface::get_singleton()->get_script_editor()->get_open_script_editors(); ERR_FAIL_COND_MSG(open_editors.size() == 0, "Can't open help page. Need at least one script open in the script editor."); diff --git a/util/limbo_compat.h b/util/limbo_compat.h index 6f1da9e..68bd59d 100644 --- a/util/limbo_compat.h +++ b/util/limbo_compat.h @@ -28,7 +28,7 @@ #define EDITOR_FILE_SYSTEM() (EditorFileSystem::get_singleton()) #define EDITOR_SETTINGS() (EditorSettings::get_singleton()) #define BASE_CONTROL() (EditorNode::get_singleton()->get_gui_base()) -#define MAIN_SCREEN_CONTROL() (EditorNode::get_singleton()->get_main_screen_control()) +#define MAIN_SCREEN_CONTROL() (EditorNode::get_singleton()->get_editor_main_screen()) #define SCENE_TREE() (SceneTree::get_singleton()) #define IS_DEBUGGER_ACTIVE() (EngineDebugger::is_active()) #define FS_DOCK_SELECT_FILE(m_path) FileSystemDock::get_singleton()->select_file(m_path) @@ -47,7 +47,7 @@ #define GET_PROJECT_SETTINGS_DIR() EditorPaths::get_singleton()->get_project_settings_dir() #define EDIT_RESOURCE(m_res) EditorNode::get_singleton()->edit_resource(m_res) #define INSPECTOR_GET_EDITED_OBJECT() (InspectorDock::get_inspector_singleton()->get_edited_object()) -#define SET_MAIN_SCREEN_EDITOR(m_name) (EditorNode::get_singleton()->select_editor_by_name(m_name)) +#define SET_MAIN_SCREEN_EDITOR(m_name) (EditorNode::get_singleton()->get_editor_main_screen()->select_by_name(m_name)) #define FILE_EXISTS(m_path) FileAccess::exists(m_path) #define DIR_ACCESS_CREATE() DirAccess::create(DirAccess::ACCESS_RESOURCES) #define PERFORMANCE_ADD_CUSTOM_MONITOR(m_id, m_callable) (Performance::get_singleton()->add_custom_monitor(m_id, m_callable, Variant())) From bba1f9c028afb669ed273044fca089ed47c06694 Mon Sep 17 00:00:00 2001 From: "Wilson E. Alvarez" Date: Tue, 17 Sep 2024 13:14:01 -0400 Subject: [PATCH 2/4] Fix unhandled dictionary property hint Due to upstream change: https://github.com/godotengine/godot/commit/9853a691447cd4e279f48820067174d3833b0065 --- util/limbo_utility.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/limbo_utility.cpp b/util/limbo_utility.cpp index e5f16f6..845f63a 100644 --- a/util/limbo_utility.cpp +++ b/util/limbo_utility.cpp @@ -395,6 +395,9 @@ String LimboUtility::get_property_hint_text(PropertyHint p_hint) const { case PROPERTY_HINT_ARRAY_TYPE: { return "ARRAY_TYPE"; } + case PROPERTY_HINT_DICTIONARY_TYPE: { + return "DICTIONARY_TYPE"; + } case PROPERTY_HINT_LOCALE_ID: { return "LOCALE_ID"; } From b322802a064d83302b1ec3a5bf7911624dc3bccc Mon Sep 17 00:00:00 2001 From: "Wilson E. Alvarez" Date: Mon, 30 Sep 2024 08:00:48 -0400 Subject: [PATCH 3/4] Fix unhandled tool button property hint Due to upstream change: https://github.com/godotengine/godot/commit/85dfd896536ff04dba4afd7d461a28e0ac4b9aee --- util/limbo_utility.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/limbo_utility.cpp b/util/limbo_utility.cpp index 845f63a..381cfee 100644 --- a/util/limbo_utility.cpp +++ b/util/limbo_utility.cpp @@ -398,6 +398,9 @@ String LimboUtility::get_property_hint_text(PropertyHint p_hint) const { case PROPERTY_HINT_DICTIONARY_TYPE: { return "DICTIONARY_TYPE"; } + case PROPERTY_HINT_TOOL_BUTTON: { + return "TOOL_BUTTON"; + } case PROPERTY_HINT_LOCALE_ID: { return "LOCALE_ID"; } From 20c4d267001e1907beb3c7d18464eb7ace31cc12 Mon Sep 17 00:00:00 2001 From: "Wilson E. Alvarez" Date: Sat, 2 Nov 2024 20:55:48 -0400 Subject: [PATCH 4/4] Fix internal Button set_icon calls to set_button_icon Due to upstream change: https://github.com/godotengine/godot/commit/562c666e3dfc9f0fe72a33974c23373dff77c825 --- editor/editor_property_bb_param.cpp | 6 +++--- util/limbo_compat.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/editor/editor_property_bb_param.cpp b/editor/editor_property_bb_param.cpp index 5969baa..4ab8e89 100644 --- a/editor/editor_property_bb_param.cpp +++ b/editor/editor_property_bb_param.cpp @@ -287,14 +287,14 @@ void EditorPropertyBBParam::update_property() { variable_editor->update_property(); variable_editor->show(); bottom_container->hide(); - type_choice->set_icon(get_editor_theme_icon(SNAME("LimboExtraVariable"))); + type_choice->set_button_icon(get_editor_theme_icon(SNAME("LimboExtraVariable"))); } else { _create_value_editor(param->get_type()); variable_editor->hide(); value_editor->show(); value_editor->set_object_and_property(param.ptr(), SNAME("saved_value")); value_editor->update_property(); - type_choice->set_icon(get_editor_theme_icon(Variant::get_type_name(param->get_type()))); + type_choice->set_button_icon(get_editor_theme_icon(Variant::get_type_name(param->get_type()))); } } @@ -316,7 +316,7 @@ void EditorPropertyBBParam::_notification(int p_what) { { String type = Variant::get_type_name(_get_edited_param()->get_type()); - type_choice->set_icon(get_editor_theme_icon(type)); + type_choice->set_button_icon(get_editor_theme_icon(type)); } // Initialize type choice. diff --git a/util/limbo_compat.h b/util/limbo_compat.h index 68bd59d..17ae2d5 100644 --- a/util/limbo_compat.h +++ b/util/limbo_compat.h @@ -37,7 +37,7 @@ #define IS_CLASS(m_obj, m_class) (m_obj->is_class_ptr(m_class::get_class_ptr_static())) #define RAND_RANGE(m_from, m_to) (Math::random(m_from, m_to)) #define RANDF() (Math::randf()) -#define BUTTON_SET_ICON(m_btn, m_icon) m_btn->set_icon(m_icon) +#define BUTTON_SET_ICON(m_btn, m_icon) m_btn->set_button_icon(m_icon) #define RESOURCE_LOAD(m_path, m_hint) ResourceLoader::load(m_path, m_hint) #define RESOURCE_LOAD_NO_CACHE(m_path, m_hint) ResourceLoader::load(m_path, m_hint, ResourceFormatLoader::CACHE_MODE_IGNORE) #define RESOURCE_SAVE(m_res, m_path, m_flags) ResourceSaver::save(m_res, m_path, m_flags)