summaryrefslogtreecommitdiff
path: root/editor/create_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/create_dialog.cpp')
-rw-r--r--editor/create_dialog.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 61ec8abacf..7e59fc31c4 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -32,10 +32,10 @@
#include "core/object/class_db.h"
#include "core/os/keyboard.h"
-#include "editor_feature_profile.h"
-#include "editor_node.h"
-#include "editor_scale.h"
-#include "editor_settings.h"
+#include "editor/editor_feature_profile.h"
+#include "editor/editor_node.h"
+#include "editor/editor_scale.h"
+#include "editor/editor_settings.h"
void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode, const String &p_select_type) {
_fill_type_list();
@@ -235,19 +235,19 @@ void CreateDialog::_add_type(const String &p_type, const TypeCategory p_type_cat
}
} else {
if (ScriptServer::is_global_class(p_type)) {
- inherits = EditorNode::get_editor_data().script_class_get_base(p_type);
- if (inherits.is_empty()) {
- Ref<Script> script = EditorNode::get_editor_data().script_class_load_script(p_type);
- ERR_FAIL_COND(script.is_null());
+ Ref<Script> script = EditorNode::get_editor_data().script_class_load_script(p_type);
+ ERR_FAIL_COND(script.is_null());
- Ref<Script> base = script->get_base_script();
- if (base.is_null()) {
- String extends;
- script->get_language()->get_global_class_name(script->get_path(), &extends);
+ Ref<Script> base = script->get_base_script();
+ if (base.is_null()) {
+ String extends;
+ script->get_language()->get_global_class_name(script->get_path(), &extends);
- inherits = extends;
- inherited_type = TypeCategory::CPP_TYPE;
- } else {
+ inherits = extends;
+ inherited_type = TypeCategory::CPP_TYPE;
+ } else {
+ inherits = script->get_language()->get_global_class_name(base->get_path());
+ if (inherits.is_empty()) {
inherits = base->get_path();
inherited_type = TypeCategory::PATH_TYPE;
}
@@ -429,9 +429,11 @@ void CreateDialog::_notification(int p_what) {
connect("confirmed", callable_mp(this, &CreateDialog::_confirmed));
_update_theme();
} break;
+
case NOTIFICATION_EXIT_TREE: {
disconnect("confirmed", callable_mp(this, &CreateDialog::_confirmed));
} break;
+
case NOTIFICATION_VISIBILITY_CHANGED: {
if (is_visible()) {
search_box->call_deferred(SNAME("grab_focus")); // still not visible
@@ -440,6 +442,7 @@ void CreateDialog::_notification(int p_what) {
EditorSettings::get_singleton()->get_project_metadata("dialog_bounds", "create_new_node", Rect2(get_position(), get_size()));
}
} break;
+
case NOTIFICATION_THEME_CHANGED: {
_update_theme();
} break;