From 7430711cb7c927bc5617cea1b50d8b3cfd84f21f Mon Sep 17 00:00:00 2001 From: Jayden Sipe Date: Sun, 4 May 2025 18:38:03 -0400 Subject: [PATCH] Show "No Recent Scenes" under `Open Recent` instead of clearing nothing --- editor/editor_node.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 23c5860cb5..dbbca39d18 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4807,14 +4807,19 @@ void EditorNode::_update_recent_scenes() { Array rc = EditorSettings::get_singleton()->get_project_metadata("recent_files", "scenes", Array()); recent_scenes->clear(); - String path; - for (int i = 0; i < rc.size(); i++) { - path = rc[i]; - recent_scenes->add_item(path.replace("res://", ""), i); - } + if (rc.size() == 0) { + recent_scenes->add_item(TTR("No Recent Scenes"), -1); + recent_scenes->set_item_disabled(-1, true); + } else { + String path; + for (int i = 0; i < rc.size(); i++) { + path = rc[i]; + recent_scenes->add_item(path.replace("res://", ""), i); + } - recent_scenes->add_separator(); - recent_scenes->add_shortcut(ED_SHORTCUT("editor/clear_recent", TTRC("Clear Recent Scenes"))); + recent_scenes->add_separator(); + recent_scenes->add_shortcut(ED_SHORTCUT("editor/clear_recent", TTRC("Clear Recent Scenes"))); + } recent_scenes->set_item_auto_translate_mode(-1, AUTO_TRANSLATE_MODE_ALWAYS); recent_scenes->reset_size(); }