]> Untitled Git - wolf-seeking-sheep.git/blob - addons/dialogic/Modules/Text/node_input.gd
Adding import files
[wolf-seeking-sheep.git] / addons / dialogic / Modules / Text / node_input.gd
1 class_name DialogicNode_Input
2 extends Control
3
4 ## A node that handles mouse input. This allows limiting mouse input to a
5 ## specific region and avoiding conflicts with other UI elements.
6 ## If no Input node is used, the input subsystem will handle mouse input instead.
7
8 func _ready() -> void:
9         add_to_group('dialogic_input')
10         gui_input.connect(_on_gui_input)
11
12
13 func _input(_event: InputEvent) -> void:
14         if Input.is_action_pressed(ProjectSettings.get_setting('dialogic/text/input_action', 'dialogic_default_action')):
15                 mouse_filter = Control.MOUSE_FILTER_STOP
16         else:
17                 mouse_filter = Control.MOUSE_FILTER_IGNORE
18
19
20 func _on_gui_input(event:InputEvent) -> void:
21         DialogicUtil.autoload().Inputs.handle_node_gui_input(event)