summaryrefslogtreecommitdiff
path: root/editor/editor_autoload_settings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_autoload_settings.cpp')
-rw-r--r--editor/editor_autoload_settings.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index d46df05f6e..12ae55fbc1 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -327,7 +327,7 @@ void EditorAutoloadSettings::_autoload_file_callback(const String &p_path) {
add_autoload->set_disabled(false);
}
-void EditorAutoloadSettings::_autoload_text_entered(const String p_name) {
+void EditorAutoloadSettings::_autoload_text_submitted(const String p_name) {
if (autoload_add_path->get_text() != "" && _autoload_name_is_valid(p_name, nullptr)) {
_autoload_add();
}
@@ -349,14 +349,14 @@ Node *EditorAutoloadSettings::_create_autoload(const String &p_path) {
Node *n = nullptr;
if (res->is_class("PackedScene")) {
Ref<PackedScene> ps = res;
- n = ps->instance();
+ n = ps->instantiate();
} else if (res->is_class("Script")) {
Ref<Script> s = res;
StringName ibt = s->get_instance_base_type();
bool valid_type = ClassDB::is_parent_class(ibt, "Node");
ERR_FAIL_COND_V_MSG(!valid_type, nullptr, "Script does not inherit a Node: " + p_path + ".");
- Object *obj = ClassDB::instance(ibt);
+ Object *obj = ClassDB::instantiate(ibt);
ERR_FAIL_COND_V_MSG(obj == nullptr, nullptr, "Cannot instance script for autoload, expected 'Node' inheritance, got: " + String(ibt) + ".");
@@ -749,9 +749,9 @@ void EditorAutoloadSettings::autoload_remove(const String &p_name) {
void EditorAutoloadSettings::_bind_methods() {
ClassDB::bind_method("_autoload_open", &EditorAutoloadSettings::_autoload_open);
- ClassDB::bind_method("get_drag_data_fw", &EditorAutoloadSettings::get_drag_data_fw);
- ClassDB::bind_method("can_drop_data_fw", &EditorAutoloadSettings::can_drop_data_fw);
- ClassDB::bind_method("drop_data_fw", &EditorAutoloadSettings::drop_data_fw);
+ ClassDB::bind_method("_get_drag_data_fw", &EditorAutoloadSettings::get_drag_data_fw);
+ ClassDB::bind_method("_can_drop_data_fw", &EditorAutoloadSettings::can_drop_data_fw);
+ ClassDB::bind_method("_drop_data_fw", &EditorAutoloadSettings::drop_data_fw);
ClassDB::bind_method("update_autoload", &EditorAutoloadSettings::update_autoload);
ClassDB::bind_method("autoload_add", &EditorAutoloadSettings::autoload_add);
@@ -859,7 +859,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
autoload_add_name = memnew(LineEdit);
autoload_add_name->set_h_size_flags(SIZE_EXPAND_FILL);
- autoload_add_name->connect("text_entered", callable_mp(this, &EditorAutoloadSettings::_autoload_text_entered));
+ autoload_add_name->connect("text_submitted", callable_mp(this, &EditorAutoloadSettings::_autoload_text_submitted));
autoload_add_name->connect("text_changed", callable_mp(this, &EditorAutoloadSettings::_autoload_text_changed));
hbc->add_child(autoload_add_name);
@@ -882,18 +882,17 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
tree->set_column_title(0, TTR("Name"));
tree->set_column_expand(0, true);
- tree->set_column_min_width(0, 100);
+ tree->set_column_expand_ratio(0, 1);
tree->set_column_title(1, TTR("Path"));
tree->set_column_expand(1, true);
- tree->set_column_min_width(1, 100);
+ tree->set_column_clip_content(1, true);
+ tree->set_column_expand_ratio(1, 2);
- tree->set_column_title(2, TTR("Singleton"));
+ tree->set_column_title(2, TTR("Global Variable"));
tree->set_column_expand(2, false);
- tree->set_column_min_width(2, 80 * EDSCALE);
tree->set_column_expand(3, false);
- tree->set_column_min_width(3, 120 * EDSCALE);
tree->connect("cell_selected", callable_mp(this, &EditorAutoloadSettings::_autoload_selected));
tree->connect("item_edited", callable_mp(this, &EditorAutoloadSettings::_autoload_edited));
@@ -915,7 +914,7 @@ EditorAutoloadSettings::~EditorAutoloadSettings() {
void EditorAutoloadSettings::_set_autoload_add_path(const String &p_text) {
autoload_add_path->set_text(p_text);
- autoload_add_path->emit_signal("text_entered", p_text);
+ autoload_add_path->emit_signal("text_submitted", p_text);
}
void EditorAutoloadSettings::_browse_autoload_add_path() {