diff options
author | clayjohn <claynjohn@gmail.com> | 2023-04-21 16:51:57 -0700 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-04-26 14:31:53 +0200 |
commit | c8ed59ba41637c1ab119463c64ca00477b257a5b (patch) | |
tree | 4e869a4926f0d87b28ea37cf63bdc54f4ec4e6df /editor | |
parent | f5721ca61ac0134907bf3dc20dc672f19a04b5a7 (diff) |
Validate renderer selection in project manager and change default renderer editor setting to expose an enum to users
(cherry picked from commit 48ebae7812c7dda1bbe39e419e75ba9c0c32eea7)
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_settings.cpp | 6 | ||||
-rw-r--r-- | editor/project_manager.cpp | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 25c84e7447..a9a2c23e41 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -749,12 +749,12 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { #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") + EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_ENUM, "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") + EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_ENUM, "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") + EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_ENUM, "project_manager/default_renderer", "forward_plus", "forward_plus,mobile,gl_compatibility") #endif if (p_extra_config.is_valid()) { diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 75773edc86..4f10fe5108 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -434,6 +434,8 @@ private: } void _renderer_selected() { + ERR_FAIL_COND(!renderer_button_group->get_pressed_button()); + String renderer_type = renderer_button_group->get_pressed_button()->get_meta(SNAME("rendering_method")); if (renderer_type == "forward_plus") { |