1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Update script modified times when saved in EditorNode

This commit is contained in:
kobewi
2025-03-06 14:47:33 +01:00
parent 134da37497
commit dade8bd66f
3 changed files with 19 additions and 0 deletions

View File

@@ -1867,6 +1867,7 @@ int EditorNode::_save_external_resources(bool p_also_save_external_data) {
res->set_edited(false);
}
bool script_was_saved = false;
for (const String &E : edited_resources) {
Ref<Resource> res = ResourceCache::get_ref(E);
if (res.is_null()) {
@@ -1876,10 +1877,18 @@ int EditorNode::_save_external_resources(bool p_also_save_external_data) {
if (ps.is_valid()) {
continue; // Do not save PackedScenes, this will mess up the editor.
}
if (!script_was_saved) {
Ref<Script> scr = res;
script_was_saved = scr.is_valid();
}
ResourceSaver::save(res, res->get_path(), flg);
saved++;
}
if (script_was_saved) {
ScriptEditor::get_singleton()->update_script_times();
}
if (p_also_save_external_data) {
for (int i = 0; i < editor_data.get_editor_plugin_count(); i++) {
EditorPlugin *plugin = editor_data.get_editor_plugin(i);