diff --git a/docs/MAP.md b/docs/MAP.md index b19d9c7..a5f0e28 100644 --- a/docs/MAP.md +++ b/docs/MAP.md @@ -282,7 +282,7 @@ sprites: ### Signal Connections ``` -SplashScreen --[any_key_pressed]--> Main +SplashScreen --[confirm_pressed]--> Main MainMenu --[open_settings]--> Main SettingsMenu --[back_to_main_menu]--> Main DebugManager --[debug_toggled]--> All scenes with DebugToggle diff --git a/project.godot b/project.godot index 828dd20..082a924 100644 --- a/project.godot +++ b/project.godot @@ -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) ] } -any_key={ +action_confirm={ "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) +, 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(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) ] diff --git a/scenes/main/Main.gd b/scenes/main/Main.gd index dcffb6b..8b1d1f4 100644 --- a/scenes/main/Main.gd +++ b/scenes/main/Main.gd @@ -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() diff --git a/scenes/main/SplashScreen.gd b/scenes/main/SplashScreen.gd index dabe665..8e3ec63 100644 --- a/scenes/main/SplashScreen.gd +++ b/scenes/main/SplashScreen.gd @@ -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()