98 lines
2.9 KiB
Text
98 lines
2.9 KiB
Text
[gd_scene load_steps=3 format=3 uid="uid://bbvpj46frv0ho"]
|
|
|
|
[sub_resource type="GDScript" id="GDScript_yo4i2"]
|
|
script/source = "extends ServerNode
|
|
|
|
@onready var revealed_clues_label := %RevealedClues
|
|
|
|
func _on_clue_revealed(id: int) -> void:
|
|
revealed_clues_label.text += \"\\n{}\" % id
|
|
"
|
|
|
|
[sub_resource type="GDScript" id="GDScript_78ugl"]
|
|
script/source = "extends ClientNode
|
|
|
|
@onready
|
|
var client_status := %ClientStatus
|
|
|
|
func _ready():
|
|
connect_to_server(\"localhost\")
|
|
|
|
func _on_connection_changed(connected: int) -> void:
|
|
if (connected == NetworkData.CONNECTION_DISCONNECTED):
|
|
client_status.text = \"DISCONNECTED\"
|
|
elif (connected == NetworkData.CONNECTION_CONNECTED):
|
|
client_status.text = \"CONNECTED\"
|
|
elif (connected == NetworkData.CONNECTION_AUTHENTICATED):
|
|
client_status.text = \"AUTHENTICATED\"
|
|
|
|
|
|
func _on_line_edit_text_submitted(new_text: String) -> void:
|
|
pass
|
|
"
|
|
|
|
[node name="Control" type="Control"]
|
|
layout_mode = 3
|
|
anchors_preset = 15
|
|
anchor_right = 1.0
|
|
anchor_bottom = 1.0
|
|
grow_horizontal = 2
|
|
grow_vertical = 2
|
|
|
|
[node name="ServerNode" type="ServerNode" parent="."]
|
|
script = SubResource("GDScript_yo4i2")
|
|
|
|
[node name="ClientNode" type="ClientNode" parent="."]
|
|
script = SubResource("GDScript_78ugl")
|
|
|
|
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
|
layout_mode = 1
|
|
anchors_preset = 15
|
|
anchor_right = 1.0
|
|
anchor_bottom = 1.0
|
|
grow_horizontal = 2
|
|
grow_vertical = 2
|
|
|
|
[node name="ServerInfo" type="PanelContainer" parent="HBoxContainer"]
|
|
layout_mode = 2
|
|
size_flags_horizontal = 3
|
|
|
|
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer/ServerInfo"]
|
|
layout_mode = 2
|
|
|
|
[node name="Header" type="Label" parent="HBoxContainer/ServerInfo/VBoxContainer"]
|
|
layout_mode = 2
|
|
text = "Server:"
|
|
|
|
[node name="ServerStatus" type="Label" parent="HBoxContainer/ServerInfo/VBoxContainer"]
|
|
layout_mode = 2
|
|
text = "DISCONNECTED"
|
|
|
|
[node name="RevealedClues" type="Label" parent="HBoxContainer/ServerInfo/VBoxContainer"]
|
|
unique_name_in_owner = true
|
|
layout_mode = 2
|
|
text = "Revealed Clues:"
|
|
|
|
[node name="ClientInfo" type="PanelContainer" parent="HBoxContainer"]
|
|
layout_mode = 2
|
|
size_flags_horizontal = 3
|
|
|
|
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer/ClientInfo"]
|
|
layout_mode = 2
|
|
|
|
[node name="Header" type="Label" parent="HBoxContainer/ClientInfo/VBoxContainer"]
|
|
layout_mode = 2
|
|
text = "Client:"
|
|
|
|
[node name="ClientStatus" type="Label" parent="HBoxContainer/ClientInfo/VBoxContainer"]
|
|
unique_name_in_owner = true
|
|
layout_mode = 2
|
|
text = "DISCONNECTED"
|
|
|
|
[node name="LineEdit" type="LineEdit" parent="HBoxContainer/ClientInfo/VBoxContainer"]
|
|
layout_mode = 2
|
|
placeholder_text = "0"
|
|
|
|
[connection signal="clue_revealed" from="ServerNode" to="ServerNode" method="_on_clue_revealed"]
|
|
[connection signal="connection_changed" from="ClientNode" to="ClientNode" method="_on_connection_changed"]
|
|
[connection signal="text_submitted" from="HBoxContainer/ClientInfo/VBoxContainer/LineEdit" to="ClientNode" method="_on_line_edit_text_submitted"]
|