Add controller ui

This commit is contained in:
2026-06-11 20:19:15 -05:00
parent 619bf09ab9
commit 456ea1e07e
6 changed files with 98 additions and 17 deletions
+3 -2
View File
@@ -4,11 +4,12 @@ func _ready() -> void:
visible = false
$HBoxContainer/ItemList.item_selected.connect(onItemSelected)
func open():
func open() -> void:
visible = true
$HBoxContainer/ItemList.clear()
$HBoxContainer/ItemList.grab_focus()
func close():
func close() -> void:
visible = false
func isOpen() -> bool:
+11
View File
@@ -17,3 +17,14 @@ func close() -> void:
visible = false
MAIN.close()
SETTINGS.close()
func _unhandled_input(event:InputEvent) -> void:
if !visible:
return
if event.is_action_pressed("ui_cancel"):
if SETTINGS.isOpen():
SETTINGS.close()
MAIN.open()
else:
close()
get_viewport().set_input_as_handled()