any_key > action_confirm
This commit is contained in:
@@ -282,7 +282,7 @@ sprites:
|
|||||||
|
|
||||||
### Signal Connections
|
### Signal Connections
|
||||||
```
|
```
|
||||||
SplashScreen --[any_key_pressed]--> Main
|
SplashScreen --[confirm_pressed]--> Main
|
||||||
MainMenu --[open_settings]--> Main
|
MainMenu --[open_settings]--> Main
|
||||||
SettingsMenu --[back_to_main_menu]--> Main
|
SettingsMenu --[back_to_main_menu]--> Main
|
||||||
DebugManager --[debug_toggled]--> All scenes with DebugToggle
|
DebugManager --[debug_toggled]--> All scenes with DebugToggle
|
||||||
|
|||||||
@@ -46,9 +46,10 @@ ui_pause={
|
|||||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":6,"pressure":0.0,"pressed":false,"script":null)
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":6,"pressure":0.0,"pressed":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
any_key={
|
action_confirm={
|
||||||
"deadzone": 0.2,
|
"deadzone": 0.2,
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194309,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
|
||||||
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(165, 16),"global_position":Vector2(174, 64),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(165, 16),"global_position":Vector2(174, 64),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ func _setup_splash_screen_connection() -> void:
|
|||||||
if splash_screen:
|
if splash_screen:
|
||||||
DebugManager.log_debug("SplashScreen node found: %s" % splash_screen.name, "Main")
|
DebugManager.log_debug("SplashScreen node found: %s" % splash_screen.name, "Main")
|
||||||
# Try connecting to the signal if it exists
|
# Try connecting to the signal if it exists
|
||||||
if splash_screen.has_signal("any_key_pressed"):
|
if splash_screen.has_signal("confirm_pressed"):
|
||||||
splash_screen.any_key_pressed.connect(_on_any_key_pressed)
|
splash_screen.confirm_pressed.connect(_on_confirm_pressed)
|
||||||
DebugManager.log_debug("Connected to any_key_pressed signal", "Main")
|
DebugManager.log_debug("Connected to confirm_pressed signal", "Main")
|
||||||
else:
|
else:
|
||||||
# Fallback: use input handling directly on the main scene
|
# Fallback: use input handling directly on the main scene
|
||||||
DebugManager.log_warn("Using fallback input handling", "Main")
|
DebugManager.log_warn("Using fallback input handling", "Main")
|
||||||
@@ -52,12 +52,12 @@ func _use_fallback_input_handling() -> void:
|
|||||||
func _unhandled_input(event: InputEvent) -> void:
|
func _unhandled_input(event: InputEvent) -> void:
|
||||||
if splash_screen and splash_screen.is_inside_tree():
|
if splash_screen and splash_screen.is_inside_tree():
|
||||||
# Forward input to splash screen or handle directly
|
# Forward input to splash screen or handle directly
|
||||||
if event.is_action_pressed("action_south"):
|
if event.is_action_pressed("action_confirm"):
|
||||||
_on_any_key_pressed()
|
_on_confirm_pressed()
|
||||||
get_viewport().set_input_as_handled()
|
get_viewport().set_input_as_handled()
|
||||||
|
|
||||||
|
|
||||||
func _on_any_key_pressed() -> void:
|
func _on_confirm_pressed() -> void:
|
||||||
DebugManager.log_debug("Transitioning to main menu", "Main")
|
DebugManager.log_debug("Transitioning to main menu", "Main")
|
||||||
splash_screen.queue_free()
|
splash_screen.queue_free()
|
||||||
show_main_menu()
|
show_main_menu()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
signal any_key_pressed
|
signal confirm_pressed
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
@@ -10,7 +10,7 @@ func _ready() -> void:
|
|||||||
|
|
||||||
func _input(event: InputEvent) -> void:
|
func _input(event: InputEvent) -> void:
|
||||||
if (
|
if (
|
||||||
event.is_action_pressed("action_south")
|
event.is_action_pressed("action_confirm")
|
||||||
or event is InputEventScreenTouch
|
or event is InputEventScreenTouch
|
||||||
or (
|
or (
|
||||||
event is InputEventMouseButton
|
event is InputEventMouseButton
|
||||||
@@ -19,7 +19,7 @@ func _input(event: InputEvent) -> void:
|
|||||||
)
|
)
|
||||||
):
|
):
|
||||||
DebugManager.log_debug("Action pressed: " + str(event), "SplashScreen")
|
DebugManager.log_debug("Action pressed: " + str(event), "SplashScreen")
|
||||||
any_key_pressed.emit()
|
confirm_pressed.emit()
|
||||||
get_viewport().set_input_as_handled()
|
get_viewport().set_input_as_handled()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user