From 4e6420b5a8a011c7912765dc988d5f8f9bf67a63 Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Fri, 26 Apr 2019 05:40:35 -0700 Subject: [PATCH] VS: Better ux * In VS functions' put the current node type first. * Cleanup and merge property and method sections. --- .../visual_script_property_selector.cpp | 338 ++++++++---------- 1 file changed, 141 insertions(+), 197 deletions(-) diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp index 79f09845ca1..ceec79c0d5a 100644 --- a/modules/visual_script/visual_script_property_selector.cpp +++ b/modules/visual_script/visual_script_property_selector.cpp @@ -87,38 +87,17 @@ void VisualScriptPropertySelector::_update_search() { TreeItem *root = search_options->create_item(); bool found = false; + StringName base = base_type; + List base_list; + while (base) { + base_list.push_back(base); + base = ClassDB::get_parent_class_nocheck(base); + } - if (properties) { - + for (List::Element *E = base_list.front(); E; E = E->next()) { + List methods; List props; - - if (instance) { - instance->get_property_list(&props, true); - } else if (type != Variant::NIL) { - Variant v; - Variant::CallError ce; - v = Variant::construct(type, NULL, 0, ce); - - v.get_property_list(&props); - } else { - - Object *obj = ObjectDB::get_instance(script); - if (Object::cast_to