Milestone 9 Development

This commit is contained in:
patrick_pluto 2024-08-31 14:58:41 +02:00
parent 5dc3f6f5c7
commit 785bbd8f05
83 changed files with 1089 additions and 4525 deletions

View file

@ -1,11 +1,18 @@
## freeftf
## Copyright (C) 2024 Patrick_Pluto
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## 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 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.
## 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 <https://www.gnu.org/licenses/>.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
extends Node
@ -67,7 +74,8 @@ func send_playerinfo():
@rpc("authority","call_remote","reliable")
func get_player_list(server_player_list):
Game.player_list = server_player_list
if !Game.is_running:
Game.player_list = server_player_list
@rpc("any_peer", "call_local", "reliable")
func start_game():
@ -80,9 +88,9 @@ func player_hit(target, beast):
Game.player_hit(target, beast)
@rpc("any_peer", "call_local", "unreliable")
func sync_player(node_path, position, rotation):
func sync_player(node_path, position, rotation, rotation2):
if is_valid(multiplayer.get_remote_sender_id(), false):
Game.sync_player(node_path, position, rotation)
Game.sync_player(node_path, position, rotation, rotation2)
@rpc("any_peer", "call_local", "unreliable")
func sync_hammer(node_path, rotation):

View file

@ -1,11 +1,18 @@
## freeftf
## Copyright (C) 2024 Patrick_Pluto
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## 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 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.
## 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 <https://www.gnu.org/licenses/>.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
extends StaticBody3D

View file

@ -1,17 +1,23 @@
## freeftf
## Copyright (C) 2024 Patrick_Pluto
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## 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 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.
## 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 <https://www.gnu.org/licenses/>.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
extends Control
var elevated = false
var done
var map_name = "mansion"
func _ready():
$player_customization/name.text = Game.settings["username"]
@ -58,7 +64,8 @@ func _process(_delta):
func _on_start_pressed():
for id in Game.player_list:
if Game.map_name == "test" && Game.player_list.size() <= 5:
for id in Game.player_list:
Client.rpc_id(id,"start_game")
func _input(_event):
@ -82,11 +89,11 @@ func _on_connected_ok():
func _on_option_button_item_selected(index):
match index:
0:
map_name = "mansion"
Game.map_name = "test"
_:
map_name = "mansion"
Game.map_name = "test"
for id in Game.player_list:
Client.rpc_id(id, "sync_level", map_name)
Client.rpc_id(id, "sync_level", Game.map_name)
func _sync_options(id):
Client.rpc_id(id, "sync_level", map_name)
Client.rpc_id(id, "sync_level", Game.map_name)

View file

@ -1,11 +1,18 @@
## freeftf
## Copyright (C) 2024 Patrick_Pluto
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## 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 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.
## 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 <https://www.gnu.org/licenses/>.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
extends StaticBody3D
@ -22,6 +29,8 @@ func _process(_delta):
elif occupied:
trapped_body.position = global_position
$Sprite3D.show()
else:
$Sprite3D.hide()
func _on_area_3d_body_entered(body):
if body is CharacterBody3D:

View file

@ -1,18 +1,25 @@
## freeftf
## Copyright (C) 2024 Patrick_Pluto
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## 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 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.
## 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 <https://www.gnu.org/licenses/>.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
extends Node
var settings = {"save_version" = 4, "fps_counter" = 1, "port" = 35000, "ip" = "127.0.0.1", "username" = "DefaultName"}
var settings = {"save_version" = 5, "fps_counter" = 1, "port" = 35000, "ip" = "interstellardevelopment.org", "username" = "DefaultName", "sensitivity" = 0.5}
var computers = 0
var players = 0
var map_name = "mansion"
var map_name = "test"
var is_running = false
var frozen = 0
var dead = 0
@ -20,6 +27,9 @@ var escaped = 0
var result = "You Lose"
var player_escaped = false
var is_beast = false
var prison = preload("res://objects/freezer.tscn")
var objective = preload("res://objects/computer.tscn")
var character = preload("res://objects/player.tscn")
# Server Variables
var player_name
@ -79,6 +89,7 @@ func reset():
player_list = {}
room_name = null
is_server = false
map_name = "test"
multiplayer.multiplayer_peer = Client.offline
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
@ -95,13 +106,20 @@ func start_game():
while !get_tree().root.has_node("./"+map_name+"/"):
await get_tree().create_timer(0.001).timeout
var map = get_tree().root.get_node("./"+map_name+"/")
for i in range(player_list.size()):
var obj = objective.instantiate()
obj.position = get_tree().root.get_node("./"+map_name+"/objective_spawns/"+str(i)).position
map.add_child(obj)
for i in range(player_list.size()):
var obj = prison.instantiate()
obj.position = get_tree().root.get_node("./"+map_name+"/prison_spawns/"+str(i)).position
map.add_child(obj)
var i = 0
for w in player_list:
var player = character.instantiate()
player.name = "player" + str(i)
player.position = get_tree().root.get_node("./"+map_name+"/player_spawns/"+str(i)).position
i += 1
player.position.z = -i*2.5
player.position.y = 1
map.add_child(player)
if is_server:
var random = randi() % player_list.size()
@ -116,11 +134,12 @@ func player_hit(target, beast):
target.captured(beast)
beast.got_one(target)
func sync_player(node_path, position, rotation):
func sync_player(node_path, position, rotation, rotation2):
if get_tree().root.has_node(node_path):
var current_character = get_tree().root.get_node(node_path)
current_character.position = position
current_character.rotation = rotation
get_tree().root.get_node(node_path).find_child("collision").rotation = rotation2
func sync_hammer(node_path, rotation):
var current_character = get_tree().root.get_node(node_path)

