summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_file_system.cpp6
-rw-r--r--editor/editor_properties.cpp10
-rw-r--r--editor/editor_resource_preview.cpp6
-rw-r--r--editor/plugins/script_editor_plugin.cpp2
-rw-r--r--editor/property_editor.cpp8
-rw-r--r--editor/scene_tree_dock.cpp27
6 files changed, 35 insertions, 24 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index d88c61d7b2..9ca3d387d9 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -233,9 +233,9 @@ void EditorFileSystem::_scan_filesystem() {
FileCache fc;
fc.type = split[1];
- fc.modification_time = split[2].to_int64();
- fc.import_modification_time = split[3].to_int64();
- fc.import_valid = split[4].to_int64() != 0;
+ fc.modification_time = split[2].to_int();
+ fc.import_modification_time = split[3].to_int();
+ fc.import_valid = split[4].to_int() != 0;
fc.import_group_file = split[5].strip_edges();
fc.script_class_name = split[6].get_slice("<>", 0);
fc.script_class_extends = split[6].get_slice("<>", 1);
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index eee610e9a8..23db6ebb4e 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -377,13 +377,13 @@ void EditorPropertyMember::_property_select() {
selector->select_method_from_base_type(hint_text, current);
} else if (hint == MEMBER_METHOD_OF_INSTANCE) {
- Object *instance = ObjectDB::get_instance(ObjectID(hint_text.to_int64()));
+ Object *instance = ObjectDB::get_instance(ObjectID(hint_text.to_int()));
if (instance) {
selector->select_method_from_instance(instance, current);
}
} else if (hint == MEMBER_METHOD_OF_SCRIPT) {
- Object *obj = ObjectDB::get_instance(ObjectID(hint_text.to_int64()));
+ Object *obj = ObjectDB::get_instance(ObjectID(hint_text.to_int()));
if (Object::cast_to<Script>(obj)) {
selector->select_method_from_script(Object::cast_to<Script>(obj), current);
}
@@ -408,13 +408,13 @@ void EditorPropertyMember::_property_select() {
selector->select_property_from_base_type(hint_text, current);
} else if (hint == MEMBER_PROPERTY_OF_INSTANCE) {
- Object *instance = ObjectDB::get_instance(ObjectID(hint_text.to_int64()));
+ Object *instance = ObjectDB::get_instance(ObjectID(hint_text.to_int()));
if (instance) {
selector->select_property_from_instance(instance, current);
}
} else if (hint == MEMBER_PROPERTY_OF_SCRIPT) {
- Object *obj = ObjectDB::get_instance(ObjectID(hint_text.to_int64()));
+ Object *obj = ObjectDB::get_instance(ObjectID(hint_text.to_int()));
if (Object::cast_to<Script>(obj)) {
selector->select_property_from_script(Object::cast_to<Script>(obj), current);
}
@@ -488,7 +488,7 @@ void EditorPropertyEnum::setup(const Vector<String> &p_options) {
for (int i = 0; i < p_options.size(); i++) {
Vector<String> text_split = p_options[i].split(":");
if (text_split.size() != 1) {
- current_val = text_split[1].to_int64();
+ current_val = text_split[1].to_int();
}
options->add_item(text_split[0]);
options->set_item_metadata(i, current_val);
diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp
index 7ac8fae156..d2250fed7a 100644
--- a/editor/editor_resource_preview.cpp
+++ b/editor/editor_resource_preview.cpp
@@ -110,7 +110,7 @@ void EditorResourcePreview::_preview_ready(const String &p_str, const Ref<Textur
uint64_t modified_time = 0;
if (p_str.begins_with("ID:")) {
- hash = uint32_t(p_str.get_slicec(':', 2).to_int64());
+ hash = uint32_t(p_str.get_slicec(':', 2).to_int());
path = "ID:" + p_str.get_slicec(':', 1);
} else {
modified_time = FileAccess::get_modified_time(path);
@@ -257,9 +257,9 @@ void EditorResourcePreview::_thread() {
_generate_preview(texture, small_texture, item, cache_base);
} else {
uint64_t modtime = FileAccess::get_modified_time(item.path);
- int tsize = f->get_line().to_int64();
+ int tsize = f->get_line().to_int();
bool has_small_texture = f->get_line().to_int();
- uint64_t last_modtime = f->get_line().to_int64();
+ uint64_t last_modtime = f->get_line().to_int();
bool cache_valid = true;
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index fd415d40da..72d287c35c 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -538,7 +538,7 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save, bool p_history_back) {
ScriptEditorBase *current = Object::cast_to<ScriptEditorBase>(tab_container->get_child(selected));
if (current) {
if (p_save) {
- apply_scripts();
+ _menu_option(FILE_SAVE);
}
Ref<Script> script = current->get_edited_resource();
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index 49b9ca167b..f4838d336f 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -597,7 +597,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
} else if (hint == PROPERTY_HINT_METHOD_OF_INSTANCE) {
MAKE_PROPSELECT
- Object *instance = ObjectDB::get_instance(ObjectID(hint_text.to_int64()));
+ Object *instance = ObjectDB::get_instance(ObjectID(hint_text.to_int()));
if (instance) {
property_select->select_method_from_instance(instance, v);
}
@@ -607,7 +607,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
} else if (hint == PROPERTY_HINT_METHOD_OF_SCRIPT) {
MAKE_PROPSELECT
- Object *obj = ObjectDB::get_instance(ObjectID(hint_text.to_int64()));
+ Object *obj = ObjectDB::get_instance(ObjectID(hint_text.to_int()));
if (Object::cast_to<Script>(obj)) {
property_select->select_method_from_script(Object::cast_to<Script>(obj), v);
}
@@ -646,7 +646,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
} else if (hint == PROPERTY_HINT_PROPERTY_OF_INSTANCE) {
MAKE_PROPSELECT
- Object *instance = ObjectDB::get_instance(ObjectID(hint_text.to_int64()));
+ Object *instance = ObjectDB::get_instance(ObjectID(hint_text.to_int()));
if (instance) {
property_select->select_property_from_instance(instance, v);
}
@@ -657,7 +657,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
} else if (hint == PROPERTY_HINT_PROPERTY_OF_SCRIPT) {
MAKE_PROPSELECT
- Object *obj = ObjectDB::get_instance(ObjectID(hint_text.to_int64()));
+ Object *obj = ObjectDB::get_instance(ObjectID(hint_text.to_int()));
if (Object::cast_to<Script>(obj)) {
property_select->select_property_from_script(Object::cast_to<Script>(obj), v);
}
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 04ac809d03..9831f1bd31 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -741,17 +741,28 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
_delete_confirm();
} else {
- if (remove_list.size() >= 2) {
- delete_dialog->set_text(vformat(TTR("Delete %d nodes?"), remove_list.size()));
- } else if (remove_list.size() == 1 && remove_list[0] == editor_data->get_edited_scene_root()) {
- delete_dialog->set_text(vformat(TTR("Delete the root node \"%s\"?"), remove_list[0]->get_name()));
- } else if (remove_list.size() == 1 && remove_list[0]->get_filename() == "" && remove_list[0]->get_child_count() >= 1) {
- // Display this message only for non-instanced scenes
- delete_dialog->set_text(vformat(TTR("Delete node \"%s\" and its children?"), remove_list[0]->get_name()));
+ String msg;
+ if (remove_list.size() > 1) {
+ bool any_children = false;
+ for (int i = 0; !any_children && i < remove_list.size(); i++) {
+ any_children = remove_list[i]->get_child_count() > 0;
+ }
+
+ msg = vformat(any_children ? TTR("Delete %d nodes and any children?") : TTR("Delete %d nodes?"), remove_list.size());
} else {
- delete_dialog->set_text(vformat(TTR("Delete node \"%s\"?"), remove_list[0]->get_name()));
+ Node *node = remove_list[0];
+ if (node == editor_data->get_edited_scene_root()) {
+ msg = vformat(TTR("Delete the root node \"%s\"?"), node->get_name());
+ } else if (node->get_filename() == "" && node->get_child_count() > 0) {
+ // Display this message only for non-instanced scenes
+ msg = vformat(TTR("Delete node \"%s\" and its children?"), node->get_name());
+ } else {
+ msg = vformat(TTR("Delete node \"%s\"?"), node->get_name());
+ }
}
+ delete_dialog->set_text(msg);
+
// Resize the dialog to its minimum size.
// This prevents the dialog from being too wide after displaying
// a deletion confirmation for a node with a long name.