diff --git a/scenes/game_elements/props/hook_control/components/hook_control.gd b/scenes/game_elements/props/hook_control/components/hook_control.gd index 499568da95..caaaf3161a 100644 --- a/scenes/game_elements/props/hook_control/components/hook_control.gd +++ b/scenes/game_elements/props/hook_control/components/hook_control.gd @@ -87,9 +87,12 @@ var _hook_angle: float ## diagonal directions when releasing the input actions. @onready var d_pad_timer: Timer = %DPadTimer +@onready var mouse_aiming_timer: Timer = %MouseAimingTimer + func _unhandled_input(_event: InputEvent) -> void: if _event is InputEventMouseMotion: + mouse_aiming_timer.start() var axis := get_global_mouse_position() - global_position if not axis.is_zero_approx(): _hook_angle = axis.angle() @@ -102,7 +105,8 @@ func _unhandled_input(_event: InputEvent) -> void: # there is always one that is released first so the aim direction ends up being either left or # down, not left AND down. if ( - _event is InputEventKey + mouse_aiming_timer.is_stopped() + and _event is InputEventKey and ( _event.is_action_released(&"aim_left") or _event.is_action_released(&"aim_right") @@ -113,7 +117,8 @@ func _unhandled_input(_event: InputEvent) -> void: d_pad_timer.start() return - _update_hook_angle() + if mouse_aiming_timer.is_stopped(): + _update_hook_angle() if Input.is_action_just_pressed(&"throw"): pressing_throw_action = true diff --git a/scenes/game_elements/props/hook_control/hook_control.tscn b/scenes/game_elements/props/hook_control/hook_control.tscn index 192ac3dd0c..6e9ca7f90c 100644 --- a/scenes/game_elements/props/hook_control/hook_control.tscn +++ b/scenes/game_elements/props/hook_control/hook_control.tscn @@ -22,4 +22,9 @@ unique_name_in_owner = true wait_time = 0.2 one_shot = true +[node name="MouseAimingTimer" type="Timer" parent="." unique_id=405211158] +unique_name_in_owner = true +wait_time = 3.0 +one_shot = true + [connection signal="timeout" from="DPadTimer" to="." method="_on_d_pad_timer_timeout"] diff --git a/scenes/globals/mouse_manager/mouse_manager.gd b/scenes/globals/mouse_manager/mouse_manager.gd index 9fa46ff32a..956177e316 100644 --- a/scenes/globals/mouse_manager/mouse_manager.gd +++ b/scenes/globals/mouse_manager/mouse_manager.gd @@ -20,7 +20,7 @@ func _ready() -> void: func _input(event: InputEvent) -> void: if event is InputEventMouseMotion: Input.mouse_mode = Input.MOUSE_MODE_VISIBLE - hide_timer.start(3) + hide_timer.start() func _on_hide_timer_timeout() -> void: