Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Create button for abstract classes #90807

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion editor/create_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Loading