37 lines
1,001 B
GDScript
37 lines
1,001 B
GDScript
extends Control
|
|
|
|
@onready var margin_container = $PanelContainer/MarginContainer
|
|
@onready var web_rtc_host = $PanelContainer/MarginContainer/VBoxContainer2/WebRTCHost
|
|
@onready var web_rtc_join = $PanelContainer/MarginContainer/VBoxContainer2/WebRTCJoin
|
|
@onready var selection_menu = $PanelContainer/SelectionMenu
|
|
|
|
func _on_host_pressed():
|
|
selection_menu.visible = false
|
|
margin_container.visible = true
|
|
web_rtc_host.show_panel()
|
|
|
|
|
|
func _on_join_pressed():
|
|
selection_menu.visible = false
|
|
margin_container.visible = true
|
|
web_rtc_join.show_panel()
|
|
|
|
|
|
func _on_backto_main_menu_pressed():
|
|
get_tree().change_scene_to_file("res://UI/main_menu.tscn")
|
|
|
|
|
|
func _on_back_button_pressed():
|
|
selection_menu.visible = true
|
|
margin_container.visible = false
|
|
selection_menu.visible = true
|
|
|
|
web_rtc_host.hide_panel()
|
|
web_rtc_join.hide_panel()
|
|
|
|
@rpc("any_peer", "call_local")
|
|
func load_game() -> void:
|
|
get_tree().change_scene_to_file("res://Game.tscn")
|
|
|
|
func _on_start_game_button_pressed():
|
|
load_game.rpc()
|