FunkPanion/scripts/menu.gd
2024-11-23 14:36:52 -06:00

18 lines
522 B
GDScript

extends MenuButton
var popup:PopupMenu
func _index_pressed(idx: int):
if idx == 0:
get_tree().change_scene_to_file("res://scenes/config.tscn")
elif idx == 1:
get_tree().quit()
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
popup = get_popup()
popup.index_pressed.connect(_index_pressed)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
self_modulate.a = 1 if popup.visible else GlobalConfig.menu_opacity