Compare commits

..

2 Commits

Author SHA1 Message Date
YourWishes 8ffde98fdd input binds 2026-06-13 07:38:28 -05:00
YourWishes bfd455341d Fix main menu focus 2026-06-12 22:21:42 -05:00
4 changed files with 10 additions and 4 deletions
+3 -2
View File
@@ -198,13 +198,14 @@ camera_orbit_down={
} }
tab_prev={ tab_prev={
"deadzone": 0.5, "deadzone": 0.5,
"events": [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":81,"key_label":0,"unicode":113,"location":0,"echo":false,"script":null) "events": [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":49,"key_label":0,"unicode":49,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":9,"pressure":0.0,"pressed":false,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":9,"pressure":0.0,"pressed":false,"script":null)
] ]
} }
tab_next={ tab_next={
"deadzone": 0.5, "deadzone": 0.5,
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":10,"pressure":0.0,"pressed":false,"script":null) "events": [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":51,"key_label":0,"unicode":51,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":10,"pressure":0.0,"pressed":false,"script":null)
] ]
} }
center_camera={ center_camera={
+1 -1
View File
@@ -41,7 +41,7 @@ func _unhandled_input(event:InputEvent) -> void:
if event.is_action_pressed("menu"): if event.is_action_pressed("menu"):
if visible: if visible:
close() close()
elif !UI.dialogueActive: elif !UI.dialogueActive and SCENE.currentScene == SceneSingleton.SceneType.OVERWORLD:
open() open()
get_viewport().set_input_as_handled() get_viewport().set_input_as_handled()
return return
+4 -1
View File
@@ -12,7 +12,10 @@ func _ready() -> void:
btnQuit.pressed.connect(_onQuitPressed) btnQuit.pressed.connect(_onQuitPressed)
settingsMenu.opened.connect(_onSettingsOpened) settingsMenu.opened.connect(_onSettingsOpened)
settingsMenu.closed.connect(_onSettingsClosed) settingsMenu.closed.connect(_onSettingsClosed)
btnNewGame.grab_focus()
func _notification(what:int) -> void:
if what == NOTIFICATION_ENTER_TREE:
btnNewGame.call_deferred("grab_focus")
func _onSettingsOpened() -> void: func _onSettingsOpened() -> void:
# Move focus into the settings panel so the controller can navigate it. # Move focus into the settings panel so the controller can navigate it.
+2
View File
@@ -52,6 +52,8 @@ func onTabChanged(tabIndex:int) -> void:
_focusFirstIn(tabControls[tabIndex]) _focusFirstIn(tabControls[tabIndex])
func _focusFirstIn(container:Control) -> void: func _focusFirstIn(container:Control) -> void:
if !is_visible_in_tree():
return
for child in container.get_children(): for child in container.get_children():
if child is Control and child.focus_mode != Control.FOCUS_NONE: if child is Control and child.focus_mode != Control.FOCUS_NONE:
child.grab_focus() child.grab_focus()