This repository has been archived on 2020-09-30. You can view files and clone it, but cannot push or open issues or pull requests.
odyssey-old/Scenes/UI.gd

27 lines
611 B
GDScript3
Raw Normal View History

2020-07-06 22:00:39 +00:00
extends Control
signal command(command)
2020-07-10 11:31:16 +00:00
enum ServerMenuItem {
HOST_SERVER,
JOIN_SERVER,
SERVER_INFO
}
func _ready() -> void:
# Add options to menu buttons
var serverMenu = $Menu/Margins/Grid/Server.get_popup()
serverMenu.add_item("Start hosting", ServerMenuItem.HOST_SERVER)
serverMenu.add_item("Join instance", ServerMenuItem.JOIN_SERVER)
serverMenu.connect("id_pressed", self, "_server_option_chosen")
func _server_option_chosen(id) -> void:
match id:
ServerMenuItem.HOST_SERVER:
# TODO HOST
$ServerInfoPopup.popup_centered()
pass
ServerMenuItem.JOIN_SERVER:
# TODO JOIN
pass