So I have a menu and a text writer, and when ui_accept
is pressed the text deletes itself, but only if it is an unhandled input. The problem is I have a menu which also uses ui_accept
, and instead of only the menu triggering, both trigger. Here is the code of the writer that handles deleting the text on an unhandled input:
func _unhandled_input(event: InputEvent) -> void:
if event.is_action_pressed("ui_accept"):
if visible_ratio >= 1.0 and requireInput:
textFinished.emit()
queue_free()
What I believe the problem may be is that instead of the buttons checking for input, they send a signal on when they are pressed and the unhandled input isn’t regestering that? I don’t know. Here’s an example of one of the buttons (all of them are coded like this):
func _on_item_pressed() -> void:
menustate = "Item"
$"Item Panel".show()
$"Selection Panel/Item".focus_mode = FOCUS_NONE
$"Item Panel/VBoxContainer".get_child(0).grab_focus()