Skip to content

Commit

Permalink
Fix input event handling (#1693)
Browse files Browse the repository at this point in the history
  • Loading branch information
iscke authored Aug 30, 2023
1 parent d87dc64 commit 74175fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions addons/dialogic/Modules/LayoutEditor/Components/StyleItem.gd
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func set_scene_preview(path:String, preview:Texture2D, thumbnail:Texture2D, user
%Image.texture = preview
else:
%Image.texture = get_theme_icon("PackedScene", "EditorIcons")



func set_current(current:bool):
Expand All @@ -51,7 +51,7 @@ func _on_mouse_exited():


func _on_gui_input(event):
if Input.is_action_just_pressed('ui_accept') or Input.is_action_just_pressed("ui_select") or (
if event.is_action_pressed('ui_accept') or event.is_action_pressed("ui_select") or (
event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT):
clicked.emit()
elif event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_MIDDLE:
Expand Down
12 changes: 6 additions & 6 deletions addons/dialogic/Modules/Text/default_input_handler.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ var skip_delay :float = ProjectSettings.get_setting('dialogic/text/skippable_del
## INPUT
################################################################################
func _input(event:InputEvent) -> void:
if Input.is_action_just_pressed(ProjectSettings.get_setting('dialogic/text/input_action', 'dialogic_default_action')):
if event.is_action_pressed(ProjectSettings.get_setting('dialogic/text/input_action', 'dialogic_default_action')):
if Dialogic.paused:
return

if is_input_blocked():
return

if Dialogic.current_state == Dialogic.States.IDLE and Dialogic.Text.can_manual_advance():
Dialogic.handle_next_event()
autoadvance_timer.stop()
block_input(skip_delay)

elif Dialogic.current_state == Dialogic.States.SHOWING_TEXT and Dialogic.Text.can_skip():
Dialogic.Text.skip_text_animation()
block_input(skip_delay)

dialogic_action.emit()


Expand All @@ -49,7 +49,7 @@ func _ready() -> void:
add_child(autoadvance_timer)
autoadvance_timer.one_shot = true
autoadvance_timer.timeout.connect(_on_autoadvance_timer_timeout)

add_child(input_block_timer)
input_block_timer.one_shot = true

Expand Down

0 comments on commit 74175fc

Please sign in to comment.