extends Control

const InputLine = preload("res://src/UserInterface/Screens/MainMenu/ControlsMenu/InputLine.tscn")
var prev_line = null

func clear():
	for child in get_children():
		child.free()

func get_input_line(action_name) -> Control:
	for child in get_children():
		if child.action == action_name:
			return child
	return null

func add_input_line(action_name, event) -> Control:
	var line = InputLine.instance()
	add_child(line)
	line.initialize(action_name, event)
	#!if prev_line != null:
	#	line.get_child(2).focus_neighbour_top = prev_line.get_child(2).get_path()
	prev_line = line
	return line
