Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8ffde98fdd | |||
| bfd455341d |
+3
-2
@@ -198,13 +198,14 @@ camera_orbit_down={
|
||||
}
|
||||
tab_prev={
|
||||
"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)
|
||||
]
|
||||
}
|
||||
tab_next={
|
||||
"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={
|
||||
|
||||
@@ -41,7 +41,7 @@ func _unhandled_input(event:InputEvent) -> void:
|
||||
if event.is_action_pressed("menu"):
|
||||
if visible:
|
||||
close()
|
||||
elif !UI.dialogueActive:
|
||||
elif !UI.dialogueActive and SCENE.currentScene == SceneSingleton.SceneType.OVERWORLD:
|
||||
open()
|
||||
get_viewport().set_input_as_handled()
|
||||
return
|
||||
|
||||
@@ -12,7 +12,10 @@ func _ready() -> void:
|
||||
btnQuit.pressed.connect(_onQuitPressed)
|
||||
settingsMenu.opened.connect(_onSettingsOpened)
|
||||
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:
|
||||
# Move focus into the settings panel so the controller can navigate it.
|
||||
|
||||
@@ -52,6 +52,8 @@ func onTabChanged(tabIndex:int) -> void:
|
||||
_focusFirstIn(tabControls[tabIndex])
|
||||
|
||||
func _focusFirstIn(container:Control) -> void:
|
||||
if !is_visible_in_tree():
|
||||
return
|
||||
for child in container.get_children():
|
||||
if child is Control and child.focus_mode != Control.FOCUS_NONE:
|
||||
child.grab_focus()
|
||||
|
||||
Reference in New Issue
Block a user