UI improvements
This commit is contained in:
@@ -10,18 +10,12 @@ func _ready() -> void:
|
||||
btnNewGame.pressed.connect(onNewGamePressed)
|
||||
btnSettings.pressed.connect(onSettingsPressed)
|
||||
btnQuit.pressed.connect(_onQuitPressed)
|
||||
settingsMenu.opened.connect(_onSettingsOpened)
|
||||
settingsMenu.closed.connect(_onSettingsClosed)
|
||||
|
||||
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.
|
||||
# The SettingsMenu grabs its own internal focus via _notification.
|
||||
pass
|
||||
|
||||
func _onSettingsClosed() -> void:
|
||||
btnSettings.grab_focus()
|
||||
|
||||
@@ -43,4 +37,4 @@ func onNewGamePressed() -> void:
|
||||
OVERWORLD.mapChange(newGameScene, "PlayerSpawnPoint")
|
||||
|
||||
func onSettingsPressed() -> void:
|
||||
settingsMenu.isOpen = true
|
||||
settingsMenu.open()
|
||||
|
||||
Reference in New Issue
Block a user