View file

@ -1,11 +1,18 @@
## freeftf
## Copyright (C) 2024 Patrick_Pluto
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## 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 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.
## 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 <https://www.gnu.org/licenses/>.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
extends Control

View file

@ -1,11 +1,18 @@
## freeftf
## Copyright (C) 2024 Patrick_Pluto
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## 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 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.
## 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 <https://www.gnu.org/licenses/>.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
extends Node

View file

@ -1,11 +1,18 @@
## freeftf
## Copyright (C) 2024 Patrick_Pluto
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## 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 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.
## 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 <https://www.gnu.org/licenses/>.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
extends Control

View file

@ -1,11 +1,18 @@
## freeftf
## Copyright (C) 2024 Patrick_Pluto
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## 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 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.
## 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 <https://www.gnu.org/licenses/>.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
extends Control

View file

@ -1,11 +1,18 @@
## freeftf
## Copyright (C) 2024 Patrick_Pluto
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## 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 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.
## 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 <https://www.gnu.org/licenses/>.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
extends Node

View file

@ -1,11 +1,18 @@
## freeftf
## Copyright (C) 2024 Patrick_Pluto
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## 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 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.
## 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 <https://www.gnu.org/licenses/>.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
extends CharacterBody3D
@ -90,7 +97,7 @@ func _physics_process(delta):
if !npc:
for id in Game.player_list:
Client.rpc_id(id,"sync_player",get_path(), position, rotation)
Client.rpc_id(id,"sync_player",get_path(), position, rotation, $collision.rotation)
if mouse_locked and !has_node("./game_menu"):
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
else:
@ -103,15 +110,12 @@ func _physics_process(delta):
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
var instance = menu.instantiate()
add_child(instance)
if Input.is_action_just_pressed("mouse_lock"):
mouse_locked = !mouse_locked
func _input(event):
if !npc:
if event is InputEventMouseMotion and (Input.is_action_pressed("cam_look") or $cam_y/Camera3D.position.z == 0) and !has_node("./game_menu"):
var camera_rotation = event.relative * 0.01
if event is InputEventMouseMotion and !has_node("./game_menu"):
var camera_rotation = event.relative * 0.01 * Game.settings["sensitivity"]
if $cam_y.rotation.x <= 1.6 && camera_rotation.y <= 0:
$cam_y.rotate(Vector3.RIGHT, -camera_rotation.y)
elif $cam_y.rotation.x >= -1.6 && camera_rotation.y >= 0:
@ -128,7 +132,7 @@ func beast_init():
Game.is_beast = true
beast = true
speed += 2
position.y += 10
position = get_parent().find_child("beast_spawns").find_child("0").position
$hammer/CSGBox3D/detect_hit.monitoring = true
$hammer/CSGBox3D/detect_hit.monitorable = true
$hammer/CSGBox3D/detect_hit/CollisionShape3D.disabled = false

View file

@ -1,11 +1,18 @@
## freeftf
## Copyright (C) 2024 Patrick_Pluto
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## 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 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.
## 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 <https://www.gnu.org/licenses/>.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
extends Control

View file

@ -1,11 +1,18 @@
## freeftf
## Copyright (C) 2024 Patrick_Pluto
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## 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 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.
## 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 <https://www.gnu.org/licenses/>.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
extends Node

View file

@ -1,11 +1,18 @@
## freeftf
## Copyright (C) 2024 Patrick_Pluto
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## 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 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.
## 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 <https://www.gnu.org/licenses/>.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
extends Node

View file

@ -1,11 +1,18 @@
## freeftf
## Copyright (C) 2024 Patrick_Pluto
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## 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 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.
## 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 <https://www.gnu.org/licenses/>.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
extends OptionButton

View file

@ -0,0 +1,23 @@
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## 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 <https://www.gnu.org/licenses/>.
extends HSlider
func _ready():
value = Game.settings[get_parent().name]
func _on_drag_ended(value_changed):
Game.save_setting(get_parent().name, value)

View file

@ -1,18 +1,23 @@
## freeftf
## Copyright (C) 2024 Patrick_Pluto
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## 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 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.
## 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 <https://www.gnu.org/licenses/>.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
extends LineEdit
func _ready():
text = str(Game.settings[get_parent().name])
func _on_text_changed(new_text):
Game.save_setting(get_parent().name, text)

View file

@ -1,11 +1,18 @@
## freeftf
## Copyright (C) 2024 Patrick_Pluto
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## 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 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.
## 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 <https://www.gnu.org/licenses/>.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
extends Area3D