summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-01-11 11:27:08 +0100
committerGitHub <noreply@github.com>2021-01-11 11:27:08 +0100
commit43ab64048373414ed0d88248af50f076e4a48123 (patch)
treead74b1b8dce5048a024ed3e3ff3003f7a399b7f3
parentc3b23f02031dbdc96afa09e40fe51ffe345038ef (diff)
parent7b84f4fc31f40f88575ca7805852d1be9dec3f81 (diff)
Merge pull request #42616 from Calinou/project-settings-no-object
Don't allow adding Objects to the project settings
-rw-r--r--editor/project_settings_editor.cpp9
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);