extends TabContainer

export var loop_selection = true

func _unhandled_input(event):
		var tab = current_tab
		if event.is_action_pressed("ui_tab2_prev"):
			tab -= 1
		elif event.is_action_pressed("ui_tab2_next"):
			tab += 1
		
		if loop_selection:
			current_tab = (get_child_count() + tab) % get_child_count()
		else:
			current_tab = clamp(tab, 0, get_child_count())
