diff --git a/src/components/projects/project_item/project_item.gd b/src/components/projects/project_item/project_item.gd index 25ef8789..6339f8c6 100644 --- a/src/components/projects/project_item/project_item.gd +++ b/src/components/projects/project_item/project_item.gd @@ -250,6 +250,12 @@ func _fill_data(item: Projects.Item) -> void: 'run', ]).all(): action.disable(item.is_missing or item.has_invalid_editor) + + for action in _actions.sub_list([ + 'run', + ]).all(): + if not item.has_main_scene: + action.disable(true) func _view_command(item: Projects.Item) -> void: diff --git a/src/main/main.tscn b/src/main/main.tscn index f2907ca0..b8f62a7b 100644 --- a/src/main/main.tscn +++ b/src/main/main.tscn @@ -4,4 +4,4 @@ [node name="Main" type="Node"] script = ExtResource("2_nqr5a") -gui_scene_path = "res://src/main/gui/gui_main.tscn" +gui_scene_path = "uid://omgg45dpxftx" diff --git a/src/services/projects.gd b/src/services/projects.gd index ff7bcc23..ea87f1db 100644 --- a/src/services/projects.gd +++ b/src/services/projects.gd @@ -130,6 +130,9 @@ class Item: var editors_to_bind: Array: get: return _get_editors_to_bind() + var has_main_scene: bool: + get: return _external_project_info.has_main_scene + var is_missing: bool: get: return _external_project_info.is_missing @@ -347,6 +350,9 @@ class ExternalProjectInfo extends RefCounted: var is_missing: bool: get: return _is_missing + var has_main_scene: bool: + get: return _has_main_scene + # TODO type var tags: Array: set(value): @@ -378,6 +384,7 @@ class ExternalProjectInfo extends RefCounted: var _name := "Loading..." var _last_modified: int var _is_missing := false + var _has_main_scene := false var _tags := [] var _features := [] var _config_version := -1 @@ -401,6 +408,7 @@ class ExternalProjectInfo extends RefCounted: _tags = cfg.get_value("application", "config/tags", []) _features = cfg.get_value("application", "config/features", []) _config_version = cfg.get_value("", "config_version", -1) + _has_main_scene = true if cfg.get_value("application", "run/main_scene", false) else false _has_mono_section = cfg.has_section("mono") if cfg.has_section_key("godots", "version_hint"): _version_hint = cfg.get_value("godots", "version_hint")