mirror of
https://github.com/RPG-Research/bcirpg.git
synced 2024-04-16 14:23:01 +00:00
Created an empty project, for the team to work from; in regards to making the new toolset
This commit is contained in:
@ -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
|
||||
|
@ -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"]
|
||||
|
@ -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
|
||||
|
@ -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))
|
||||
|
||||
|
Reference in New Issue
Block a user