class_name ShortcutsPopup extends BasePopup ## Lists the keyboard shortcuts. Opened with Alt+K or the Shortcuts button. var shortcuts_dic: Dictionary = { "Alt + S": "Search", "Alt + A": "Add Players", "Alt + Z": "Reset", "Alt + X": "Play/Pause", "Alt + C": "Next Song", "Alt + V": "Show Answer", "Alt + L": "Show Debug Log", "Alt + K": "Show shortcuts", "Alt + Enter": "Fullscreen", "Alt + UP": "Volume up", "Alt + DOWN": "Volume down", "Alt + LEFT": "Jump back in song", "Alt + Ctrl + LEFT": "Restart song", "Alt + RIGHT": "Jump forward in song", "Alt + 1 - 9": "Give player point", "Alt + Ctrl + 1 - 9": "Take point from player", } @onready var shortcuts_vbox: VBoxContainer = %shortcutsVBox @onready var shortcuts_panel: Panel = %ShortcutsPanel func _ready() -> void: shortcuts_dic.sort() Settings.delete_children(shortcuts_vbox) var title: Label = Label.new() title.theme_type_variation = &"TextLarge" title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER title.text = "Shortcuts" shortcuts_vbox.add_child(title) var count: int = 0 for shortcut: String in shortcuts_dic.keys(): var panel: PanelContainer = PanelContainer.new() var hbox: HBoxContainer = HBoxContainer.new() hbox.alignment = BoxContainer.ALIGNMENT_CENTER var label: Label = Label.new() label.theme_type_variation = &"TextLarge" label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER label.text = shortcut label.autowrap_mode = TextServer.AUTOWRAP_WORD label.size_flags_horizontal = Control.SIZE_EXPAND_FILL var label2: Label = Label.new() label2.theme_type_variation = &"TextLarge" label2.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER label2.text = shortcuts_dic[shortcut] label2.autowrap_mode = TextServer.AUTOWRAP_WORD label2.size_flags_horizontal = Control.SIZE_EXPAND_FILL if count % 2 == 0: panel.theme_type_variation = &"ShortcutRowDark" hbox.add_child(label) hbox.add_child(label2) panel.add_child(hbox) shortcuts_vbox.add_child(panel) count += 1