improve room handling and fix loading

This commit is contained in:
Nitwel 2023-12-11 15:24:10 +01:00
parent 218c3489a6
commit 9028d7eda8
3 changed files with 17 additions and 1 deletions

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=6 format=3 uid="uid://bswgmclohuqui"] [gd_scene load_steps=7 format=3 uid="uid://bswgmclohuqui"]
[ext_resource type="Script" path="res://content/system/room/room.gd" id="1_fccq0"] [ext_resource type="Script" path="res://content/system/room/room.gd" id="1_fccq0"]
[ext_resource type="Script" path="res://content/functions/clickable.gd" id="1_ugebq"] [ext_resource type="Script" path="res://content/functions/clickable.gd" id="1_ugebq"]
@ -8,6 +8,8 @@
[sub_resource type="ArrayMesh" id="ArrayMesh_7dibq"] [sub_resource type="ArrayMesh" id="ArrayMesh_7dibq"]
[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_ap613"]
[node name="Room" type="Node3D"] [node name="Room" type="Node3D"]
script = ExtResource("1_fccq0") script = ExtResource("1_fccq0")
@ -30,3 +32,11 @@ material_override = ExtResource("3_al1ev")
mesh = SubResource("ArrayMesh_7dibq") mesh = SubResource("ArrayMesh_7dibq")
[node name="WallCollisions" type="Node3D" parent="."] [node name="WallCollisions" type="Node3D" parent="."]
[node name="Celing" type="StaticBody3D" parent="."]
transform = Transform3D(-1, 8.74228e-08, 0, -8.74228e-08, -1, 0, 0, 0, 1, 0, 3.07, 0)
collision_layer = 0
collision_mask = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Celing"]
shape = SubResource("WorldBoundaryShape3D_ap613")

View File

@ -19,6 +19,10 @@ func _ready():
rooms.add_child(room) rooms.add_child(room)
else: else:
room = rooms.get_child(0) room = rooms.get_child(0)
if rooms.get_child_count() > 1:
for child in rooms.get_children():
if child != room:
child.queue_free()
) )
spawn_windows.on_button_down.connect(func(): spawn_windows.on_button_down.connect(func():

View File

@ -22,6 +22,8 @@ func save():
save_file.store_line(json_text) save_file.store_line(json_text)
func load(): func load():
clear()
if HomeApi.has_connected() == false: if HomeApi.has_connected() == false:
return return