Skip to content

Commit

Permalink
Merge pull request #42616 from Calinou/project-settings-no-object
Browse files Browse the repository at this point in the history
Don't allow adding Objects to the project settings
  • Loading branch information
akien-mga authored Jan 11, 2021
2 parents c3b23f0 + 7b84f4f commit 43ab640
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions editor/project_settings_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 43ab640

Please sign in to comment.