Make visualscript search better.

* There were spaces unequally inside the function definitions.
* camelcase_to_underscore() should also work for numbers inside of the camel case.
* Removed the builtin concept
* Capitalize descriptions from methods too.
* Match the visual script functions by removing the empty arguments "( )"
* Add some test cases
This commit is contained in:
K. S. Ernest (iFire) Lee 2018-09-29 21:33:21 -07:00
parent 451e5fd051
commit 47b42787e3
4 changed files with 186 additions and 72 deletions

View file

@ -3708,18 +3708,18 @@ void register_visual_script_nodes() {
for (List<MethodInfo>::Element *E = constructors.front(); E; E = E->next()) {
if (E->get().arguments.size() > 0) {
String name = "functions/constructors/" + Variant::get_type_name(Variant::Type(i)) + " ( ";
String name = "functions/constructors/" + Variant::get_type_name(Variant::Type(i)) + "(";
for (int j = 0; j < E->get().arguments.size(); j++) {
if (j > 0)
if (j > 0) {
name += ", ";
if (E->get().arguments.size() == 1)
}
if (E->get().arguments.size() == 1) {
name += Variant::get_type_name(E->get().arguments[j].type);
else
} else {
name += E->get().arguments[j].name;
}
}
name += ") ";
name += ")";
VisualScriptLanguage::singleton->add_register_func(name, create_constructor_node);
Pair<Variant::Type, MethodInfo> pair;
pair.first = Variant::Type(i);