summaryrefslogtreecommitdiff
path: root/modules/visual_script/visual_script_flow_control.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-06-30 21:30:17 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-06-30 21:35:05 -0300
commit2a3e00c8c7e6f997b12864755a3df3b9bd3cca05 (patch)
tree807a72e686f76fcf44ecd5fb2e6834545d98b38f /modules/visual_script/visual_script_flow_control.cpp
parente2e73ec906d0671c870ff64eefd15dfc86abaaec (diff)
-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
Diffstat (limited to 'modules/visual_script/visual_script_flow_control.cpp')
-rw-r--r--modules/visual_script/visual_script_flow_control.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/modules/visual_script/visual_script_flow_control.cpp b/modules/visual_script/visual_script_flow_control.cpp
index 07d69db207..28622bed47 100644
--- a/modules/visual_script/visual_script_flow_control.cpp
+++ b/modules/visual_script/visual_script_flow_control.cpp
@@ -30,6 +30,7 @@
#include "visual_script_flow_control.h"
#include "global_config.h"
+#include "io/resource_loader.h"
#include "os/keyboard.h"
//////////////////////////////////////////
@@ -119,8 +120,8 @@ void VisualScriptReturn::_bind_methods() {
argt += "," + Variant::get_type_name(Variant::Type(i));
}
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "return_value/enabled"), "set_enable_return_value", "is_return_value_enabled");
- ADD_PROPERTY(PropertyInfo(Variant::INT, "return_value/type", PROPERTY_HINT_ENUM, argt), "set_return_type", "get_return_type");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "return_enabled"), "set_enable_return_value", "is_return_value_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "return_type", PROPERTY_HINT_ENUM, argt), "set_return_type", "get_return_type");
}
class VisualScriptNodeInstanceReturn : public VisualScriptNodeInstance {
@@ -1725,6 +1726,20 @@ String VisualScriptTypeCast::get_base_script() const {
return script;
}
+VisualScriptTypeCast::TypeGuess VisualScriptTypeCast::guess_output_type(TypeGuess *p_inputs, int p_output) const {
+
+ TypeGuess tg;
+ tg.type = Variant::OBJECT;
+ if (script != String()) {
+ tg.script = ResourceLoader::load(script);
+ }
+ //if (!tg.script.is_valid()) {
+ // tg.gdclass = base_type;
+ //}
+
+ return tg;
+}
+
class VisualScriptNodeInstanceTypeCast : public VisualScriptNodeInstance {
public:
VisualScriptInstance *instance;
@@ -1815,8 +1830,8 @@ void VisualScriptTypeCast::_bind_methods() {
script_ext_hint += "*." + E->get();
}
- ADD_PROPERTY(PropertyInfo(Variant::STRING, "function/base_type", PROPERTY_HINT_TYPE_STRING, "Object"), "set_base_type", "get_base_type");
- ADD_PROPERTY(PropertyInfo(Variant::STRING, "property/base_script", PROPERTY_HINT_FILE, script_ext_hint), "set_base_script", "get_base_script");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "base_type", PROPERTY_HINT_TYPE_STRING, "Object"), "set_base_type", "get_base_type");
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "base_script", PROPERTY_HINT_FILE, script_ext_hint), "set_base_script", "get_base_script");
}
VisualScriptTypeCast::VisualScriptTypeCast() {