UI improvements
This commit is contained in:
@@ -6,6 +6,7 @@ signal confirmed
|
||||
@export var btnNo:Button
|
||||
|
||||
func _ready() -> void:
|
||||
super._ready()
|
||||
close()
|
||||
btnYes.pressed.connect(_onYes)
|
||||
btnNo.pressed.connect(close)
|
||||
@@ -18,13 +19,10 @@ func _onYes() -> void:
|
||||
close()
|
||||
confirmed.emit()
|
||||
|
||||
func open() -> void:
|
||||
super.open()
|
||||
func _grabInitialFocus() -> void:
|
||||
btnNo.grab_focus()
|
||||
|
||||
func _unhandled_input(event:InputEvent) -> void:
|
||||
if !isOpen:
|
||||
return
|
||||
if event.is_action_pressed("ui_cancel"):
|
||||
close()
|
||||
get_viewport().set_input_as_handled()
|
||||
|
||||
Reference in New Issue
Block a user