mirror of
https://github.com/thegatesbrowser/godot-multiplayer.git
synced 2025-10-15 17:03:34 -04:00
copy from thegates-jam repo
This commit is contained in:
parent
c1a7ad74e1
commit
1a335de566
523 changed files with 22408 additions and 0 deletions
35
ui/ui.gd
Normal file
35
ui/ui.gd
Normal file
|
@ -0,0 +1,35 @@
|
|||
extends Control
|
||||
|
||||
signal start_server
|
||||
signal connect_client
|
||||
|
||||
@export var hide_ui_and_connect: bool
|
||||
|
||||
|
||||
func _ready():
|
||||
if Connection.is_server(): return
|
||||
|
||||
if hide_ui_and_connect:
|
||||
connect_client_emit()
|
||||
else:
|
||||
show_ui()
|
||||
|
||||
|
||||
func start_server_emit() -> void:
|
||||
start_server.emit()
|
||||
$MainMenu.visible = false
|
||||
|
||||
|
||||
func connect_client_emit() -> void:
|
||||
connect_client.emit()
|
||||
hide_ui()
|
||||
|
||||
|
||||
func hide_ui() -> void:
|
||||
$MainMenu.visible = false
|
||||
$InGameUI.visible = true
|
||||
|
||||
|
||||
func show_ui() -> void:
|
||||
$MainMenu.visible = true
|
||||
$InGameUI.visible = false
|
Loading…
Add table
Add a link
Reference in a new issue