File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed
Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1867,6 +1867,7 @@ int EditorNode::_save_external_resources(bool p_also_save_external_data) {
18671867 res->set_edited (false );
18681868 }
18691869
1870+ bool script_was_saved = false ;
18701871 for (const String &E : edited_resources) {
18711872 Ref<Resource> res = ResourceCache::get_ref (E);
18721873 if (res.is_null ()) {
@@ -1876,10 +1877,18 @@ int EditorNode::_save_external_resources(bool p_also_save_external_data) {
18761877 if (ps.is_valid ()) {
18771878 continue ; // Do not save PackedScenes, this will mess up the editor.
18781879 }
1880+ if (!script_was_saved) {
1881+ Ref<Script> scr = res;
1882+ script_was_saved = scr.is_valid ();
1883+ }
18791884 ResourceSaver::save (res, res->get_path (), flg);
18801885 saved++;
18811886 }
18821887
1888+ if (script_was_saved) {
1889+ ScriptEditor::get_singleton ()->update_script_times ();
1890+ }
1891+
18831892 if (p_also_save_external_data) {
18841893 for (int i = 0 ; i < editor_data.get_editor_plugin_count (); i++) {
18851894 EditorPlugin *plugin = editor_data.get_editor_plugin (i);
Original file line number Diff line number Diff line change @@ -2817,6 +2817,15 @@ void ScriptEditor::save_all_scripts() {
28172817 _update_script_names ();
28182818}
28192819
2820+ void ScriptEditor::update_script_times () {
2821+ for (int i = 0 ; i < tab_container->get_tab_count (); i++) {
2822+ ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(tab_container->get_tab_control (i));
2823+ if (se) {
2824+ se->edited_file_data .last_modified_time = FileAccess::get_modified_time (se->edited_file_data .path );
2825+ }
2826+ }
2827+ }
2828+
28202829void ScriptEditor::apply_scripts () const {
28212830 for (int i = 0 ; i < tab_container->get_tab_count (); i++) {
28222831 ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(tab_container->get_tab_control (i));
Original file line number Diff line number Diff line change @@ -569,6 +569,7 @@ class ScriptEditor : public PanelContainer {
569569 PackedStringArray get_unsaved_scripts () const ;
570570 void save_current_script ();
571571 void save_all_scripts ();
572+ void update_script_times ();
572573
573574 void set_window_layout (Ref<ConfigFile> p_layout);
574575 void get_window_layout (Ref<ConfigFile> p_layout);
You can’t perform that action at this time.
0 commit comments