18 lines
439 B
GDScript
18 lines
439 B
GDScript
extends Control
|
|
|
|
signal command(command)
|
|
|
|
enum ServerMenuItem {
|
|
SERVER_INFO
|
|
}
|
|
|
|
func _ready() -> void:
|
|
# Add options to menu buttons
|
|
var serverMenu = $Menu/Margins/Grid/Server.get_popup()
|
|
serverMenu.connect("id_pressed", self, "_server_option_chosen")
|
|
serverMenu.add_item("Server info", ServerMenuItem.SERVER_INFO)
|
|
|
|
func _server_option_chosen(id) -> void:
|
|
match id:
|
|
ServerMenuItem.SERVER_INFO:
|
|
$ServerInfoPopup.popup_centered()
|