diff --git a/assets/materials/pri-500.material b/assets/materials/pri-500.material new file mode 100644 index 0000000..d726374 --- /dev/null +++ b/assets/materials/pri-500.material @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92f36b94bc49caee6ea06bae49983840ce37d27c0e38309038c20163c8b1c7b4 +size 1035 diff --git a/assets/materials/pri.material b/assets/materials/pri.material new file mode 100644 index 0000000..4311e61 --- /dev/null +++ b/assets/materials/pri.material @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a64ff479a30fbf4433998ba63f47e35fc731c5fbc22ab54524fdcbee9528755 +size 1031 diff --git a/assets/materials/sec-500.material b/assets/materials/sec-500.material new file mode 100644 index 0000000..de858d5 --- /dev/null +++ b/assets/materials/sec-500.material @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f2e541d2068e21b4d90ea607a31c35e958323a6a2bf0c819bc61ac1ee730c88 +size 1035 diff --git a/assets/materials/ui_element.material b/assets/materials/ui_element.material deleted file mode 100644 index dbd3fe5..0000000 --- a/assets/materials/ui_element.material +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a5e6a3196f918f129fd1510750002b50eebce47f0bec850695552864f067db06 -size 1028 diff --git a/content/entities/camera/camera.tscn b/content/entities/camera/camera.tscn index df3a325..bcfc514 100644 --- a/content/entities/camera/camera.tscn +++ b/content/entities/camera/camera.tscn @@ -1,9 +1,12 @@ -[gd_scene load_steps=5 format=3 uid="uid://b0nq4wjfckxsa"] +[gd_scene load_steps=6 format=3 uid="uid://b0nq4wjfckxsa"] [ext_resource type="Script" path="res://content/entities/camera/camera.gd" id="1_htxq3"] [ext_resource type="Script" path="res://content/functions/movable.gd" id="2_e2u6o"] [ext_resource type="Script" path="res://content/functions/occludable.gd" id="3_jheyx"] +[sub_resource type="QuadMesh" id="QuadMesh_830bv"] +size = Vector2(0.15, 0.15) + [sub_resource type="BoxShape3D" id="BoxShape3D_te0pn"] size = Vector3(0.15, 0.15, 0.01) @@ -13,6 +16,8 @@ script = ExtResource("1_htxq3") [node name="View" type="Sprite3D" parent="."] [node name="MeshInstance3D" type="MeshInstance3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.00451169) +mesh = SubResource("QuadMesh_830bv") [node name="CollisionShape3D" type="CollisionShape3D" parent="."] shape = SubResource("BoxShape3D_te0pn") diff --git a/content/system/keyboard/keyboard.tscn b/content/system/keyboard/keyboard.tscn index 539dff2..de7c3c9 100644 --- a/content/system/keyboard/keyboard.tscn +++ b/content/system/keyboard/keyboard.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=7 format=3 uid="uid://lrehk38exd5n"] +[gd_scene load_steps=8 format=3 uid="uid://lrehk38exd5n"] [ext_resource type="Script" path="res://content/system/keyboard/keyboard.gd" id="1_maojw"] [ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="1_xdpwr"] [ext_resource type="Script" path="res://content/ui/menu/grid.gd" id="3_mx544"] [ext_resource type="Script" path="res://content/functions/movable.gd" id="4_86fct"] +[ext_resource type="Material" uid="uid://bnwimm214q67g" path="res://assets/materials/sec-500.material" id="5_8c8rc"] [sub_resource type="BoxShape3D" id="BoxShape3D_k5ib7"] size = Vector3(0.79, 0.01, 0.26) @@ -52,4 +53,5 @@ shape = SubResource("BoxShape3D_k5ib7") [node name="MeshInstance3D" type="MeshInstance3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.300719, -0.009645, 0.0928761) +material_override = ExtResource("5_8c8rc") mesh = SubResource("BoxMesh_7rntc") diff --git a/content/ui/components/button/button.tscn b/content/ui/components/button/button.tscn index 54cde07..9f8b81d 100644 --- a/content/ui/components/button/button.tscn +++ b/content/ui/components/button/button.tscn @@ -2,10 +2,7 @@ [ext_resource type="Script" path="res://content/ui/components/button/button.gd" id="1_74x7g"] [ext_resource type="ArrayMesh" uid="uid://iv4lk77axlk4" path="res://assets/immersive_home/button.obj" id="2_cve3l"] - -[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_8s8ln"] -transparency = 1 -albedo_color = Color(0, 0.501961, 0.886275, 1) +[ext_resource type="Material" uid="uid://bujy3egn1oqac" path="res://assets/materials/pri-500.material" id="2_wx7av"] [sub_resource type="ConvexPolygonShape3D" id="ConvexPolygonShape3D_o4j7g"] points = PackedVector3Array(-0.025, -0.01, -0.025, -0.025, 0.01, -0.025, 0.025, -0.01, -0.025, -0.025, -0.01, 0.025, -0.025, 0.01, 0.025, 0.025, 0.01, -0.025, 0.025, -0.01, 0.025, 0.025, 0.01, 0.025) @@ -82,15 +79,15 @@ collision_mask = 0 [node name="MeshInstance3D" type="MeshInstance3D" parent="Body"] transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, -0.005, 0) +material_override = ExtResource("2_wx7av") mesh = ExtResource("2_cve3l") skeleton = NodePath("../..") -surface_material_override/0 = SubResource("StandardMaterial3D_8s8ln") [node name="CollisionShape3D" type="CollisionShape3D" parent="Body"] shape = SubResource("ConvexPolygonShape3D_o4j7g") [node name="Label" type="Label3D" parent="Body"] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.005, 0) +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.0107199, 0) pixel_size = 0.001 text = "Example Text" font_size = 10 diff --git a/content/ui/components/input/input.tscn b/content/ui/components/input/input.tscn index 0aefa4c..b838a37 100644 --- a/content/ui/components/input/input.tscn +++ b/content/ui/components/input/input.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=10 format=3 uid="uid://blrhy2uccrdn4"] -[ext_resource type="Material" uid="uid://bujy3egn1oqac" path="res://assets/materials/ui_element.material" id="1_0kd7r"] +[ext_resource type="Material" uid="uid://bujy3egn1oqac" path="res://assets/materials/pri-500.material" id="1_0kd7r"] [ext_resource type="Script" path="res://content/ui/components/input/input.gd" id="1_uml3t"] [ext_resource type="FontVariation" uid="uid://d2ofyimg5s65q" path="res://assets/fonts/ui_font_500.tres" id="3_ij5fh"] diff --git a/content/ui/menu/menu.tscn b/content/ui/menu/menu.tscn index a91b2c6..2305381 100644 --- a/content/ui/menu/menu.tscn +++ b/content/ui/menu/menu.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=13 format=3 uid="uid://c3kdssrmv84kv"] +[gd_scene load_steps=14 format=3 uid="uid://c3kdssrmv84kv"] [ext_resource type="Script" path="res://content/ui/menu/menu.gd" id="1_ng4u3"] +[ext_resource type="Material" uid="uid://bnwimm214q67g" path="res://assets/materials/sec-500.material" id="2_0x5at"] [ext_resource type="PackedScene" uid="uid://crrb0l3ekuotj" path="res://content/ui/menu/edit/edit_menu.tscn" id="4_r2raj"] [ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="5_w4i01"] [ext_resource type="ArrayMesh" uid="uid://cbqhhnknyium2" path="res://assets/immersive_home_panels/immersive_home_panels.obj" id="7_f4u4o"] @@ -160,6 +161,7 @@ script = ExtResource("1_ng4u3") [node name="Background" type="MeshInstance3D" parent="AnimationContainer"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.21, 0, 0.15) +material_override = ExtResource("2_0x5at") mesh = SubResource("BoxMesh_08du6") skeleton = NodePath("../..") diff --git a/content/ui/menu/settings/settings_menu.gd b/content/ui/menu/settings/settings_menu.gd index f454b0e..08cba1f 100644 --- a/content/ui/menu/settings/settings_menu.gd +++ b/content/ui/menu/settings/settings_menu.gd @@ -10,6 +10,8 @@ const credits_scene = preload("./credits.tscn") @onready var input_token = $Content/InputToken @onready var button_connect = $Content/Connect @onready var credits = $Content/Credits/Clickable +@onready var save = $Content/Save +@onready var clear_save = $Content/ClearSave @onready var background = $Background func _ready(): @@ -52,6 +54,14 @@ func _ready(): }) ) + save.on_button_down.connect(func(): + SaveSystem.save() + ) + + clear_save.on_button_down.connect(func(): + SaveSystem.clear() + ) + HomeApi.on_connect.connect(func(): connection_status.text = "Connected" ) diff --git a/content/ui/menu/settings/settings_menu.tscn b/content/ui/menu/settings/settings_menu.tscn index 642900f..8657ecb 100644 --- a/content/ui/menu/settings/settings_menu.tscn +++ b/content/ui/menu/settings/settings_menu.tscn @@ -113,3 +113,13 @@ outline_size = 0 [node name="Clickable" type="Node" parent="Content/Credits"] script = ExtResource("3_qmg6q") + +[node name="Save" parent="Content" instance=ExtResource("1_faxng")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.04, 0, 0.17) +label = "save" +icon = true + +[node name="ClearSave" parent="Content" instance=ExtResource("1_faxng")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.1, 0, 0.17) +label = "close" +icon = true diff --git a/lib/globals/save_system.gd b/lib/globals/save_system.gd index f9d4d0d..edfe035 100644 --- a/lib/globals/save_system.gd +++ b/lib/globals/save_system.gd @@ -2,6 +2,9 @@ extends Node const VariantSerializer = preload("res://lib/utils/variant_serializer.gd") +func clear(): + _clear_save_tree(get_tree().root.get_node("Main")) + func save(): if HomeApi.has_connected() == false: return @@ -38,6 +41,12 @@ func load(): else: _build_save_tree(save_tree) +func _clear_save_tree(node: Node): + for child in node.get_children(): + _clear_save_tree(child) + + if node.has_method("_save"): + node.queue_free() func _generate_save_tree(node: Node): var children = []