mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
DocData and type hints fixes
- Makes vararg methods automatically use PROPERTY_USAGE_NIL_IS_VARIANT on return types - Completely removes the ":type" suffix for method names. Virtual methods must use the MethodInfo constructors that takes Variant::Type or PropertyHint as the first parameter for the return type (with CLASS_INFO as a helper to get the PropertyInfo). Parameters must use PROPERTY_HINT_RESOURCE_TYPE and hint string. - PROPERTY_USAGE_NIL_IS_VARIANT is no longer needed for parameters, because parameters cannot be void. - Adds missing PROPERTY_USAGE_NIL_IS_VARIANT to virtual and built-in methods that return Variant.
This commit is contained in:
parent
909c9e0ba0
commit
c16d00591b
15 changed files with 184 additions and 113 deletions
|
@ -2702,7 +2702,10 @@ void VisualScriptCustomNode::_bind_methods() {
|
|||
BIND_VMETHOD(MethodInfo(Variant::STRING, "_get_category"));
|
||||
|
||||
BIND_VMETHOD(MethodInfo(Variant::INT, "_get_working_memory_size"));
|
||||
BIND_VMETHOD(MethodInfo(Variant::NIL, "_step:Variant", PropertyInfo(Variant::ARRAY, "inputs"), PropertyInfo(Variant::ARRAY, "outputs"), PropertyInfo(Variant::INT, "start_mode"), PropertyInfo(Variant::ARRAY, "working_mem")));
|
||||
|
||||
MethodInfo stepmi(Variant::NIL, "_step", PropertyInfo(Variant::ARRAY, "inputs"), PropertyInfo(Variant::ARRAY, "outputs"), PropertyInfo(Variant::INT, "start_mode"), PropertyInfo(Variant::ARRAY, "working_mem"));
|
||||
stepmi.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT;
|
||||
BIND_VMETHOD(stepmi);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_script_changed"), &VisualScriptCustomNode::_script_changed);
|
||||
|
||||
|
@ -2839,7 +2842,9 @@ VisualScriptNodeInstance *VisualScriptSubCall::instance(VisualScriptInstance *p_
|
|||
|
||||
void VisualScriptSubCall::_bind_methods() {
|
||||
|
||||
BIND_VMETHOD(MethodInfo(Variant::NIL, "_subcall:Variant", PropertyInfo(Variant::NIL, "arguments:Variant")));
|
||||
MethodInfo scmi(Variant::NIL, "_subcall", PropertyInfo(Variant::NIL, "arguments"));
|
||||
scmi.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT;
|
||||
BIND_VMETHOD(scmi);
|
||||
}
|
||||
|
||||
VisualScriptSubCall::VisualScriptSubCall() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue