From 57061413eb0ced8616f69c556b3add5fa45600a6 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 26 Dec 2017 16:32:12 -0300 Subject: Properly rename scenes and resources after renaming or moving files, should fix #13976 It's not tested, so please test. --- editor/editor_data.cpp | 9 ++++++++ editor/editor_data.h | 1 + editor/filesystem_dock.cpp | 55 ++++++++++++++++++++++++++++++++++++++++++++++ editor/filesystem_dock.h | 1 + 4 files changed, 66 insertions(+) diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 49d55e6305..214b1cac89 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -701,6 +701,15 @@ String EditorData::get_scene_title(int p_idx) const { return name; } +void EditorData::set_scene_path(int p_idx, const String &p_path) { + + ERR_FAIL_INDEX(p_idx, edited_scene.size()); + + if (!edited_scene[p_idx].root) + return; + edited_scene[p_idx].root->set_filename(p_path); +} + String EditorData::get_scene_path(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), String()); diff --git a/editor/editor_data.h b/editor/editor_data.h index 33a4091a65..f15b7e37f1 100644 --- a/editor/editor_data.h +++ b/editor/editor_data.h @@ -185,6 +185,7 @@ public: String get_scene_title(int p_idx) const; String get_scene_path(int p_idx) const; String get_scene_type(int p_idx) const; + void set_scene_path(int p_idx, const String &p_path); Ref