|
30 | 30 |
|
31 | 31 | #ifndef DISABLE_DEPRECATED
|
32 | 32 |
|
| 33 | +bool Input::_is_action_pressed_bind_compat_102412(const StringName &p_action, bool p_exact) const { |
| 34 | + return is_action_pressed(p_action, p_exact, PlayerId::P1); |
| 35 | +} |
| 36 | + |
| 37 | +bool Input::_is_action_just_pressed_bind_compat_102412(const StringName &p_action, bool p_exact) const { |
| 38 | + return is_action_just_pressed(p_action, p_exact, PlayerId::P1); |
| 39 | +} |
| 40 | + |
| 41 | +bool Input::_is_action_just_released_bind_compat_102412(const StringName &p_action, bool p_exact) const { |
| 42 | + return is_action_just_released(p_action, p_exact, PlayerId::P1); |
| 43 | +} |
| 44 | + |
| 45 | +float Input::_get_action_strength_bind_compat_102412(const StringName &p_action, bool p_exact) const { |
| 46 | + return get_action_strength(p_action, p_exact, PlayerId::P1); |
| 47 | +} |
| 48 | + |
| 49 | +float Input::_get_action_raw_strength_bind_compat_102412(const StringName &p_action, bool p_exact) const { |
| 50 | + return get_action_raw_strength(p_action, p_exact, PlayerId::P1); |
| 51 | +} |
| 52 | + |
| 53 | +float Input::_get_axis_bind_compat_102412(const StringName &p_negative_action, const StringName &p_positive_action) const { |
| 54 | + return get_axis(p_negative_action, p_positive_action, PlayerId::P1); |
| 55 | +} |
| 56 | + |
| 57 | +Vector2 Input::_get_vector_bind_compat_102412(const StringName &p_negative_x, const StringName &p_positive_x, const StringName &p_negative_y, const StringName &p_positive_y, float p_deadzone) const { |
| 58 | + return get_vector(p_negative_x, p_positive_x, p_negative_y, p_positive_y, p_deadzone, PlayerId::P1); |
| 59 | +} |
| 60 | + |
| 61 | +void Input::_action_press_bind_compat_102412(const StringName &p_action, float p_strength) { |
| 62 | + action_press(p_action, p_strength, PlayerId::P1); |
| 63 | +} |
| 64 | + |
| 65 | +void Input::_action_release_bind_compat_102412(const StringName &p_action) { |
| 66 | + action_release(p_action, PlayerId::P1); |
| 67 | +} |
| 68 | + |
33 | 69 | void Input::_vibrate_handheld_bind_compat_91143(int p_duration_ms) {
|
34 | 70 | vibrate_handheld(p_duration_ms, -1.0);
|
35 | 71 | }
|
36 | 72 |
|
37 | 73 | void Input::_bind_compatibility_methods() {
|
| 74 | + ClassDB::bind_compatibility_method(D_METHOD("is_action_pressed", "action", "exact_match"), &Input::_is_action_pressed_bind_compat_102412, DEFVAL(false)); |
| 75 | + ClassDB::bind_compatibility_method(D_METHOD("is_action_just_pressed", "action", "exact_match"), &Input::_is_action_just_pressed_bind_compat_102412, DEFVAL(false)); |
| 76 | + ClassDB::bind_compatibility_method(D_METHOD("is_action_just_released", "action", "exact_match"), &Input::_is_action_just_released_bind_compat_102412, DEFVAL(false)); |
| 77 | + ClassDB::bind_compatibility_method(D_METHOD("get_action_strength", "action", "exact_match"), &Input::_get_action_strength_bind_compat_102412, DEFVAL(false)); |
| 78 | + ClassDB::bind_compatibility_method(D_METHOD("get_action_raw_strength", "action", "exact_match"), &Input::_get_action_raw_strength_bind_compat_102412, DEFVAL(false)); |
| 79 | + ClassDB::bind_compatibility_method(D_METHOD("get_axis", "negative_action", "positive_action"), &Input::_get_axis_bind_compat_102412); |
| 80 | + ClassDB::bind_compatibility_method(D_METHOD("get_vector", "negative_x", "positive_x", "negative_y", "positive_y", "deadzone"), &Input::_get_vector_bind_compat_102412, DEFVAL(-1.0f)); |
| 81 | + ClassDB::bind_compatibility_method(D_METHOD("action_press", "action", "strength"), &Input::_action_press_bind_compat_102412, DEFVAL(1.f)); |
| 82 | + ClassDB::bind_compatibility_method(D_METHOD("action_release", "action"), &Input::_action_release_bind_compat_102412); |
38 | 83 | ClassDB::bind_compatibility_method(D_METHOD("vibrate_handheld", "duration_ms"), &Input::_vibrate_handheld_bind_compat_91143, DEFVAL(500));
|
39 | 84 | }
|
40 | 85 |
|
|
0 commit comments