240 lines
12 KiB
Plaintext
240 lines
12 KiB
Plaintext
[gd_scene load_steps=8 format=3 uid="uid://gqrdpjslr4np"]
|
|
|
|
[ext_resource type="Script" uid="uid://p5gvnyhjqe6o" path="res://components/web_client_tcp.gd" id="1_feb5d"]
|
|
[ext_resource type="Script" uid="uid://c0cqkatyo4uj1" path="res://components/client_interface.gd" id="2_e2o6t"]
|
|
[ext_resource type="Script" uid="uid://utt8atbh7b2a" path="res://game_client.gd" id="3_feb5d"]
|
|
[ext_resource type="Script" uid="uid://bipfa366flrfa" path="res://environment_manager.gd" id="4_7jktm"]
|
|
[ext_resource type="PackedScene" uid="uid://jlovgr2iojrg" path="res://elements/player_hand.tscn" id="4_fc0e3"]
|
|
|
|
[sub_resource type="SystemFont" id="SystemFont_80nbo"]
|
|
font_names = PackedStringArray("IBM Plex Mono")
|
|
font_weight = 500
|
|
|
|
[sub_resource type="Environment" id="Environment_fc0e3"]
|
|
ambient_light_source = 2
|
|
ambient_light_color = Color(1, 1, 1, 1)
|
|
ambient_light_energy = 0.15
|
|
|
|
[node name="Game" type="Node"]
|
|
|
|
[node name="WebClientTCP" type="Node" parent="."]
|
|
script = ExtResource("1_feb5d")
|
|
|
|
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
|
anchors_preset = 15
|
|
anchor_right = 1.0
|
|
anchor_bottom = 1.0
|
|
grow_horizontal = 2
|
|
grow_vertical = 2
|
|
|
|
[node name="ClientInterface" type="ColorRect" parent="HBoxContainer" node_paths=PackedStringArray("client", "connect_button", "create_lobby_button", "join_lobby_button", "leave_lobby_button", "chat_message_input", "send_chat_message_button", "connected_players_label", "name_input", "lobby_code_input", "output")]
|
|
custom_minimum_size = Vector2(316, 0)
|
|
layout_mode = 2
|
|
color = Color(0.26, 0.2236, 0.230273, 1)
|
|
script = ExtResource("2_e2o6t")
|
|
client = NodePath("../../WebClientTCP")
|
|
connect_button = NodePath("MarginContainer/VBoxContainer/ServerInputs/ConnectButton")
|
|
create_lobby_button = NodePath("MarginContainer/VBoxContainer/ServerInputs/CreateLobbyButton")
|
|
join_lobby_button = NodePath("MarginContainer/VBoxContainer/ServerInputs/JoinLobbyButton")
|
|
leave_lobby_button = NodePath("MarginContainer/VBoxContainer/ServerInputs/LeaveLobbyButton")
|
|
chat_message_input = NodePath("MarginContainer/VBoxContainer/ChatContainer/MessageInput")
|
|
send_chat_message_button = NodePath("MarginContainer/VBoxContainer/ChatContainer/SendMessageButton")
|
|
connected_players_label = NodePath("MarginContainer/VBoxContainer/ConnectedPlayersLabel")
|
|
name_input = NodePath("MarginContainer/VBoxContainer/ServerInputs/NameInput")
|
|
lobby_code_input = NodePath("MarginContainer/VBoxContainer/ServerInputs/LobbyCodeInput")
|
|
output = NodePath("MarginContainer/VBoxContainer/ScrollContainer/Output")
|
|
|
|
[node name="MarginContainer" type="MarginContainer" parent="HBoxContainer/ClientInterface"]
|
|
layout_mode = 1
|
|
anchors_preset = 15
|
|
anchor_right = 1.0
|
|
anchor_bottom = 1.0
|
|
grow_horizontal = 2
|
|
grow_vertical = 2
|
|
theme_override_constants/margin_left = 8
|
|
theme_override_constants/margin_top = 8
|
|
theme_override_constants/margin_right = 8
|
|
theme_override_constants/margin_bottom = 8
|
|
|
|
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer/ClientInterface/MarginContainer"]
|
|
layout_mode = 2
|
|
|
|
[node name="Label" type="RichTextLabel" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer"]
|
|
layout_mode = 2
|
|
theme_override_font_sizes/italics_font_size = 24
|
|
theme_override_font_sizes/normal_font_size = 24
|
|
bbcode_enabled = true
|
|
text = "[i]Magician Online![/i]"
|
|
fit_content = true
|
|
|
|
[node name="ServerInputs" type="VBoxContainer" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer"]
|
|
custom_minimum_size = Vector2(300, 0)
|
|
layout_mode = 2
|
|
|
|
[node name="URLInput" type="LineEdit" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ServerInputs"]
|
|
layout_mode = 2
|
|
text = "127.0.0.1:9974"
|
|
placeholder_text = "URL"
|
|
|
|
[node name="ConnectButton" type="Button" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ServerInputs"]
|
|
layout_mode = 2
|
|
text = "Connect to Server"
|
|
|
|
[node name="NameInput" type="LineEdit" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ServerInputs"]
|
|
layout_mode = 2
|
|
placeholder_text = "Your Name"
|
|
editable = false
|
|
|
|
[node name="CreateLobbyButton" type="Button" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ServerInputs"]
|
|
layout_mode = 2
|
|
disabled = true
|
|
text = "Create Lobby"
|
|
|
|
[node name="LobbyCodeInput" type="LineEdit" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ServerInputs"]
|
|
layout_mode = 2
|
|
placeholder_text = "Lobby Code"
|
|
editable = false
|
|
|
|
[node name="JoinLobbyButton" type="Button" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ServerInputs"]
|
|
layout_mode = 2
|
|
disabled = true
|
|
text = "Join Lobby"
|
|
|
|
[node name="LeaveLobbyButton" type="Button" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ServerInputs"]
|
|
layout_mode = 2
|
|
disabled = true
|
|
text = "Disconnect"
|
|
|
|
[node name="ConnectedPlayersLabel" type="Label" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer"]
|
|
layout_mode = 2
|
|
|
|
[node name="Divider" type="ColorRect" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer"]
|
|
custom_minimum_size = Vector2(0, 2)
|
|
layout_mode = 2
|
|
color = Color(0.55, 0.3905, 0.3905, 1)
|
|
|
|
[node name="ScrollContainer" type="ScrollContainer" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer"]
|
|
layout_mode = 2
|
|
size_flags_vertical = 3
|
|
horizontal_scroll_mode = 0
|
|
vertical_scroll_mode = 4
|
|
|
|
[node name="Output" type="Label" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ScrollContainer"]
|
|
custom_minimum_size = Vector2(64, 1)
|
|
layout_mode = 2
|
|
size_flags_horizontal = 3
|
|
size_flags_vertical = 1
|
|
theme_override_fonts/font = SubResource("SystemFont_80nbo")
|
|
autowrap_mode = 2
|
|
metadata/_edit_lock_ = true
|
|
|
|
[node name="ChatContainer" type="HBoxContainer" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer"]
|
|
layout_mode = 2
|
|
|
|
[node name="MessageInput" type="LineEdit" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ChatContainer"]
|
|
layout_mode = 2
|
|
size_flags_horizontal = 3
|
|
|
|
[node name="SendMessageButton" type="Button" parent="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ChatContainer"]
|
|
layout_mode = 2
|
|
text = "Send"
|
|
|
|
[node name="GameUI" type="Control" parent="HBoxContainer" node_paths=PackedStringArray("web_client", "start_game_button", "play_card_button", "bet_container", "bet_input")]
|
|
layout_mode = 2
|
|
size_flags_horizontal = 3
|
|
mouse_filter = 2
|
|
script = ExtResource("3_feb5d")
|
|
web_client = NodePath("../../WebClientTCP")
|
|
start_game_button = NodePath("StartGameButton")
|
|
play_card_button = NodePath("PlayCardButton")
|
|
bet_container = NodePath("BetContainer")
|
|
bet_input = NodePath("BetContainer/BetInput")
|
|
|
|
[node name="StartGameButton" type="Button" parent="HBoxContainer/GameUI"]
|
|
visible = false
|
|
layout_mode = 1
|
|
anchors_preset = 8
|
|
anchor_left = 0.5
|
|
anchor_top = 0.5
|
|
anchor_right = 0.5
|
|
anchor_bottom = 0.5
|
|
offset_left = -50.0
|
|
offset_top = -15.5
|
|
offset_right = 50.0
|
|
offset_bottom = 15.5
|
|
grow_horizontal = 2
|
|
grow_vertical = 2
|
|
text = "Start Game!"
|
|
|
|
[node name="PlayCardButton" type="Button" parent="HBoxContainer/GameUI"]
|
|
layout_mode = 1
|
|
anchors_preset = 7
|
|
anchor_left = 0.5
|
|
anchor_top = 1.0
|
|
anchor_right = 0.5
|
|
anchor_bottom = 1.0
|
|
offset_left = -4.0
|
|
offset_top = -8.0
|
|
offset_right = 4.0
|
|
grow_horizontal = 2
|
|
grow_vertical = 0
|
|
disabled = true
|
|
text = "Play Card"
|
|
|
|
[node name="BetContainer" type="VBoxContainer" parent="HBoxContainer/GameUI"]
|
|
layout_mode = 0
|
|
offset_left = 218.0
|
|
offset_top = 833.0
|
|
offset_right = 445.0
|
|
offset_bottom = 899.0
|
|
|
|
[node name="BetInput" type="LineEdit" parent="HBoxContainer/GameUI/BetContainer"]
|
|
layout_mode = 2
|
|
|
|
[node name="SubmitBetButton" type="Button" parent="HBoxContainer/GameUI/BetContainer"]
|
|
layout_mode = 2
|
|
text = "submit bet"
|
|
|
|
[node name="EnvironmentManager" type="Node3D" parent="." node_paths=PackedStringArray("own_player_hand")]
|
|
script = ExtResource("4_7jktm")
|
|
own_player_hand = NodePath("PlayerHand")
|
|
player_hand_scene = ExtResource("4_fc0e3")
|
|
|
|
[node name="Camera3D" type="Camera3D" parent="EnvironmentManager"]
|
|
transform = Transform3D(1, 0, 0, 0, 0.997882, 0.0650548, 0, -0.0650548, 0.997882, 0, 0.171315, 1.65638)
|
|
|
|
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="EnvironmentManager"]
|
|
transform = Transform3D(0.970511, 0, 0.241058, -0.137972, 0.820002, 0.555482, -0.197668, -0.572361, 0.795821, 2.41581, 2.80426, 0)
|
|
|
|
[node name="WorldEnvironment" type="WorldEnvironment" parent="EnvironmentManager"]
|
|
environment = SubResource("Environment_fc0e3")
|
|
|
|
[node name="PlayerHand" parent="EnvironmentManager" instance=ExtResource("4_fc0e3")]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1.91793)
|
|
|
|
[connection signal="client_joined_lobby" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_client_joined_lobby"]
|
|
[connection signal="client_joined_lobby" from="WebClientTCP" to="HBoxContainer/GameUI" method="_on_web_client_tcp_client_joined_lobby"]
|
|
[connection signal="client_left_lobby" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_client_left_lobby"]
|
|
[connection signal="client_left_lobby" from="WebClientTCP" to="HBoxContainer/GameUI" method="_on_web_client_tcp_client_left_lobby"]
|
|
[connection signal="client_order_received" from="WebClientTCP" to="EnvironmentManager" method="_on_web_client_tcp_client_order_received"]
|
|
[connection signal="connected_to_lobby" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_connected_to_lobby"]
|
|
[connection signal="connected_to_server" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_connected_to_server"]
|
|
[connection signal="connection_error_occurred" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_connection_error_occurred"]
|
|
[connection signal="connection_status_changed" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_connection_status_changed"]
|
|
[connection signal="disconnected_from_lobby" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_disconnected_from_lobby"]
|
|
[connection signal="disconnected_from_server" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_disconnected_from_server"]
|
|
[connection signal="received_chat_message" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_received_chat_message"]
|
|
[connection signal="received_client_id" from="WebClientTCP" to="EnvironmentManager" method="_on_web_client_tcp_received_client_id"]
|
|
[connection signal="received_connection_message" from="WebClientTCP" to="HBoxContainer/ClientInterface" method="_on_web_client_tcp_received_connection_message"]
|
|
[connection signal="pressed" from="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ServerInputs/ConnectButton" to="HBoxContainer/ClientInterface" method="_on_connect_button_pressed"]
|
|
[connection signal="pressed" from="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ServerInputs/CreateLobbyButton" to="HBoxContainer/ClientInterface" method="_on_create_lobby_button_pressed"]
|
|
[connection signal="pressed" from="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ServerInputs/CreateLobbyButton" to="HBoxContainer/GameUI" method="_on_create_lobby_button_pressed"]
|
|
[connection signal="pressed" from="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ServerInputs/JoinLobbyButton" to="HBoxContainer/ClientInterface" method="_on_join_lobby_button_pressed"]
|
|
[connection signal="pressed" from="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ServerInputs/JoinLobbyButton" to="HBoxContainer/GameUI" method="_on_join_lobby_button_pressed"]
|
|
[connection signal="pressed" from="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ServerInputs/LeaveLobbyButton" to="HBoxContainer/ClientInterface" method="_on_disconnect_lobby_button_pressed"]
|
|
[connection signal="pressed" from="HBoxContainer/ClientInterface/MarginContainer/VBoxContainer/ChatContainer/SendMessageButton" to="HBoxContainer/ClientInterface" method="_on_send_message_button_pressed"]
|
|
[connection signal="pressed" from="HBoxContainer/GameUI/StartGameButton" to="HBoxContainer/GameUI" method="_on_start_game_button_pressed"]
|
|
[connection signal="pressed" from="HBoxContainer/GameUI/PlayCardButton" to="EnvironmentManager/PlayerHand" method="_on_play_card_button_pressed"]
|
|
[connection signal="pressed" from="HBoxContainer/GameUI/BetContainer/SubmitBetButton" to="HBoxContainer/GameUI" method="_on_submit_bet_button_pressed"]
|
|
[connection signal="card_selected" from="EnvironmentManager/PlayerHand" to="HBoxContainer/GameUI" method="_on_player_hand_card_selected"]
|