summaryrefslogtreecommitdiff
path: root/editor/editor_data.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_data.cpp')
-rw-r--r--editor/editor_data.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index 336bf26607..213c3f5631 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -500,6 +500,7 @@ int EditorData::add_edited_scene(int p_at_pos) {
EditedScene es;
es.root = nullptr;
es.path = String();
+ es.file_modified_time = 0;
es.history_current = -1;
es.version = 0;
es.live_edit_root = NodePath(String("/root"));
@@ -656,6 +657,10 @@ void EditorData::set_edited_scene_root(Node *p_root) {
p_root->set_filename(edited_scene[current_edited_scene].path);
}
}
+
+ if (edited_scene[current_edited_scene].path != "") {
+ edited_scene.write[current_edited_scene].file_modified_time = FileAccess::get_modified_time(edited_scene[current_edited_scene].path);
+ }
}
int EditorData::get_edited_scene_count() const {
@@ -687,6 +692,21 @@ uint64_t EditorData::get_scene_version(int p_idx) const {
return edited_scene[p_idx].version;
}
+void EditorData::set_scene_modified_time(int p_idx, uint64_t p_time) {
+ if (p_idx == -1) {
+ p_idx = current_edited_scene;
+ }
+
+ ERR_FAIL_INDEX(p_idx, edited_scene.size());
+
+ edited_scene.write[p_idx].file_modified_time = p_time;
+}
+
+uint64_t EditorData::get_scene_modified_time(int p_idx) const {
+ ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), 0);
+ return edited_scene[p_idx].file_modified_time;
+}
+
String EditorData::get_scene_type(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), String());
if (!edited_scene[p_idx].root) {
@@ -922,6 +942,14 @@ void EditorData::script_class_save_icon_paths() {
}
}
+ Dictionary old;
+ if (ProjectSettings::get_singleton()->has_setting("_global_script_class_icons")) {
+ old = ProjectSettings::get_singleton()->get("_global_script_class_icons");
+ }
+ if ((!old.is_empty() || d.is_empty()) && d.hash() == old.hash()) {
+ return;
+ }
+
if (d.is_empty()) {
if (ProjectSettings::get_singleton()->has_setting("_global_script_class_icons")) {
ProjectSettings::get_singleton()->clear("_global_script_class_icons");