summaryrefslogtreecommitdiffstats
path: root/editor/create_dialog.cpp
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2023-01-27 12:20:02 +0100
committerkobewi <kobewi4e@gmail.com>2023-01-27 12:26:26 +0100
commit970f5533dd4a7b0f55f224b3224ea882565cf88a (patch)
treeb60a378692d004faeee588c34799ffff0cf2428a /editor/create_dialog.cpp
parent9d555f5c6853c0f97136532d1c71ee3a06fd82dc (diff)
downloadredot-engine-970f5533dd4a7b0f55f224b3224ea882565cf88a.tar.gz
Fix filtering editor nodes in Create Dialog
Diffstat (limited to 'editor/create_dialog.cpp')
-rw-r--r--editor/create_dialog.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 0814d5b5ca..aee907854c 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -122,7 +122,7 @@ bool CreateDialog::_should_hide_type(const String &p_type) const {
return true;
}
- if (base_type == "Node" && p_type.begins_with("Editor")) {
+ if (is_base_type_node && p_type.begins_with("Editor")) {
return true; // Do not show editor nodes.
}
@@ -508,6 +508,11 @@ String CreateDialog::get_selected_type() {
return selected->get_text(0);
}
+void CreateDialog::set_base_type(const String &p_base) {
+ base_type = p_base;
+ is_base_type_node = ClassDB::is_parent_class(p_base, "Node");
+}
+
Variant CreateDialog::instantiate_selected() {
TreeItem *selected = search_options->get_selected();