From 2a3e00c8c7e6f997b12864755a3df3b9bd3cca05 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 30 Jun 2017 21:30:17 -0300 Subject: -Many fixes to VisualScript, fixed property names, etc. -Added ability to set/get a field in GetSet, as well as assignment ops -Added a Select node -Fixed update bugs related to variable list and exported properties, closes #9458 --- modules/visual_script/register_types.cpp | 1 + modules/visual_script/visual_script.cpp | 14 +- modules/visual_script/visual_script.h | 2 +- modules/visual_script/visual_script_editor.cpp | 304 +++++++++++-------- modules/visual_script/visual_script_editor.h | 24 +- modules/visual_script/visual_script_expression.cpp | 16 +- .../visual_script/visual_script_flow_control.cpp | 23 +- modules/visual_script/visual_script_flow_control.h | 3 + modules/visual_script/visual_script_func_nodes.cpp | 329 +++++++++++++++++---- modules/visual_script/visual_script_func_nodes.h | 30 ++ modules/visual_script/visual_script_nodes.cpp | 195 +++++++++--- modules/visual_script/visual_script_nodes.h | 33 +++ .../visual_script/visual_script_yield_nodes.cpp | 14 +- 13 files changed, 743 insertions(+), 245 deletions(-) (limited to 'modules') diff --git a/modules/visual_script/register_types.cpp b/modules/visual_script/register_types.cpp index c0467a901b..a54d306aff 100644 --- a/modules/visual_script/register_types.cpp +++ b/modules/visual_script/register_types.cpp @@ -90,6 +90,7 @@ void register_visual_script_types() { ClassDB::register_class(); //ClassDB::register_class(); ClassDB::register_class(); + ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index bb8111ce99..a922fdf354 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -140,7 +140,7 @@ VisualScriptNode::TypeGuess VisualScriptNode::guess_output_type(TypeGuess *p_inp tg.type = pinfo.type; if (pinfo.hint == PROPERTY_HINT_RESOURCE_TYPE) { - tg.GDCLASS = pinfo.hint_string; + tg.gdclass = pinfo.hint_string; } return tg; @@ -660,6 +660,9 @@ void VisualScript::set_variable_export(const StringName &p_name, bool p_export) ERR_FAIL_COND(!variables.has(p_name)); variables[p_name]._export = p_export; +#ifdef TOOLS_ENABLED + _update_placeholders(); +#endif } bool VisualScript::get_variable_export(const StringName &p_name) const { @@ -1067,9 +1070,11 @@ void VisualScript::get_script_property_list(List *p_list) const { get_variable_list(&vars); for (List::Element *E = vars.front(); E; E = E->next()) { - if (!variables[E->get()]._export) - continue; - p_list->push_back(variables[E->get()].info); + //if (!variables[E->get()]._export) + // continue; + PropertyInfo pi = variables[E->get()].info; + pi.usage |= PROPERTY_USAGE_SCRIPT_VARIABLE; + p_list->push_back(pi); } } @@ -1358,6 +1363,7 @@ void VisualScriptInstance::get_property_list(List *p_properties) c continue; PropertyInfo p = E->get().info; p.name = String(E->key()); + p.usage |= PROPERTY_USAGE_SCRIPT_VARIABLE; p_properties->push_back(p); } } diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index 20a1cf49c5..cdd7eded18 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -89,7 +89,7 @@ public: struct TypeGuess { Variant::Type type; - StringName GDCLASS; + StringName gdclass; Ref