diff options
| author | Ignacio Etcheverry | 2017-08-29 07:15:46 +0200 |
|---|---|---|
| committer | Ignacio Etcheverry | 2017-08-29 19:40:21 +0200 |
| commit | c16d00591be623e0b1d6377e6dda7007c0e0d6c4 (patch) | |
| tree | a3ff3cd105bc70f0de07835a79d0fb1b03c938a9 /editor/spatial_editor_gizmos.cpp | |
| parent | 909c9e0ba06eabfc8e21735f09d7a624dfd9fa36 (diff) | |
| download | godot-c16d00591be623e0b1d6377e6dda7007c0e0d6c4.tar.gz godot-c16d00591be623e0b1d6377e6dda7007c0e0d6c4.tar.zst godot-c16d00591be623e0b1d6377e6dda7007c0e0d6c4.zip | |
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.
Diffstat (limited to 'editor/spatial_editor_gizmos.cpp')
| -rw-r--r-- | editor/spatial_editor_gizmos.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index fb5143b48..48c359b02 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -623,9 +623,13 @@ void EditorSpatialGizmo::_bind_methods() { BIND_VMETHOD(MethodInfo("redraw")); BIND_VMETHOD(MethodInfo(Variant::STRING, "get_handle_name", PropertyInfo(Variant::INT, "index"))); - BIND_VMETHOD(MethodInfo("get_handle_value:Variant", PropertyInfo(Variant::INT, "index"))); - BIND_VMETHOD(MethodInfo("set_handle", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::OBJECT, "camera:Camera"), PropertyInfo(Variant::VECTOR2, "point"))); - MethodInfo cm = MethodInfo("commit_handle", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::NIL, "restore:Variant"), PropertyInfo(Variant::BOOL, "cancel")); + + MethodInfo hvget(Variant::NIL, "get_handle_value", PropertyInfo(Variant::INT, "index")); + hvget.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT; + BIND_VMETHOD(hvget); + + BIND_VMETHOD(MethodInfo("set_handle", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera"), PropertyInfo(Variant::VECTOR2, "point"))); + MethodInfo cm = MethodInfo("commit_handle", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::NIL, "restore"), PropertyInfo(Variant::BOOL, "cancel")); cm.default_arguments.push_back(false); BIND_VMETHOD(cm); } |
