Skip to content

Commit

Permalink
Only activate the right tool if action is pressed
Browse files Browse the repository at this point in the history
Previously it was possible to hold the right mouse button while the left was being held, then release the left and once the right button is released, the right tool would get activated. This commit ensures that the right tool gets activated only on first press of the right mouse button, if the left isn't already activated.
  • Loading branch information
OverloadedOrama committed Sep 28, 2022
1 parent 1fa34d7 commit cc332c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Autoload/Tools.gd
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func handle_draw(position: Vector2, event: InputEvent) -> void:
elif event.is_action_released("activate_left_tool") and _active_button == BUTTON_LEFT:
_slots[_active_button].tool_node.draw_end(draw_pos)
_active_button = -1
elif event.is_action("activate_right_tool") and _active_button == -1:
elif event.is_action_pressed("activate_right_tool") and _active_button == -1:
_active_button = BUTTON_RIGHT
_slots[_active_button].tool_node.draw_start(draw_pos)
elif event.is_action_released("activate_right_tool") and _active_button == BUTTON_RIGHT:
Expand Down

0 comments on commit cc332c6

Please sign in to comment.