Merge pull request #90807 from KoBeWi/creating_this_thing_is_strictly_prohibited_in_13_states

Disable Create button for abstract classes
This commit is contained in:
Rémi Verschelde 2024-04-17 20:26:43 +02:00
commit 75e772c528
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -516,7 +516,14 @@ void CreateDialog::select_type(const String &p_type, bool p_center_on_item) {
favorite->set_disabled(false);
favorite->set_pressed(favorite_list.has(p_type));
get_ok_button()->set_disabled(false);
if (to_select->get_meta("__instantiable", true)) {
get_ok_button()->set_disabled(false);
get_ok_button()->set_tooltip_text(String());
} else {
get_ok_button()->set_disabled(true);
get_ok_button()->set_tooltip_text(TTR("The selected class can't be instantiated."));
}
}
void CreateDialog::select_base() {