From 4a823dcd23d67c3c32f1d797956f10a05bb3dd95 Mon Sep 17 00:00:00 2001 From: Klology Date: Fri, 13 Feb 2026 16:39:26 -0700 Subject: [PATCH] Updated unsaved scene dialog to show the time the scene was opened if the scene was last saved before the editor was stared instead of editor startup time. --- editor/editor_data.cpp | 7 +++++++ editor/editor_data.h | 2 ++ editor/editor_node.cpp | 30 +++++++++++++++++++++--------- editor/editor_node.h | 2 -- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index f84e1685f6..5b25ccf49a 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -34,6 +34,7 @@ #include "core/extension/gdextension_manager.h" #include "core/io/file_access.h" #include "core/io/resource_loader.h" +#include "core/os/time.h" #include "editor/editor_node.h" #include "editor/editor_undo_redo_manager.h" #include "editor/inspector/editor_context_menu_plugin.h" @@ -617,6 +618,7 @@ int EditorData::add_edited_scene(int p_at_pos) { es.history_current = -1; es.live_edit_root = NodePath(String("/root")); es.history_id = last_created_scene++; + es.time_opened = Time::get_singleton()->get_unix_time_from_system(); if (p_at_pos == edited_scene.size()) { edited_scene.push_back(es); @@ -816,6 +818,11 @@ Vector EditorData::get_edited_scenes() const { return out_edited_scenes_list; } +uint64_t EditorData::get_scene_time_opened(int p_idx) const { + ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), 0); + return edited_scene[p_idx].time_opened; +} + void EditorData::set_scene_modified_time(int p_idx, uint64_t p_time) { if (p_idx == -1) { p_idx = current_edited_scene; diff --git a/editor/editor_data.h b/editor/editor_data.h index 9e5cca539a..320ff3c8f6 100644 --- a/editor/editor_data.h +++ b/editor/editor_data.h @@ -122,6 +122,7 @@ public: NodePath live_edit_root; int history_id = 0; uint64_t last_checked_version = 0; + uint64_t time_opened = 0; }; private: @@ -214,6 +215,7 @@ public: String get_scene_type(int p_idx) const; void set_scene_path(int p_idx, const String &p_path); Ref