From a9c6c98a67896c26fd3c1b9e06c799e742058c53 Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Fri, 26 Apr 2019 05:21:28 -0700 Subject: Change order of Visual Script Search. Previously: * vs nodes * properties * methods Now: * properties * methods * vs nodes --- .../visual_script_property_selector.cpp | 67 +++++++++++----------- 1 file changed, 35 insertions(+), 32 deletions(-) (limited to 'modules/visual_script') diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp index ac5f73d113..79f09845ca 100644 --- a/modules/visual_script/visual_script_property_selector.cpp +++ b/modules/visual_script/visual_script_property_selector.cpp @@ -149,22 +149,6 @@ void VisualScriptPropertySelector::_update_search() { Control::get_icon("PoolColorArray", "EditorIcons") }; - if (!seq_connect && !visual_script_generic) { - get_visual_node_names("flow_control/type_cast", Set(), found, root, search_box); - get_visual_node_names("functions/built_in/print", Set(), found, root, search_box); - get_visual_node_names("functions/by_type/" + Variant::get_type_name(type), Set(), found, root, search_box); - get_visual_node_names("operators/compare/", Set(), found, root, search_box); - if (type == Variant::INT) { - get_visual_node_names("operators/bitwise/", Set(), found, root, search_box); - } - if (type == Variant::BOOL) { - get_visual_node_names("operators/logic/", Set(), found, root, search_box); - } - if (type == Variant::BOOL || type == Variant::INT || type == Variant::REAL || type == Variant::VECTOR2 || type == Variant::VECTOR3) { - get_visual_node_names("operators/math/", Set(), found, root, search_box); - } - } - for (List::Element *E = props.front(); E; E = E->next()) { if (E->get().usage == PROPERTY_USAGE_CATEGORY) { if (category && category->get_children() == NULL) { @@ -228,22 +212,7 @@ void VisualScriptPropertySelector::_update_search() { } } - if (seq_connect && !visual_script_generic) { - String text = search_box->get_text(); - create_visualscript_item(String("VisualScriptCondition"), root, text, String("Condition")); - create_visualscript_item(String("VisualScriptSwitch"), root, text, String("Switch")); - create_visualscript_item(String("VisualScriptSequence"), root, text, String("Sequence")); - create_visualscript_item(String("VisualScriptIterator"), root, text, String("Iterator")); - create_visualscript_item(String("VisualScriptWhile"), root, text, String("While")); - create_visualscript_item(String("VisualScriptReturn"), root, text, String("Return")); - get_visual_node_names("flow_control/type_cast", Set(), found, root, search_box); - get_visual_node_names("functions/built_in/print", Set(), found, root, search_box); - } - - if (visual_script_generic) { - get_visual_node_names("", Set(), found, root, search_box); - } - + List methods; if (type != Variant::NIL) { @@ -351,6 +320,40 @@ void VisualScriptPropertySelector::_update_search() { } } + if (properties) { + if (!seq_connect && !visual_script_generic) { + get_visual_node_names("flow_control/type_cast", Set(), found, root, search_box); + get_visual_node_names("functions/built_in/print", Set(), found, root, search_box); + get_visual_node_names("functions/by_type/" + Variant::get_type_name(type), Set(), found, root, search_box); + get_visual_node_names("operators/compare/", Set(), found, root, search_box); + if (type == Variant::INT) { + get_visual_node_names("operators/bitwise/", Set(), found, root, search_box); + } + if (type == Variant::BOOL) { + get_visual_node_names("operators/logic/", Set(), found, root, search_box); + } + if (type == Variant::BOOL || type == Variant::INT || type == Variant::REAL || type == Variant::VECTOR2 || type == Variant::VECTOR3) { + get_visual_node_names("operators/math/", Set(), found, root, search_box); + } + } + } + + if (seq_connect && !visual_script_generic) { + String text = search_box->get_text(); + create_visualscript_item(String("VisualScriptCondition"), root, text, String("Condition")); + create_visualscript_item(String("VisualScriptSwitch"), root, text, String("Switch")); + create_visualscript_item(String("VisualScriptSequence"), root, text, String("Sequence")); + create_visualscript_item(String("VisualScriptIterator"), root, text, String("Iterator")); + create_visualscript_item(String("VisualScriptWhile"), root, text, String("While")); + create_visualscript_item(String("VisualScriptReturn"), root, text, String("Return")); + get_visual_node_names("flow_control/type_cast", Set(), found, root, search_box); + get_visual_node_names("functions/built_in/print", Set(), found, root, search_box); + } + + if (visual_script_generic) { + get_visual_node_names("", Set(), found, root, search_box); + } + TreeItem *selected_item = search_options->search_item_text(search_box->get_text()); if (!found && selected_item != NULL) { selected_item->select(0); -- cgit v1.2.3