diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2017-08-20 17:45:01 +0200 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2017-08-20 22:07:43 +0200 |
commit | 32dd9a9f668db31e348c5ef5bc181cdb91c07299 (patch) | |
tree | 66d9628611d85ca80f314ee9a65777880ee5ef11 /modules/visual_script | |
parent | f6c39830cb7cf0d664bdfa25642b333a1249b96f (diff) |
ClassDB: Provide the enum name of integer constants
Diffstat (limited to 'modules/visual_script')
-rw-r--r-- | modules/visual_script/visual_script_func_nodes.cpp | 21 | ||||
-rw-r--r-- | modules/visual_script/visual_script_nodes.cpp | 6 | ||||
-rw-r--r-- | modules/visual_script/visual_script_nodes.h | 2 | ||||
-rw-r--r-- | modules/visual_script/visual_script_yield_nodes.cpp | 12 |
4 files changed, 22 insertions, 19 deletions
diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index afdf50027e..065ebc3ccf 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -747,10 +747,10 @@ void VisualScriptFunctionCall::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "validate"), "set_validate", "get_validate"); ADD_PROPERTY(PropertyInfo(Variant::INT, "rpc_call_mode", PROPERTY_HINT_ENUM, "Disabled,Reliable,Unreliable,ReliableToID,UnreliableToID"), "set_rpc_call_mode", "get_rpc_call_mode"); //when set, if loaded properly, will override argument count. - BIND_CONSTANT(CALL_MODE_SELF); - BIND_CONSTANT(CALL_MODE_NODE_PATH); - BIND_CONSTANT(CALL_MODE_INSTANCE); - BIND_CONSTANT(CALL_MODE_BASIC_TYPE); + BIND_ENUM_CONSTANT(CALL_MODE_SELF); + BIND_ENUM_CONSTANT(CALL_MODE_NODE_PATH); + BIND_ENUM_CONSTANT(CALL_MODE_INSTANCE); + BIND_ENUM_CONSTANT(CALL_MODE_BASIC_TYPE); } class VisualScriptNodeInstanceFunctionCall : public VisualScriptNodeInstance { @@ -1490,9 +1490,10 @@ void VisualScriptPropertySet::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::STRING, "property"), "set_property", "get_property"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "index"), "set_index", "get_index"); ADD_PROPERTY(PropertyInfo(Variant::INT, "assign_op", PROPERTY_HINT_ENUM, "Assign,Add,Sub,Mul,Div,Mod,ShiftLeft,ShiftRight,BitAnd,BitOr,Bitxor"), "set_assign_op", "get_assign_op"); - BIND_CONSTANT(CALL_MODE_SELF); - BIND_CONSTANT(CALL_MODE_NODE_PATH); - BIND_CONSTANT(CALL_MODE_INSTANCE); + + BIND_ENUM_CONSTANT(CALL_MODE_SELF); + BIND_ENUM_CONSTANT(CALL_MODE_NODE_PATH); + BIND_ENUM_CONSTANT(CALL_MODE_INSTANCE); } class VisualScriptNodeInstancePropertySet : public VisualScriptNodeInstance { @@ -2202,9 +2203,9 @@ void VisualScriptPropertyGet::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::STRING, "property"), "set_property", "get_property"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "index", PROPERTY_HINT_ENUM), "set_index", "get_index"); - BIND_CONSTANT(CALL_MODE_SELF); - BIND_CONSTANT(CALL_MODE_NODE_PATH); - BIND_CONSTANT(CALL_MODE_INSTANCE); + BIND_ENUM_CONSTANT(CALL_MODE_SELF); + BIND_ENUM_CONSTANT(CALL_MODE_NODE_PATH); + BIND_ENUM_CONSTANT(CALL_MODE_INSTANCE); } class VisualScriptNodeInstancePropertyGet : public VisualScriptNodeInstance { diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index 4f9cd4a33b..15e25c99ee 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -2712,9 +2712,9 @@ void VisualScriptCustomNode::_bind_methods() { ClassDB::bind_method(D_METHOD("_script_changed"), &VisualScriptCustomNode::_script_changed); - BIND_CONSTANT(START_MODE_BEGIN_SEQUENCE); - BIND_CONSTANT(START_MODE_CONTINUE_SEQUENCE); - BIND_CONSTANT(START_MODE_RESUME_YIELD); + BIND_ENUM_CONSTANT(START_MODE_BEGIN_SEQUENCE); + BIND_ENUM_CONSTANT(START_MODE_CONTINUE_SEQUENCE); + BIND_ENUM_CONSTANT(START_MODE_RESUME_YIELD); BIND_CONSTANT(STEP_PUSH_STACK_BIT); BIND_CONSTANT(STEP_GO_BACK_BIT); diff --git a/modules/visual_script/visual_script_nodes.h b/modules/visual_script/visual_script_nodes.h index 6ce906efe0..b5df761e7d 100644 --- a/modules/visual_script/visual_script_nodes.h +++ b/modules/visual_script/visual_script_nodes.h @@ -727,6 +727,8 @@ public: VisualScriptCustomNode(); }; +VARIANT_ENUM_CAST(VisualScriptCustomNode::StartMode); + class VisualScriptSubCall : public VisualScriptNode { GDCLASS(VisualScriptSubCall, VisualScriptNode) diff --git a/modules/visual_script/visual_script_yield_nodes.cpp b/modules/visual_script/visual_script_yield_nodes.cpp index 2e111511b7..df88d2e7f7 100644 --- a/modules/visual_script/visual_script_yield_nodes.cpp +++ b/modules/visual_script/visual_script_yield_nodes.cpp @@ -189,9 +189,9 @@ void VisualScriptYield::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Frame,FixedFrame,Time", PROPERTY_USAGE_NOEDITOR), "set_yield_mode", "get_yield_mode"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "wait_time"), "set_wait_time", "get_wait_time"); - BIND_CONSTANT(YIELD_FRAME); - BIND_CONSTANT(YIELD_FIXED_FRAME); - BIND_CONSTANT(YIELD_WAIT); + BIND_ENUM_CONSTANT(YIELD_FRAME); + BIND_ENUM_CONSTANT(YIELD_FIXED_FRAME); + BIND_ENUM_CONSTANT(YIELD_WAIT); } VisualScriptYield::VisualScriptYield() { @@ -493,9 +493,9 @@ void VisualScriptYieldSignal::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "node_path", PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE), "set_base_path", "get_base_path"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "signal"), "set_signal", "get_signal"); - BIND_CONSTANT(CALL_MODE_SELF); - BIND_CONSTANT(CALL_MODE_NODE_PATH); - BIND_CONSTANT(CALL_MODE_INSTANCE); + BIND_ENUM_CONSTANT(CALL_MODE_SELF); + BIND_ENUM_CONSTANT(CALL_MODE_NODE_PATH); + BIND_ENUM_CONSTANT(CALL_MODE_INSTANCE); } class VisualScriptNodeInstanceYieldSignal : public VisualScriptNodeInstance { |