Browse Source

Fixed the default value for Input.action_press() from commit 8c45282

Davide Baldo 6 years ago
parent
commit
b98263013a
2 changed files with 4 additions and 3 deletions
  1. 1 1
      core/os/input.cpp
  2. 3 2
      doc/classes/Input.xml

+ 1 - 1
core/os/input.cpp

@@ -86,7 +86,7 @@ void Input::_bind_methods() {
 	ClassDB::bind_method(D_METHOD("set_mouse_mode", "mode"), &Input::set_mouse_mode);
 	ClassDB::bind_method(D_METHOD("set_mouse_mode", "mode"), &Input::set_mouse_mode);
 	ClassDB::bind_method(D_METHOD("get_mouse_mode"), &Input::get_mouse_mode);
 	ClassDB::bind_method(D_METHOD("get_mouse_mode"), &Input::get_mouse_mode);
 	ClassDB::bind_method(D_METHOD("warp_mouse_position", "to"), &Input::warp_mouse_position);
 	ClassDB::bind_method(D_METHOD("warp_mouse_position", "to"), &Input::warp_mouse_position);
-	ClassDB::bind_method(D_METHOD("action_press", "action", "strength"), &Input::action_press);
+	ClassDB::bind_method(D_METHOD("action_press", "action", "strength"), &Input::action_press, DEFVAL(1.f));
 	ClassDB::bind_method(D_METHOD("action_release", "action"), &Input::action_release);
 	ClassDB::bind_method(D_METHOD("action_release", "action"), &Input::action_release);
 	ClassDB::bind_method(D_METHOD("set_default_cursor_shape", "shape"), &Input::set_default_cursor_shape, DEFVAL(CURSOR_ARROW));
 	ClassDB::bind_method(D_METHOD("set_default_cursor_shape", "shape"), &Input::set_default_cursor_shape, DEFVAL(CURSOR_ARROW));
 	ClassDB::bind_method(D_METHOD("set_custom_mouse_cursor", "image", "shape", "hotspot"), &Input::set_custom_mouse_cursor, DEFVAL(CURSOR_ARROW), DEFVAL(Vector2()));
 	ClassDB::bind_method(D_METHOD("set_custom_mouse_cursor", "image", "shape", "hotspot"), &Input::set_custom_mouse_cursor, DEFVAL(CURSOR_ARROW), DEFVAL(Vector2()));

+ 3 - 2
doc/classes/Input.xml

@@ -17,10 +17,11 @@
 			</return>
 			</return>
 			<argument index="0" name="action" type="String">
 			<argument index="0" name="action" type="String">
 			</argument>
 			</argument>
-			<argument index="1" name="strength" type="float">
+			<argument index="1" name="strength" type="float" default="1.0">
 			</argument>
 			</argument>
 			<description>
 			<description>
-				This will simulate pressing the specified action. The strength can be used for non-boolean actions.
+				This will simulate pressing the specified action.
+				The strength can be used for non-boolean actions, it's ranged between 0 and 1 representing the intensity of the given action.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="action_release">
 		<method name="action_release">