From c9211b444ebbcdcf865e4dbd35b6caa6e914efff Mon Sep 17 00:00:00 2001 From: Patrick_Pluto Date: Tue, 13 Aug 2024 20:43:54 +0200 Subject: [PATCH] Milestone 8 preparations 1 --- assets/models/corner.gltf.import | 2 +- assets/models/crouch.gltf.import | 2 +- assets/models/floor.gltf.import | 2 +- assets/models/frame.gltf.import | 2 +- assets/models/inverted_corner.gltf.import | 2 +- assets/models/jump.gltf.import | 2 +- assets/models/jump_corner.gltf.import | 2 +- assets/models/jump_corner2.gltf.import | 2 +- assets/models/stairs_1.gltf.import | 2 +- assets/models/stairs_2.gltf.import | 2 +- assets/models/stairs_3.gltf.import | 2 +- assets/models/stairs_4.gltf.import | 2 +- assets/models/stairs_5.gltf.import | 2 +- assets/models/stairs_6.gltf.import | 2 +- assets/models/stairs_7.gltf.import | 2 +- assets/models/wall.gltf.import | 2 +- menus/create.tscn | 4 +-- menus/main_menu.tscn | 7 ---- menus/settings.tscn | 42 ++++++++++++++++++++-- objects/computer.tscn | 34 ++++++------------ scripts/client.gd | 2 +- scripts/computer.gd | 43 +++++------------------ scripts/game.gd | 10 +++--- scripts/main_menu.gd | 10 ++---- scripts/movement.gd | 4 +-- scripts/settings_text.gd | 17 +++++++-- 26 files changed, 101 insertions(+), 104 deletions(-) diff --git a/assets/models/corner.gltf.import b/assets/models/corner.gltf.import index 06cb3cb..7de0548 100644 --- a/assets/models/corner.gltf.import +++ b/assets/models/corner.gltf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/corner.gltf-d27aae84dacf6337afe0f777beb3d2f1. [params] -nodes/root_type="MeshInstance3D" +nodes/root_type="Node3D" nodes/root_name="" nodes/apply_root_scale=true nodes/root_scale=1.0 diff --git a/assets/models/crouch.gltf.import b/assets/models/crouch.gltf.import index 535379f..7a85a92 100644 --- a/assets/models/crouch.gltf.import +++ b/assets/models/crouch.gltf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/crouch.gltf-ace5d02cb4e9e58f95c55709db549ec7. [params] -nodes/root_type="MeshInstance3D" +nodes/root_type="Node3D" nodes/root_name="" nodes/apply_root_scale=true nodes/root_scale=1.0 diff --git a/assets/models/floor.gltf.import b/assets/models/floor.gltf.import index c944038..49c6b7c 100644 --- a/assets/models/floor.gltf.import +++ b/assets/models/floor.gltf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/floor.gltf-f41589b4f800248085aa506db510082f.s [params] -nodes/root_type="MeshInstance3D" +nodes/root_type="Node3D" nodes/root_name="" nodes/apply_root_scale=true nodes/root_scale=1.0 diff --git a/assets/models/frame.gltf.import b/assets/models/frame.gltf.import index ff076b3..7e6adac 100644 --- a/assets/models/frame.gltf.import +++ b/assets/models/frame.gltf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/frame.gltf-0e20b27650c04f11c1dfb68fc46aec12.s [params] -nodes/root_type="MeshInstance3D" +nodes/root_type="Node3D" nodes/root_name="" nodes/apply_root_scale=true nodes/root_scale=1.0 diff --git a/assets/models/inverted_corner.gltf.import b/assets/models/inverted_corner.gltf.import index b47329a..7b55192 100644 --- a/assets/models/inverted_corner.gltf.import +++ b/assets/models/inverted_corner.gltf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/inverted_corner.gltf-4b1ca22cbccec7314454316f [params] -nodes/root_type="MeshInstance3D" +nodes/root_type="Node3D" nodes/root_name="" nodes/apply_root_scale=true nodes/root_scale=1.0 diff --git a/assets/models/jump.gltf.import b/assets/models/jump.gltf.import index 24596cd..9ebe13b 100644 --- a/assets/models/jump.gltf.import +++ b/assets/models/jump.gltf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/jump.gltf-7b6f835bd8b0695f3d758d786ce34d46.sc [params] -nodes/root_type="MeshInstance3D" +nodes/root_type="Node3D" nodes/root_name="" nodes/apply_root_scale=true nodes/root_scale=1.0 diff --git a/assets/models/jump_corner.gltf.import b/assets/models/jump_corner.gltf.import index adbc00e..122f1fa 100644 --- a/assets/models/jump_corner.gltf.import +++ b/assets/models/jump_corner.gltf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/jump_corner.gltf-48aab81343564dd20cd29f0bff34 [params] -nodes/root_type="MeshInstance3D" +nodes/root_type="Node3D" nodes/root_name="" nodes/apply_root_scale=true nodes/root_scale=1.0 diff --git a/assets/models/jump_corner2.gltf.import b/assets/models/jump_corner2.gltf.import index 86f5914..cb59c38 100644 --- a/assets/models/jump_corner2.gltf.import +++ b/assets/models/jump_corner2.gltf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/jump_corner2.gltf-1a7d50337cb83e920dddd62bf38 [params] -nodes/root_type="MeshInstance3D" +nodes/root_type="Node3D" nodes/root_name="" nodes/apply_root_scale=true nodes/root_scale=1.0 diff --git a/assets/models/stairs_1.gltf.import b/assets/models/stairs_1.gltf.import index b74053e..67f22ae 100644 --- a/assets/models/stairs_1.gltf.import +++ b/assets/models/stairs_1.gltf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/stairs_1.gltf-b3faa75abaaa7744f04f516ad6700ff [params] -nodes/root_type="MeshInstance3D" +nodes/root_type="Node3D" nodes/root_name="" nodes/apply_root_scale=true nodes/root_scale=1.0 diff --git a/assets/models/stairs_2.gltf.import b/assets/models/stairs_2.gltf.import index eb1b377..4f78822 100644 --- a/assets/models/stairs_2.gltf.import +++ b/assets/models/stairs_2.gltf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/stairs_2.gltf-53572c3c4bb5f3c8f79adfd45fe4bc2 [params] -nodes/root_type="MeshInstance3D" +nodes/root_type="Node3D" nodes/root_name="" nodes/apply_root_scale=true nodes/root_scale=1.0 diff --git a/assets/models/stairs_3.gltf.import b/assets/models/stairs_3.gltf.import index 9ecfc53..62110af 100644 --- a/assets/models/stairs_3.gltf.import +++ b/assets/models/stairs_3.gltf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/stairs_3.gltf-22172a41fb8ad833b8941bfa6111f36 [params] -nodes/root_type="MeshInstance3D" +nodes/root_type="Node3D" nodes/root_name="" nodes/apply_root_scale=true nodes/root_scale=1.0 diff --git a/assets/models/stairs_4.gltf.import b/assets/models/stairs_4.gltf.import index 4e77909..e181028 100644 --- a/assets/models/stairs_4.gltf.import +++ b/assets/models/stairs_4.gltf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/stairs_4.gltf-ab34f22899c6169c343831413f326e6 [params] -nodes/root_type="MeshInstance3D" +nodes/root_type="Node3D" nodes/root_name="" nodes/apply_root_scale=true nodes/root_scale=1.0 diff --git a/assets/models/stairs_5.gltf.import b/assets/models/stairs_5.gltf.import index 8fc2c9e..c5c58e3 100644 --- a/assets/models/stairs_5.gltf.import +++ b/assets/models/stairs_5.gltf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/stairs_5.gltf-152ac59889e35702f24b64bc9de6062 [params] -nodes/root_type="MeshInstance3D" +nodes/root_type="Node3D" nodes/root_name="" nodes/apply_root_scale=true nodes/root_scale=1.0 diff --git a/assets/models/stairs_6.gltf.import b/assets/models/stairs_6.gltf.import index abfe6c6..fd71626 100644 --- a/assets/models/stairs_6.gltf.import +++ b/assets/models/stairs_6.gltf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/stairs_6.gltf-59e685ed83ebcebad32d89c3ed47a83 [params] -nodes/root_type="MeshInstance3D" +nodes/root_type="Node3D" nodes/root_name="" nodes/apply_root_scale=true nodes/root_scale=1.0 diff --git a/assets/models/stairs_7.gltf.import b/assets/models/stairs_7.gltf.import index 1b2ac09..ce864a6 100644 --- a/assets/models/stairs_7.gltf.import +++ b/assets/models/stairs_7.gltf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/stairs_7.gltf-a512293401a4d8fe9ae86955a71ea78 [params] -nodes/root_type="MeshInstance3D" +nodes/root_type="Node3D" nodes/root_name="" nodes/apply_root_scale=true nodes/root_scale=1.0 diff --git a/assets/models/wall.gltf.import b/assets/models/wall.gltf.import index e859861..68fb783 100644 --- a/assets/models/wall.gltf.import +++ b/assets/models/wall.gltf.import @@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/wall.gltf-5a937a3e90517c0241c6d52793662436.sc [params] -nodes/root_type="MeshInstance3D" +nodes/root_type="Node3D" nodes/root_name="" nodes/apply_root_scale=true nodes/root_scale=1.0 diff --git a/menus/create.tscn b/menus/create.tscn index e93de9e..5ed8332 100644 --- a/menus/create.tscn +++ b/menus/create.tscn @@ -34,13 +34,13 @@ offset_bottom = 32.0 grow_horizontal = 2 grow_vertical = 2 -[node name="name" type="TextEdit" parent="player_customization"] +[node name="name" type="LineEdit" parent="player_customization"] custom_minimum_size = Vector2(256, 64) layout_mode = 2 theme_override_font_sizes/font_size = 32 placeholder_text = "Username" -[node name="ip" type="TextEdit" parent="player_customization"] +[node name="ip" type="LineEdit" parent="player_customization"] custom_minimum_size = Vector2(256, 64) layout_mode = 2 theme_override_font_sizes/font_size = 32 diff --git a/menus/main_menu.tscn b/menus/main_menu.tscn index 706382d..f1ae448 100644 --- a/menus/main_menu.tscn +++ b/menus/main_menu.tscn @@ -45,12 +45,6 @@ size_flags_vertical = 8 theme_override_font_sizes/font_size = 32 text = "Settings" -[node name="matchmaking" type="Button" parent="main_content"] -layout_mode = 2 -size_flags_vertical = 8 -theme_override_font_sizes/font_size = 32 -text = "Matchmaking Server (DEBUG)" - [node name="ver_string" type="VBoxContainer" parent="."] layout_mode = 1 anchors_preset = 3 @@ -71,4 +65,3 @@ horizontal_alignment = 2 [connection signal="pressed" from="main_content/join" to="." method="_on_join_pressed"] [connection signal="pressed" from="main_content/settings" to="." method="_on_settings_pressed"] -[connection signal="pressed" from="main_content/matchmaking" to="." method="_on_matchmaking_pressed"] diff --git a/menus/settings.tscn b/menus/settings.tscn index 070096b..d8e8a82 100644 --- a/menus/settings.tscn +++ b/menus/settings.tscn @@ -54,12 +54,48 @@ layout_mode = 2 theme_override_font_sizes/font_size = 32 text = "Matchmaking Server IP" -[node name="TextEdit" type="TextEdit" parent="VBoxContainer/ip"] -custom_minimum_size = Vector2(400, 56) +[node name="LineEdit" type="LineEdit" parent="VBoxContainer/ip"] +custom_minimum_size = Vector2(500, 56) layout_mode = 2 theme_override_font_sizes/font_size = 32 placeholder_text = "Matchmaking Server IP" script = ExtResource("3_faw6x") +[node name="port" type="HBoxContainer" parent="VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 + +[node name="Label" type="Label" parent="VBoxContainer/port"] +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +text = "Matchmaking Server Port" + +[node name="LineEdit" type="LineEdit" parent="VBoxContainer/port"] +custom_minimum_size = Vector2(500, 56) +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +placeholder_text = "Matchmaking Server Port" +script = ExtResource("3_faw6x") + +[node name="username" type="HBoxContainer" parent="VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 + +[node name="Label" type="Label" parent="VBoxContainer/username"] +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +text = "Username" + +[node name="LineEdit" type="LineEdit" parent="VBoxContainer/username"] +custom_minimum_size = Vector2(500, 56) +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +placeholder_text = "Username" +script = ExtResource("3_faw6x") + [connection signal="item_selected" from="VBoxContainer/fps_counter/OptionButton" to="VBoxContainer/fps_counter/OptionButton" method="_on_item_selected"] -[connection signal="text_changed" from="VBoxContainer/ip/TextEdit" to="VBoxContainer/ip/TextEdit" method="_on_text_changed"] +[connection signal="text_changed" from="VBoxContainer/ip/LineEdit" to="VBoxContainer/ip/LineEdit" method="_on_text_changed"] +[connection signal="text_changed" from="VBoxContainer/port/LineEdit" to="VBoxContainer/port/LineEdit" method="_on_text_changed"] +[connection signal="text_changed" from="VBoxContainer/username/LineEdit" to="VBoxContainer/username/LineEdit" method="_on_text_changed"] diff --git a/objects/computer.tscn b/objects/computer.tscn index 983528e..9ffa19a 100644 --- a/objects/computer.tscn +++ b/objects/computer.tscn @@ -6,6 +6,7 @@ size = Vector3(2, 1.75, 1.5) [sub_resource type="BoxShape3D" id="BoxShape3D_nfndi"] +size = Vector3(4, 1, 2.5) [node name="computers" type="StaticBody3D"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) @@ -18,16 +19,17 @@ shape = SubResource("BoxShape3D_bvobj") [node name="desk" type="CSGBox3D" parent="."] size = Vector3(2, 1, 1.5) +[node name="pc_1_area" type="Area3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.875, 0.5) + +[node name="CollisionShape3D" type="CollisionShape3D" parent="pc_1_area"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.75, -0.125) +shape = SubResource("BoxShape3D_nfndi") + [node name="pc_1" type="CSGBox3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.875, 0.5) size = Vector3(1, 0.75, 0.25) -[node name="pc_1_area" type="Area3D" parent="pc_1"] - -[node name="CollisionShape3D" type="CollisionShape3D" parent="pc_1/pc_1_area"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.75, 0.875) -shape = SubResource("BoxShape3D_nfndi") - [node name="Label3D" type="Label3D" parent="pc_1"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.13) text = "0" @@ -36,12 +38,6 @@ text = "0" transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0.75, 0.875, 0) size = Vector3(1, 0.75, 0.25) -[node name="pc_2_area" type="Area3D" parent="pc_2"] - -[node name="CollisionShape3D" type="CollisionShape3D" parent="pc_2/pc_2_area"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.75, 0.875) -shape = SubResource("BoxShape3D_nfndi") - [node name="Label3D" type="Label3D" parent="pc_2"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.13) text = "0" @@ -50,12 +46,6 @@ text = "0" transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -0.75, 0.875, 0) size = Vector3(1, 0.75, 0.25) -[node name="pc_3_area" type="Area3D" parent="pc_3"] - -[node name="CollisionShape3D" type="CollisionShape3D" parent="pc_3/pc_3_area"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.75, 0.875) -shape = SubResource("BoxShape3D_nfndi") - [node name="Label3D" type="Label3D" parent="pc_3"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.55271e-15, 0, 0.13) text = "0" @@ -63,10 +53,6 @@ text = "0" [node name="computer_tick" type="Timer" parent="."] autostart = true -[connection signal="body_entered" from="pc_1/pc_1_area" to="." method="_on_pc_1_area_body_entered"] -[connection signal="body_exited" from="pc_1/pc_1_area" to="." method="_on_pc_1_area_body_exited"] -[connection signal="body_entered" from="pc_2/pc_2_area" to="." method="_on_pc_2_area_body_entered"] -[connection signal="body_exited" from="pc_2/pc_2_area" to="." method="_on_pc_2_area_body_exited"] -[connection signal="body_entered" from="pc_3/pc_3_area" to="." method="_on_pc_3_area_body_entered"] -[connection signal="body_exited" from="pc_3/pc_3_area" to="." method="_on_pc_3_area_body_exited"] +[connection signal="body_entered" from="pc_1_area" to="." method="_on_pc_1_area_body_entered"] +[connection signal="body_exited" from="pc_1_area" to="." method="_on_pc_1_area_body_exited"] [connection signal="timeout" from="computer_tick" to="." method="_on_computer_tick_timeout"] diff --git a/scripts/client.gd b/scripts/client.gd index 0db4ff5..44fba43 100644 --- a/scripts/client.gd +++ b/scripts/client.gd @@ -17,7 +17,7 @@ func _ready(): func join_game(): var peer = ENetMultiplayerPeer.new() - peer.create_client(Game.settings["ip"], Game.settings["port"]) + peer.create_client(Game.settings["ip"], int(Game.settings["port"])) multiplayer.multiplayer_peer = peer func is_valid(sender_id, must_be_from_owner): diff --git a/scripts/computer.gd b/scripts/computer.gd index 34580e1..3dc135c 100644 --- a/scripts/computer.gd +++ b/scripts/computer.gd @@ -12,16 +12,16 @@ extends StaticBody3D const TARGET = 100 var current = 0 -var pc_occupied = [0, 0, 0] +var pc_occupied = 0 -var pc_body = [0, 0, 0] +var pc_body = [] func _ready(): Game.computers += 1 func _on_computer_tick_timeout(): if Game.is_server: - current += (pc_occupied[0] + pc_occupied[1] + pc_occupied[2]) + current += pc_occupied for id in Game.player_list: Client.rpc_id(id,"sync_computers",name, current) if current >= TARGET: @@ -34,36 +34,11 @@ func _on_computer_tick_timeout(): func _on_pc_1_area_body_entered(body): - if pc_occupied[0] == 0 and body is CharacterBody3D and !body.beast: - pc_occupied[0] = 1 - pc_body[0] = body - - -func _on_pc_2_area_body_entered(body): - if pc_occupied[1] == 0 and body is CharacterBody3D and !body.beast: - pc_occupied[1] = 1 - pc_body[1] = body - - -func _on_pc_3_area_body_entered(body): - if pc_occupied[2] == 0 and body is CharacterBody3D and !body.beast: - pc_occupied[2] = 1 - pc_body[2] = body - + if pc_occupied < 3 and body is CharacterBody3D and !body.beast and body not in pc_body: + pc_occupied += 1 + pc_body.append(body) func _on_pc_1_area_body_exited(body): - if pc_occupied[0] == 1 and body is CharacterBody3D and body == pc_body[0]: - pc_occupied[0] = 0 - pc_body[0] = 0 - - -func _on_pc_2_area_body_exited(body): - if pc_occupied[1] == 1 and body is CharacterBody3D and body == pc_body[1]: - pc_occupied[1] = 0 - pc_body[1] = 0 - - -func _on_pc_3_area_body_exited(body): - if pc_occupied[2] == 1 and body is CharacterBody3D and body == pc_body[2]: - pc_occupied[2] = 0 - pc_body[2] = 0 + if pc_occupied < 3 and body is CharacterBody3D and body in pc_body: + pc_occupied -= 1 + pc_body.erase(body) diff --git a/scripts/game.gd b/scripts/game.gd index 4c47e3f..a10496a 100644 --- a/scripts/game.gd +++ b/scripts/game.gd @@ -9,7 +9,7 @@ extends Node -var settings = {"save_version" = 3, "fps_counter" = 1, "port" = 35000, "ip" = "127.0.0.1"} +var settings = {"save_version" = 4, "fps_counter" = 1, "port" = 35000, "ip" = "127.0.0.1", "username" = "DefaultName"} var computers = 0 var players = 0 var map_name = "mansion" @@ -79,6 +79,7 @@ func reset(): func save_setting(setting_name, value): settings[setting_name] = value Save.saveJSON("user://settings.json", settings) + print("saved") func apply_settings(): players = player_list.size() - 1 @@ -111,9 +112,10 @@ func player_hit(target, beast): beast.got_one(target) func sync_player(node_name, position, rotation): - var current_character = get_tree().root.get_node("./"+map_name+"/"+node_name) - current_character.position = position - current_character.rotation = rotation + if get_tree().root.has_node("./"+map_name+"/"+node_name): + var current_character = get_tree().root.get_node("./"+map_name+"/"+node_name) + current_character.position = position + current_character.rotation = rotation func sync_hammer(node_name, rotation): var current_character = get_tree().root.get_node("./"+map_name+"/"+node_name+"/hammer") diff --git a/scripts/main_menu.gd b/scripts/main_menu.gd index f982504..0aada26 100644 --- a/scripts/main_menu.gd +++ b/scripts/main_menu.gd @@ -10,7 +10,7 @@ extends Control func matchmaking(): - get_tree().root.get_node("./main_menu").hide() + Matchmaking.create_game() func _ready(): Game.reset() @@ -18,7 +18,7 @@ func _ready(): $main_content/matchmaking.hide() $main_content/matchmaking.disabled = true if DisplayServer.get_name() == "headless": - _on_matchmaking_pressed() + matchmaking() func _on_join_pressed(): get_tree().change_scene_to_file("res://menus/create.tscn") @@ -27,9 +27,3 @@ func _on_join_pressed(): func _on_settings_pressed(): get_tree().change_scene_to_file("res://menus/settings.tscn") - - -func _on_matchmaking_pressed(): - Matchmaking.create_game() - matchmaking() - diff --git a/scripts/movement.gd b/scripts/movement.gd index 24ff3c9..3e06446 100644 --- a/scripts/movement.gd +++ b/scripts/movement.gd @@ -69,11 +69,11 @@ func _physics_process(delta): position.y += 1 if Input.is_action_pressed("click") and $hammer.rotation_degrees.x > 0: - $hammer.rotation_degrees.x -= 5 + $hammer.rotation_degrees.x -= 10 for id in Game.player_list: Client.rpc_id(id,"sync_hammer",name, $hammer.rotation) elif $hammer.rotation_degrees.x < 90 and !Input.is_action_pressed("click"): - $hammer.rotation_degrees.x += 5 + $hammer.rotation_degrees.x += 10 for id in Game.player_list: Client.rpc_id(id,"sync_hammer",name, $hammer.rotation) diff --git a/scripts/settings_text.gd b/scripts/settings_text.gd index f33ac86..f49d876 100644 --- a/scripts/settings_text.gd +++ b/scripts/settings_text.gd @@ -1,7 +1,18 @@ -extends TextEdit +## freeftf +## Copyright (C) 2024 Patrick_Pluto +## +## This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License along with this program. If not, see . + +extends LineEdit func _ready(): - text = Game.settings[get_parent().name] + text = str(Game.settings[get_parent().name]) -func _on_text_changed(): + + +func _on_text_changed(new_text): Game.save_setting(get_parent().name, text)