From c9407931b859a1f942abb22c79f5b7067f47a789 Mon Sep 17 00:00:00 2001 From: kobewi Date: Wed, 17 Apr 2024 18:25:28 +0200 Subject: [PATCH] Disable Create button for abstract classes --- editor/create_dialog.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 4c66068953ec..f7914d3aaac0 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -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() {