25 lines
669 B
GDScript
25 lines
669 B
GDScript
extends Panel
|
|
|
|
var prev_focus
|
|
|
|
func open():
|
|
visible = true
|
|
prev_focus = get_focus_owner()
|
|
mitigate_ui_navigation_spill_over(true)
|
|
$"%SaveNQuit".grab_focus()
|
|
|
|
func mitigate_ui_navigation_spill_over(var value: bool):
|
|
var mode = Control.FOCUS_NONE if value else Control.FOCUS_ALL
|
|
$"%ProfilesMenu".focus_mode = mode
|
|
$"%Back".focus_mode = mode
|
|
$"%Reset".focus_mode = mode
|
|
$"%Save".focus_mode = mode
|
|
for line in $"%ActionKeyList".get_children():
|
|
line.get_node("ChangeButton").focus_mode = mode
|
|
|
|
func close():
|
|
visible = false
|
|
mitigate_ui_navigation_spill_over(false)
|
|
self.release_focus()
|
|
prev_focus.grab_focus()
|