Skip to content

Commit

Permalink
Mark response input as handled in examples (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
Loufe authored Nov 8, 2023
1 parent d7b22b9 commit 0529da3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/point_n_click_balloon/balloon.gd
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ func _on_response_mouse_entered(item: Control) -> void:
func _on_response_gui_input(event: InputEvent, item: Control) -> void:
if "Disallowed" in item.name: return

get_viewport().set_input_as_handled()

if event is InputEventMouseButton and event.is_pressed() and event.button_index == 1:
next(dialogue_line.responses[item.get_index()].next_id)
elif event.is_action_pressed("ui_accept") and item in get_responses():
Expand Down
2 changes: 2 additions & 0 deletions examples/portraits_balloon/balloon.gd
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ func _on_response_mouse_entered(item: Control) -> void:
func _on_response_gui_input(event: InputEvent, item: Control) -> void:
if "Disallowed" in item.name: return

get_viewport().set_input_as_handled()

if event is InputEventMouseButton and event.is_pressed() and event.button_index == 1:
next(dialogue_line.responses[item.get_index()].next_id)
elif event.is_action_pressed("ui_accept") and item in get_responses():
Expand Down
2 changes: 2 additions & 0 deletions examples/visual_novel_balloon/balloon.gd
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ func _on_response_mouse_entered(item: Control) -> void:
func _on_response_gui_input(event: InputEvent, item: Control) -> void:
if "Disallowed" in item.name: return

get_viewport().set_input_as_handled()

if event is InputEventMouseButton and event.is_pressed() and event.button_index == 1:
responses_menu.modulate.a = 0.0
next(dialogue_line.responses[item.get_index()].next_id)
Expand Down

0 comments on commit 0529da3

Please sign in to comment.