any_key > action_confirm
Some checks failed
GDScript Auto-Formatting / Auto-Format GDScript Code (pull_request) Failing after 9s
GDScript Linting / GDScript Code Quality Check (pull_request) Failing after 11s

This commit is contained in:
2025-09-27 21:12:24 +04:00
parent 0791b80f15
commit 9b83bec37d
4 changed files with 12 additions and 11 deletions

View File

@@ -32,9 +32,9 @@ func _setup_splash_screen_connection() -> void:
if splash_screen:
DebugManager.log_debug("SplashScreen node found: %s" % splash_screen.name, "Main")
# Try connecting to the signal if it exists
if splash_screen.has_signal("any_key_pressed"):
splash_screen.any_key_pressed.connect(_on_any_key_pressed)
DebugManager.log_debug("Connected to any_key_pressed signal", "Main")
if splash_screen.has_signal("confirm_pressed"):
splash_screen.confirm_pressed.connect(_on_confirm_pressed)
DebugManager.log_debug("Connected to confirm_pressed signal", "Main")
else:
# Fallback: use input handling directly on the main scene
DebugManager.log_warn("Using fallback input handling", "Main")
@@ -52,12 +52,12 @@ func _use_fallback_input_handling() -> void:
func _unhandled_input(event: InputEvent) -> void:
if splash_screen and splash_screen.is_inside_tree():
# Forward input to splash screen or handle directly
if event.is_action_pressed("action_south"):
_on_any_key_pressed()
if event.is_action_pressed("action_confirm"):
_on_confirm_pressed()
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")
splash_screen.queue_free()
show_main_menu()

View File

@@ -1,6 +1,6 @@
extends Control
signal any_key_pressed
signal confirm_pressed
func _ready() -> void:
@@ -10,7 +10,7 @@ func _ready() -> void:
func _input(event: InputEvent) -> void:
if (
event.is_action_pressed("action_south")
event.is_action_pressed("action_confirm")
or event is InputEventScreenTouch
or (
event is InputEventMouseButton
@@ -19,7 +19,7 @@ func _input(event: InputEvent) -> void:
)
):
DebugManager.log_debug("Action pressed: " + str(event), "SplashScreen")
any_key_pressed.emit()
confirm_pressed.emit()
get_viewport().set_input_as_handled()