diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2020-10-07 14:27:25 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-01-10 14:13:20 +0100 |
commit | 7b84f4fc31f40f88575ca7805852d1be9dec3f81 (patch) | |
tree | 2a2cb9068b516f7d455694f5d0bcced45561326a /editor | |
parent | 5a2747d642e55d199a80d773451a851ffe6af2cc (diff) |
Don't allow adding Objects to the project settings
Godot doesn't support serializing objects.
This closes #33667.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/project_settings_editor.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 98cdab0b70..4516180fa5 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -381,9 +381,12 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { type->set_custom_minimum_size(Size2(100, 0) * EDSCALE); hbc->add_child(type); - // Start at 1 to avoid adding "Nil" as an option - for (int i = 1; i < Variant::VARIANT_MAX; i++) { - type->add_item(Variant::get_type_name(Variant::Type(i))); + for (int i = 0; i < Variant::VARIANT_MAX; i++) { + // There's no point in adding Nil types, and Object types + // can't be serialized correctly in the project settings. + if (i != Variant::NIL && i != Variant::OBJECT) { + type->add_item(Variant::get_type_name(Variant::Type(i))); + } } l = memnew(Label); |