Fix wrong return value in some virtual method bindings

This commit is contained in:
Rémi Verschelde 2017-12-10 15:10:54 +01:00
parent 6b6f94fb0c
commit 2b41afb30e
8 changed files with 43 additions and 11 deletions

View File

@ -473,8 +473,8 @@ void AStar::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_point_path", "from_id", "to_id"), &AStar::get_point_path); ClassDB::bind_method(D_METHOD("get_point_path", "from_id", "to_id"), &AStar::get_point_path);
ClassDB::bind_method(D_METHOD("get_id_path", "from_id", "to_id"), &AStar::get_id_path); ClassDB::bind_method(D_METHOD("get_id_path", "from_id", "to_id"), &AStar::get_id_path);
BIND_VMETHOD(MethodInfo("_estimate_cost", PropertyInfo(Variant::INT, "from_id"), PropertyInfo(Variant::INT, "to_id"))); BIND_VMETHOD(MethodInfo(Variant::REAL, "_estimate_cost", PropertyInfo(Variant::INT, "from_id"), PropertyInfo(Variant::INT, "to_id")));
BIND_VMETHOD(MethodInfo("_compute_cost", PropertyInfo(Variant::INT, "from_id"), PropertyInfo(Variant::INT, "to_id"))); BIND_VMETHOD(MethodInfo(Variant::REAL, "_compute_cost", PropertyInfo(Variant::INT, "from_id"), PropertyInfo(Variant::INT, "to_id")));
} }
AStar::AStar() { AStar::AStar() {

View File

@ -13,7 +13,7 @@
</demos> </demos>
<methods> <methods>
<method name="_compute_cost" qualifiers="virtual"> <method name="_compute_cost" qualifiers="virtual">
<return type="void"> <return type="float">
</return> </return>
<argument index="0" name="from_id" type="int"> <argument index="0" name="from_id" type="int">
</argument> </argument>
@ -24,7 +24,7 @@
</description> </description>
</method> </method>
<method name="_estimate_cost" qualifiers="virtual"> <method name="_estimate_cost" qualifiers="virtual">
<return type="void"> <return type="float">
</return> </return>
<argument index="0" name="from_id" type="int"> <argument index="0" name="from_id" type="int">
</argument> </argument>

View File

@ -66,7 +66,7 @@
<member name="lossy_storage_quality" type="float" setter="set_lossy_storage_quality" getter="get_lossy_storage_quality"> <member name="lossy_storage_quality" type="float" setter="set_lossy_storage_quality" getter="get_lossy_storage_quality">
The lossy storage quality of the [code]CubeMap[/code] if the storage mode is set to STORAGE_COMPRESS_LOSSY. The lossy storage quality of the [code]CubeMap[/code] if the storage mode is set to STORAGE_COMPRESS_LOSSY.
</member> </member>
<member name="storage_mode" type="CubeMap.Storage" setter="set_storage" getter="get_storage" enum="CubeMap.Storage"> <member name="storage_mode" type="int" setter="set_storage" getter="get_storage" enum="CubeMap.Storage">
The [code]CubeMap[/code]'s storage mode. See [code]STORAGE_*[/code] constants. The [code]CubeMap[/code]'s storage mode. See [code]STORAGE_*[/code] constants.
</member> </member>
</members> </members>

View File

@ -18,7 +18,7 @@
</description> </description>
</method> </method>
<method name="_converts_to" qualifiers="virtual"> <method name="_converts_to" qualifiers="virtual">
<return type="bool"> <return type="String">
</return> </return>
<description> <description>
</description> </description>

View File

@ -233,6 +233,12 @@
<description> <description>
</description> </description>
</method> </method>
<method name="is_hide_on_state_item_selection" qualifiers="const">
<return type="bool">
</return>
<description>
</description>
</method>
<method name="is_item_checkable" qualifiers="const"> <method name="is_item_checkable" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
@ -278,6 +284,14 @@
Removes the item at index "idx" from the menu. Note that the indexes of items after the removed item are going to be shifted by one. Removes the item at index "idx" from the menu. Note that the indexes of items after the removed item are going to be shifted by one.
</description> </description>
</method> </method>
<method name="set_hide_on_state_item_selection">
<return type="void">
</return>
<argument index="0" name="enable" type="bool">
</argument>
<description>
</description>
</method>
<method name="set_item_accelerator"> <method name="set_item_accelerator">
<return type="void"> <return type="void">
</return> </return>
@ -377,6 +391,16 @@
<description> <description>
</description> </description>
</method> </method>
<method name="set_item_statable">
<return type="void">
</return>
<argument index="0" name="idx" type="int">
</argument>
<argument index="1" name="state" type="int">
</argument>
<description>
</description>
</method>
<method name="set_item_submenu"> <method name="set_item_submenu">
<return type="void"> <return type="void">
</return> </return>
@ -417,6 +441,14 @@
<description> <description>
</description> </description>
</method> </method>
<method name="toggle_item_statable">
<return type="void">
</return>
<argument index="0" name="idx" type="int">
</argument>
<description>
</description>
</method>
</methods> </methods>
<members> <members>
<member name="hide_on_checkable_item_selection" type="bool" setter="set_hide_on_checkable_item_selection" getter="is_hide_on_checkable_item_selection"> <member name="hide_on_checkable_item_selection" type="bool" setter="set_hide_on_checkable_item_selection" getter="is_hide_on_checkable_item_selection">

View File

@ -13,7 +13,7 @@
</demos> </demos>
<methods> <methods>
<method name="_forward_subtile_selection" qualifiers="virtual"> <method name="_forward_subtile_selection" qualifiers="virtual">
<return type="void"> <return type="Vector2">
</return> </return>
<argument index="0" name="autotile_id" type="int"> <argument index="0" name="autotile_id" type="int">
</argument> </argument>
@ -27,7 +27,7 @@
</description> </description>
</method> </method>
<method name="_is_tile_bound" qualifiers="virtual"> <method name="_is_tile_bound" qualifiers="virtual">
<return type="void"> <return type="bool">
</return> </return>
<argument index="0" name="drawn_id" type="int"> <argument index="0" name="drawn_id" type="int">
</argument> </argument>

View File

@ -70,7 +70,7 @@ void EditorResourceConversionPlugin::_bind_methods() {
mi.name = "_handles"; mi.name = "_handles";
mi.return_val = PropertyInfo(Variant::BOOL, ""); mi.return_val = PropertyInfo(Variant::BOOL, "");
BIND_VMETHOD(MethodInfo(Variant::BOOL, "_converts_to")); BIND_VMETHOD(MethodInfo(Variant::STRING, "_converts_to"));
} }
String EditorResourceConversionPlugin::converts_to() const { String EditorResourceConversionPlugin::converts_to() const {

View File

@ -932,8 +932,8 @@ void TileSet::_bind_methods() {
ClassDB::bind_method(D_METHOD("find_tile_by_name", "name"), &TileSet::find_tile_by_name); ClassDB::bind_method(D_METHOD("find_tile_by_name", "name"), &TileSet::find_tile_by_name);
ClassDB::bind_method(D_METHOD("get_tiles_ids"), &TileSet::_get_tiles_ids); ClassDB::bind_method(D_METHOD("get_tiles_ids"), &TileSet::_get_tiles_ids);
BIND_VMETHOD(MethodInfo("_is_tile_bound", PropertyInfo(Variant::INT, "drawn_id"), PropertyInfo(Variant::INT, "neighbor_id"))); BIND_VMETHOD(MethodInfo(Variant::BOOL, "_is_tile_bound", PropertyInfo(Variant::INT, "drawn_id"), PropertyInfo(Variant::INT, "neighbor_id")));
BIND_VMETHOD(MethodInfo("_forward_subtile_selection", PropertyInfo(Variant::INT, "autotile_id"), PropertyInfo(Variant::INT, "bitmask"), PropertyInfo(Variant::OBJECT, "tilemap", PROPERTY_HINT_NONE, "TileMap"), PropertyInfo(Variant::VECTOR2, "tile_location"))); BIND_VMETHOD(MethodInfo(Variant::VECTOR2, "_forward_subtile_selection", PropertyInfo(Variant::INT, "autotile_id"), PropertyInfo(Variant::INT, "bitmask"), PropertyInfo(Variant::OBJECT, "tilemap", PROPERTY_HINT_NONE, "TileMap"), PropertyInfo(Variant::VECTOR2, "tile_location")));
BIND_ENUM_CONSTANT(BITMASK_2X2); BIND_ENUM_CONSTANT(BITMASK_2X2);
BIND_ENUM_CONSTANT(BITMASK_3X3); BIND_ENUM_CONSTANT(BITMASK_3X3);