Don't allow adding Objects to the project settings

Godot doesn't support serializing objects.

This closes #33667.

(cherry picked from commit 7b84f4fc31)
This commit is contained in:
Hugo Locurcio 2020-10-07 14:27:25 +02:00 committed by Rémi Verschelde
parent 52e674ded1
commit 952a089551
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -1827,9 +1827,12 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) {
type->set_h_size_flags(Control::SIZE_EXPAND_FILL); type->set_h_size_flags(Control::SIZE_EXPAND_FILL);
add_prop_bar->add_child(type); add_prop_bar->add_child(type);
// Start at 1 to avoid adding "Nil" as an option for (int i = 0; i < Variant::VARIANT_MAX; i++) {
for (int i = 1; i < Variant::VARIANT_MAX; i++) { // There's no point in adding Nil types, and Object types
type->add_item(Variant::get_type_name(Variant::Type(i))); // 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)));
}
} }
Button *add = memnew(Button); Button *add = memnew(Button);