Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Ensure project.godot exists before running the project in the editor

NoNormalDev669c91bfd0f0
diff --git a/editor/run/editor_run_bar.cpp b/editor/run/editor_run_bar.cpp
index 530555cf0bd..1d61bada7b1 100644
--- a/editor/run/editor_run_bar.cpp
+++ b/editor/run/editor_run_bar.cpp
@@ -265,6 +265,18 @@ void EditorRunBar::_run_scene(const String &p_scene_path, const Vector<String> &
_reset_play_buttons();
+ String resource_path = ProjectSettings::get_singleton()->get_resource_path();
+ if (!resource_path.is_empty()) {
+ String project_file_path = resource_path.path_join("project.godot");
+ if (!FileAccess::exists(project_file_path)) {
+ // TODO: Try to recover the "project.godot" file using ProjectSettings::get_singleton()->save()
+ EditorNode::get_singleton()->show_warning(
+ TTRC("Failed to run the project because the project.godot file is missing."),
+ TTRC("Error!"));
+ return;
+ }
+ }
+
String write_movie_file;
if (is_movie_maker_enabled()) {
if (current_mode == RUN_CURRENT) {