25 lines
639 B
GDScript
25 lines
639 B
GDScript
|
|
class_name TopMenu extends HBoxContainer
|
||
|
|
|
||
|
|
signal button_pressed(button_name: String)
|
||
|
|
|
||
|
|
@export_group("Menu Items")
|
||
|
|
|
||
|
|
@export var BurgerButton: TextureButton
|
||
|
|
@export var DateTime: Label
|
||
|
|
@export var Info: Label
|
||
|
|
|
||
|
|
@export var TopMenuButtons: Dictionary[String, TextureButton]
|
||
|
|
|
||
|
|
func set_datetime(value: String):
|
||
|
|
DateTime.text = value
|
||
|
|
|
||
|
|
func set_info(value: String):
|
||
|
|
Info.text = value
|
||
|
|
|
||
|
|
func enable_buttons(button_state: Array):
|
||
|
|
for button_name in TopMenuButtons:
|
||
|
|
TopMenuButtons[button_name].visible = button_state.has(button_name)
|
||
|
|
|
||
|
|
func on_putton_pressed(button_name: String):
|
||
|
|
emit_signal("button_pressed", button_name)
|