11@icon ("res://assets/editor-icons/material-symbols-joystick.svg" )
2- extends Node
2+ extends InputManager
33class_name OverlayInputManager
44
55## Manages global input while ion overlay mode
@@ -11,33 +11,11 @@ class_name OverlayInputManager
1111## To include this functionality, add this as a node to the root node in the
1212## scene tree.
1313
14- ## The audio manager to use to adjust the audio when audio input events happen.
15- var audio_manager := load ("res://core/global/audio_manager.tres" ) as AudioManager
16- ## InputPlumber receives and sends DBus input events.
17- var input_plumber := load ("res://core/systems/input/input_plumber.tres" ) as InputPlumberInstance
18- ## LaunchManager provides context on the currently running app so we can switch profiles
19- var launch_manager := load ("res://core/global/launch_manager.tres" ) as LaunchManager
20- ## The Global State Machine
21- var state_machine := load ("res://assets/state/state_machines/global_state_machine.tres" ) as StateMachine
22- ## State machine to use to switch menu states in response to input events.
23- var popup_state_machine := (
24- preload ("res://assets/state/state_machines/popup_state_machine.tres" ) as StateMachine
25- )
2614var menu_state_machine := preload ("res://assets/state/state_machines/menu_state_machine.tres" ) as StateMachine
27- var in_game_menu_state := preload ("res://assets/state/states/in_game_menu.tres" ) as State
28- var main_menu_state := preload ("res://assets/state/states/main_menu.tres" ) as State
29- var quick_bar_state := preload ("res://assets/state/states/quick_bar_menu.tres" ) as State
3015var base_state = preload ("res://assets/state/states/in_game.tres" ) as State
3116
32- var actions_pressed := {}
33-
34- ## Will show logger events with the prefix InputManager(Overlay Mode)
35- var logger := Log .get_logger ("InputManager(Overlay Mode)" , Log .LEVEL .INFO )
36-
37-
3817# Called when the node enters the scene tree for the first time.
3918func _ready () -> void :
40- add_to_group ("InputManager" )
4119 input_plumber .composite_device_added .connect (_watch_dbus_device )
4220 input_plumber .started .connect (_init_inputplumber )
4321 _init_inputplumber ()
@@ -48,6 +26,14 @@ func _init_inputplumber() -> void:
4826 _watch_dbus_device (device )
4927
5028
29+ func _get_default_profile_path () -> String :
30+ return "res://assets/gamepad/profiles/default_overlay.json"
31+
32+
33+ func get_default_global_profile_path () -> String :
34+ return "user://data/gamepad/profiles/global_default_overlay.json"
35+
36+
5137## Queue a release event for the given action
5238func action_release (dbus_path : String , action : String , strength : float = 1.0 ) -> void :
5339 Input .action_release (action )
0 commit comments