extends OptionButton

func _ready():
	add_items()
	
onready var drop_down_menu = $"."

func add_items():
	drop_down_menu.add_item("VSync (Default)")
	drop_down_menu.add_item("30")
	drop_down_menu.add_item("60")
	drop_down_menu.add_item("120")
	drop_down_menu.add_item("240")

func _on_OptionButton_item_selected(index):
	var current_selected = index
	if current_selected == 0:
		Engine.target_fps = 0
		OS.vsync_enabled = true
	if current_selected == 1:
		Engine.target_fps = 30
	if current_selected == 2:
		Engine.target_fps = 60
	if current_selected == 3:
		Engine.target_fps = 120
		OS.vsync_enabled = false
	if current_selected == 4:
		Engine.target_fps = 240
		OS.vsync_enabled = false
	if current_selected == 5:
		Engine.target_fps = 480
		OS.vsync_enabled = false
