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

25 lines
565 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()
func open_map_popup() -> void:
$MapPopup.popup_centered_ratio()
func close_map_popup() -> void:
$MapPopup.visible = false