Created an empty project, for the team to work from; in regards to making the new toolset

This commit is contained in:
PersonGuyGit
2023-08-06 11:37:50 -06:00
parent 80787c9f2a
commit ef3c27b371
13 changed files with 89 additions and 16 deletions

View File

@ -10,6 +10,7 @@ onready var waiting_room = $WaitingRoom
onready var ready_btn = $WaitingRoom/CenterContainer/VBoxContainer/ReadyButton
func _ready():
player_name.text = Save.save_data["player_name"]
selected_IP.text = Server.DEFAULT_IP

View File

@ -83,7 +83,6 @@ margin_bottom = 186.0
text = "Join Session"
[node name="WaitingRoom" parent="." instance=ExtResource( 2 )]
visible = false
[connection signal="text_changed" from="CenterContainer/VBoxContainer/GridContainer/NameLineEdit" to="." method="_on_NameLineEdit_text_changed"]
[connection signal="pressed" from="CenterContainer/VBoxContainer/JoinButton" to="." method="_on_JoinButton_pressed"]

View File

@ -1,7 +1,6 @@
[gd_scene format=2]
[node name="WatingRoom" type="Popup" groups=["WaitingRoom"]]
visible = true
anchor_right = 1.0
anchor_bottom = 1.0
@ -16,9 +15,9 @@ anchor_bottom = 1.0
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
margin_left = 412.0
margin_top = 194.0
margin_top = 270.0
margin_right = 612.0
margin_bottom = 406.0
margin_bottom = 329.0
[node name="Label" type="Label" parent="CenterContainer/VBoxContainer"]
margin_right = 200.0

View File

@ -1,22 +1,20 @@
extends Node
const save_file = "user://save_file.json"
const SAVEGAME = "user://Savegame.json"
var save_data = {}
# Called when the node enters the scene tree for the first time.
func _ready():
save_data = get_data()
func get_data():
var file = File.new()
if not file.file_exists(save_file):
save_data = {"player_name": "Unnamed"}
if not file.file_exists(SAVEGAME):
save_data = {"Player_name": "Unnamed"}
save_game()
file.open(save_file, File.READ)
file.open(SAVEGAME, File.READ)
var content = file.get_as_text()
var data = parse_json(content)
save_data = data
@ -25,5 +23,6 @@ func get_data():
func save_game():
var save_game = File.new()
save_game.open(save_file, File.WRITE)
save_game.open(SAVEGAME, File.WRITE)
save_game.store_line(to_json(save_data))