summaryrefslogtreecommitdiffstats
path: root/editor/editor_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r--editor/editor_node.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 9b4c39e0d1..efeed648b4 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -1293,6 +1293,12 @@ void EditorNode::edit_resource(const Ref<Resource> &p_resource) {
void EditorNode::save_resource_in_path(const Ref<Resource> &p_resource, const String &p_path) {
editor_data.apply_changes_in_editors();
+
+ if (saving_resources_in_path.has(p_resource)) {
+ return;
+ }
+ saving_resources_in_path.insert(p_resource);
+
int flg = 0;
if (EDITOR_GET("filesystem/on_save/compress_binary_resources")) {
flg |= ResourceSaver::FLAG_COMPRESS;
@@ -1307,10 +1313,16 @@ void EditorNode::save_resource_in_path(const Ref<Resource> &p_resource, const St
} else {
show_accept(TTR("Error saving resource!"), TTR("OK"));
}
+
+ saving_resources_in_path.erase(p_resource);
return;
}
((Resource *)p_resource.ptr())->set_path(path);
+ saving_resources_in_path.erase(p_resource);
+
+ _resource_saved(p_resource, path);
+
emit_signal(SNAME("resource_saved"), p_resource);
editor_data.notify_resource_saved(p_resource);
}
@@ -4738,8 +4750,8 @@ void EditorNode::_dock_floating_close_request(Control *p_control) {
p_control->get_parent()->remove_child(p_control);
dock_slot[window_slot]->add_child(p_control);
- dock_slot[window_slot]->move_child(p_control, MIN((int)window->get_meta("dock_index"), dock_slot[window_slot]->get_tab_count()));
- dock_slot[window_slot]->set_current_tab(window->get_meta("dock_index"));
+ dock_slot[window_slot]->move_child(p_control, MIN((int)window->get_meta("dock_index"), dock_slot[window_slot]->get_tab_count() - 1));
+ dock_slot[window_slot]->set_current_tab(dock_slot[window_slot]->get_tab_idx_from_control(p_control));
dock_slot[window_slot]->set_tab_title(dock_slot[window_slot]->get_tab_idx_from_control(p_control), TTRGET(p_control->get_name()));
window->queue_free();
@@ -4760,7 +4772,7 @@ void EditorNode::_dock_make_float() {
Size2 dock_size = dock->get_size() + borders * 2;
Point2 dock_screen_pos = dock->get_global_position() + get_tree()->get_root()->get_position() - borders;
- int dock_index = dock->get_index();
+ int dock_index = dock->get_index(false);
dock_slot[dock_popup_selected_idx]->remove_child(dock);
Window *window = memnew(Window);
@@ -6511,6 +6523,11 @@ void EditorNode::_renderer_selected(int p_which) {
}
void EditorNode::_resource_saved(Ref<Resource> p_resource, const String &p_path) {
+ if (singleton->saving_resources_in_path.has(p_resource)) {
+ // This is going to be handled by save_resource_in_path when the time is right.
+ return;
+ }
+
if (EditorFileSystem::get_singleton()) {
EditorFileSystem::get_singleton()->update_file(p_path);
}