diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2018-12-02 21:45:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-02 21:45:24 +0100 |
| commit | 8dd00ed1762c4956b3231d709ce0d01ee9b306c8 (patch) | |
| tree | a29c890d9247a78a845cde06271d3bddc972ba72 /editor/plugins/script_editor_plugin.cpp | |
| parent | e2caaf1b6d6fbea95fe410f56e99f1ce6bd66c35 (diff) | |
| parent | 69fe17639e2a5b7ca31ba5ccf2ac49a9b9ae293e (diff) | |
| download | redot-engine-8dd00ed1762c4956b3231d709ce0d01ee9b306c8.tar.gz | |
Merge pull request #24117 from Paulb23/txt_file_last_modified_time
Fix text files constantly asking for reload as no last modified time
Diffstat (limited to 'editor/plugins/script_editor_plugin.cpp')
| -rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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; } |
