extends Control #warning-ignore-all:return_value_discarded signal button_pressed(menu) onready var buttons := $'%buttons' func _ready() -> void: for key in globals.POST_ROM_MENUS: if key == globals.Menu.DEBUG: continue var menu = globals.MENUS[key] var btn := Button.new() btn.text = menu[1] btn.connect('pressed', self, '_on_btn_pressed', [key]) buttons.add_child(btn) func _on_menu_presented() -> void: # Called by main.gd when a menu is presented in front of the rest MusicManager.play_bgm('BGM08-1000') # Prelude func _on_btn_pressed(menu) -> void: emit_signal('button_pressed', menu)