Internet/Local/Hotseat working (still need to test for bugs). ALso get an RPC error because we switch scene...

This commit is contained in:
Sch1nken 2024-03-24 03:30:54 +01:00
parent c95b8186ab
commit c4909db2a5
654 changed files with 18133 additions and 39 deletions

53
UI/Lobby/LANLobby.gd Normal file
View file

@ -0,0 +1,53 @@
extends Control
# Create an UDPServer to receive UDP Broadcast packets
# List all received games in a list
@onready var margin_container = $PanelContainer/MarginContainer
@onready var selection_menu = $PanelContainer/SelectionMenu
@onready var lan_host = $PanelContainer/MarginContainer/VBoxContainer2/LANHost
@onready var lan_join = $PanelContainer/MarginContainer/VBoxContainer2/LANJoin
# Called when the node enters the scene tree for the first time.
func _ready():
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_back_button_pressed():
margin_container.visible = false
selection_menu.visible = true
lan_host.hide_panel()
lan_join.hide_panel()
func _on_backto_main_menu_pressed():
get_tree().change_scene_to_file("res://UI/main_menu.tscn")
func _on_host_pressed():
selection_menu.visible = false
margin_container.visible = true
lan_host.show_panel()
func _on_join_pressed():
selection_menu.visible = false
margin_container.visible = true
lan_join.show_panel()
@rpc("any_peer", "call_local")
func load_game() -> void:
push_warning("@@@@")
push_warning(multiplayer.is_server())
get_tree().change_scene_to_file("res://Game.tscn")
push_warning("yoyoyoyo")
func _on_start_game_button_pressed():
load_game.rpc()