diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2023-01-31 17:23:59 +0100 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2023-02-22 19:57:17 +0100 |
commit | 8ebc5b2875bb07e8f002747e8201a1c47e6fedfc (patch) | |
tree | 53e010484a48f56fabc2c07137733ed673914c92 /editor | |
parent | 8612c12be61c0bc50d9039402fe19cabadfe0b16 (diff) |
Disable incompatible rendering methods in the project manager
The project manager can now only create projects that use a rendering
method compatible with the current platform. Rendering methods that
are disabled at build-time are also grayed out (only for OpenGL).
While it is possible in theory to create a project using Forward+
on web (thanks to the automatic fallback),
it will look different once edited on a desktop platform.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_settings.cpp | 9 | ||||
-rw-r--r-- | editor/project_manager.cpp | 14 |
2 files changed, 20 insertions, 3 deletions
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 1c988840ac..a96d6bfc63 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -742,7 +742,16 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { // TRANSLATORS: Project Manager here refers to the tool used to create/manage Godot projects. EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "project_manager/sorting_order", 0, "Last Edited,Name,Path") + +#if defined(WEB_ENABLED) + // Web platform only supports `gl_compatibility`. + EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_NONE, "project_manager/default_renderer", "gl_compatibility", "forward_plus,mobile,gl_compatibility") +#elif defined(ANDROID_ENABLED) + // Use more suitable rendering method by default. + EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_NONE, "project_manager/default_renderer", "mobile", "forward_plus,mobile,gl_compatibility") +#else EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_NONE, "project_manager/default_renderer", "forward_plus", "forward_plus,mobile,gl_compatibility") +#endif if (p_extra_config.is_valid()) { if (p_extra_config->has_section("init_projects") && p_extra_config->has_section_key("init_projects", "list")) { diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index c4f5eb777e..14b678d04d 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -907,33 +907,41 @@ public: Button *rs_button = memnew(CheckBox); rs_button->set_button_group(renderer_button_group); rs_button->set_text(TTR("Forward+")); +#if defined(WEB_ENABLED) + rs_button->set_disabled(true); +#endif rs_button->set_meta(SNAME("rendering_method"), "forward_plus"); rs_button->connect("pressed", callable_mp(this, &ProjectDialog::_renderer_selected)); rvb->add_child(rs_button); if (default_renderer_type == "forward_plus") { rs_button->set_pressed(true); } - rs_button = memnew(CheckBox); rs_button->set_button_group(renderer_button_group); rs_button->set_text(TTR("Mobile")); +#if defined(WEB_ENABLED) + rs_button->set_disabled(true); +#endif rs_button->set_meta(SNAME("rendering_method"), "mobile"); rs_button->connect("pressed", callable_mp(this, &ProjectDialog::_renderer_selected)); rvb->add_child(rs_button); if (default_renderer_type == "mobile") { rs_button->set_pressed(true); } - rs_button = memnew(CheckBox); rs_button->set_button_group(renderer_button_group); rs_button->set_text(TTR("Compatibility")); +#if !defined(GLES3_ENABLED) + rs_button->set_disabled(true); +#endif rs_button->set_meta(SNAME("rendering_method"), "gl_compatibility"); rs_button->connect("pressed", callable_mp(this, &ProjectDialog::_renderer_selected)); rvb->add_child(rs_button); +#if defined(GLES3_ENABLED) if (default_renderer_type == "gl_compatibility") { rs_button->set_pressed(true); } - +#endif rshc->add_child(memnew(VSeparator)); // Right hand side, used for text explaining each choice. |