Initial push
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cgffw8lmsypov"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bfaxxdr7v0emr" path="res://web_client.gd" id="1_eergy"]
|
||||
|
||||
[node name="Client" type="Control" node_paths=PackedStringArray("name_input", "session_code_input")]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_eergy")
|
||||
name_input = NodePath("VBoxContainer/NameInput")
|
||||
session_code_input = NodePath("VBoxContainer/SessionCodeInput")
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 466.0
|
||||
offset_top = 312.0
|
||||
offset_right = 609.0
|
||||
offset_bottom = 335.0
|
||||
text = "I WILL CLIENT YOU"
|
||||
|
||||
[node name="BellLabel" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 620.0
|
||||
offset_top = 658.0
|
||||
offset_right = 1285.0
|
||||
offset_bottom = 736.0
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -250.0
|
||||
offset_top = -80.0
|
||||
offset_right = 250.0
|
||||
offset_bottom = 80.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="NameInput" type="LineEdit" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CreateSessionButton" type="Button" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Create"
|
||||
|
||||
[node name="SessionCodeInput" type="LineEdit" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ConnectButton" type="Button" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Connect"
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/CreateSessionButton" to="." method="_on_create_session_button_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/ConnectButton" to="." method="_on_connect_button_pressed"]
|
||||
@@ -0,0 +1,25 @@
|
||||
class_name Server
|
||||
extends Control
|
||||
|
||||
var _peer: ENetMultiplayerPeer = ENetMultiplayerPeer.new()
|
||||
var _port: int = 9974
|
||||
|
||||
@export var text_output: Label
|
||||
|
||||
func _ready() -> void:
|
||||
multiplayer.peer_connected.connect(_on_peer_connected)
|
||||
|
||||
_write_line("me server, you jane.")
|
||||
_open_server()
|
||||
|
||||
func _open_server() -> void:
|
||||
_peer.create_server(_port)
|
||||
get_tree().get_multiplayer().multiplayer_peer = _peer
|
||||
_write_line("created server at port: {port}".format({"port": _port}))
|
||||
|
||||
func _write_line(str: String) -> void:
|
||||
#text_output.text += str + "\n"
|
||||
print(str)
|
||||
|
||||
func _on_peer_connected(id: int) -> void:
|
||||
_write_line("peer connected: {peer_id}".format({"peer_id": id}))
|
||||
@@ -0,0 +1 @@
|
||||
uid://bbrx5vsfnm8c8
|
||||
@@ -0,0 +1,25 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://derhsnqg6p1lb"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bbrx5vsfnm8c8" path="res://screens/server.gd" id="1_mesmk"]
|
||||
|
||||
[sub_resource type="SystemFont" id="SystemFont_mesmk"]
|
||||
font_names = PackedStringArray("IBM Plex Mono")
|
||||
font_weight = 500
|
||||
|
||||
[node name="Server" type="Control" node_paths=PackedStringArray("text_output")]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_mesmk")
|
||||
text_output = NodePath("Label")
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 20.0
|
||||
offset_top = 20.0
|
||||
offset_right = 1900.0
|
||||
offset_bottom = 1060.0
|
||||
theme_override_fonts/font = SubResource("SystemFont_mesmk")
|
||||
@@ -0,0 +1,10 @@
|
||||
extends Control
|
||||
|
||||
#func _ready() -> void:
|
||||
#_on_server_button_pressed()
|
||||
|
||||
func _on_client_button_pressed() -> void:
|
||||
get_tree().change_scene_to_file("uid://cgffw8lmsypov")
|
||||
|
||||
func _on_server_button_pressed() -> void:
|
||||
get_tree().change_scene_to_file("uid://derhsnqg6p1lb")
|
||||
@@ -0,0 +1 @@
|
||||
uid://ck2vokm0mc23h
|
||||
@@ -0,0 +1,60 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://ulnxbtq8mny1"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ck2vokm0mc23h" path="res://screens/test.gd" id="1_gb08i"]
|
||||
|
||||
[node name="Test" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_gb08i")
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 610.0
|
||||
offset_top = 190.0
|
||||
offset_right = 650.0
|
||||
offset_bottom = 213.0
|
||||
text = "Test"
|
||||
|
||||
[node name="Label2" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_right = 0.132
|
||||
anchor_bottom = 0.28
|
||||
offset_left = 475.0
|
||||
offset_top = 460.0
|
||||
offset_right = 261.56
|
||||
offset_bottom = 180.6
|
||||
text = "feedback"
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 139.0
|
||||
offset_top = 207.0
|
||||
offset_right = 440.0
|
||||
offset_bottom = 271.0
|
||||
|
||||
[node name="ClientButton" type="Button" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "be client"
|
||||
|
||||
[node name="ServerButton" type="Button" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "make server"
|
||||
|
||||
[node name="Label3" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_right = 0.132
|
||||
anchor_bottom = 0.28
|
||||
offset_left = 456.0
|
||||
offset_top = 510.0
|
||||
offset_right = 273.56
|
||||
offset_bottom = 230.6
|
||||
text = "feedback"
|
||||
|
||||
[connection signal="pressed" from="HBoxContainer/ClientButton" to="." method="_on_client_button_pressed"]
|
||||
[connection signal="pressed" from="HBoxContainer/ServerButton" to="." method="_on_server_button_pressed"]
|
||||
Reference in New Issue
Block a user