summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_inspector.cpp22
-rw-r--r--editor/plugins/item_list_editor_plugin.cpp4
-rw-r--r--editor/plugins/script_editor_plugin.cpp8
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp2
4 files changed, 26 insertions, 10 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index b50af93352..10c9974cdd 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -128,18 +128,22 @@ void EditorProperty::_notification(int p_what) {
bottom_rect = Rect2(m, rect.size.height + get_constant("vseparation", "Tree"), size.width - m, bottom_editor->get_combined_minimum_size().height);
}
- }
- if (keying) {
- Ref<Texture> key;
+ if (keying) {
+ Ref<Texture> key;
- if (use_keying_next()) {
- key = get_icon("KeyNext", "EditorIcons");
- } else {
- key = get_icon("Key", "EditorIcons");
- }
+ if (use_keying_next()) {
+ key = get_icon("KeyNext", "EditorIcons");
+ } else {
+ key = get_icon("Key", "EditorIcons");
+ }
- rect.size.x -= key->get_width() + get_constant("hseparator", "Tree");
+ rect.size.x -= key->get_width() + get_constant("hseparator", "Tree");
+
+ if (no_children) {
+ text_size -= key->get_width() + 4 * EDSCALE;
+ }
+ }
}
//set children
diff --git a/editor/plugins/item_list_editor_plugin.cpp b/editor/plugins/item_list_editor_plugin.cpp
index 8df40232b0..a32f42cc56 100644
--- a/editor/plugins/item_list_editor_plugin.cpp
+++ b/editor/plugins/item_list_editor_plugin.cpp
@@ -265,6 +265,9 @@ void ItemListEditor::_notification(int p_notification) {
add_button->set_icon(get_icon("Add", "EditorIcons"));
del_button->set_icon(get_icon("Remove", "EditorIcons"));
+ } else if (p_notification == NOTIFICATION_READY) {
+
+ get_tree()->connect("node_removed", this, "_node_removed");
}
}
@@ -341,6 +344,7 @@ bool ItemListEditor::handles(Object *p_object) const {
void ItemListEditor::_bind_methods() {
+ ClassDB::bind_method("_node_removed", &ItemListEditor::_node_removed);
ClassDB::bind_method("_edit_items", &ItemListEditor::_edit_items);
ClassDB::bind_method("_add_button", &ItemListEditor::_add_pressed);
ClassDB::bind_method("_delete_button", &ItemListEditor::_delete_pressed);
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index ae6fa8e6bb..0bbe08821a 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -1815,6 +1815,10 @@ Ref<TextFile> ScriptEditor::_load_text_file(const String &p_path, Error *r_error
text_file->set_file_path(local_path);
text_file->set_path(local_path, true);
+ if (ResourceLoader::get_timestamp_on_load()) {
+ text_file->set_last_modified_time(FileAccess::get_modified_time(path));
+ }
+
if (r_error) {
*r_error = OK;
}
@@ -1844,6 +1848,10 @@ Error ScriptEditor::_save_text_file(Ref<TextFile> p_text_file, const String &p_p
file->close();
memdelete(file);
+ if (ResourceSaver::get_timestamp_on_save()) {
+ p_text_file->set_last_modified_time(FileAccess::get_modified_time(p_path));
+ }
+
_res_saved_callback(sqscr);
return OK;
}
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index a5563c0497..cc5f50a834 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -3238,7 +3238,7 @@ bool SpatialEditorViewport::_create_instance(Node *parent, String &path, const P
if (mesh != NULL) {
MeshInstance *mesh_instance = memnew(MeshInstance);
mesh_instance->set_mesh(mesh);
- mesh_instance->set_name(mesh->get_name());
+ mesh_instance->set_name(path.get_file().get_basename());
instanced_scene = mesh_instance;
} else {
if (!scene.is_valid()) { // invalid scene