ChocolateBird/test/debug_menu.gd

19 lines
462 B
GDScript

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_btn_pressed(menu) -> void:
emit_signal('button_pressed', menu)