From 6ee4b8dbe0f5bd61cbd05ccebf57d6552fcd8a24 Mon Sep 17 00:00:00 2001 From: Nitwel Date: Sun, 26 Nov 2023 00:02:03 +0100 Subject: [PATCH] add credits and basketball +ui component improvements --- assets/badges/github.svg.import | 37 +++++++++++++ assets/badges/itch.svg.import | 37 +++++++++++++ assets/badges/sidequest.svg.import | 37 +++++++++++++ assets/design.afdesign | 4 +- assets/models/basketball/license.txt | 11 ++++ assets/models/basketball/scene.bin | 3 ++ assets/models/basketball/scene.gltf | 3 ++ assets/models/basketball/scene.gltf.import | 32 +++++++++++ .../textures/Scene_-_Root_baseColor.jpeg | 3 ++ .../Scene_-_Root_baseColor.jpeg.import | 36 +++++++++++++ .../Scene_-_Root_metallicRoughness.png | 3 ++ .../Scene_-_Root_metallicRoughness.png.import | 36 +++++++++++++ .../textures/Scene_-_Root_normal.jpeg | 3 ++ .../textures/Scene_-_Root_normal.jpeg.import | 36 +++++++++++++ .../entities/media_player/media_player.tscn | 14 +++++ content/main.tscn | 1 - content/system/keyboard/key.tscn | 20 ------- content/system/keyboard/keyboard.gd | 8 +-- content/system/keyboard/keyboard.tscn | 33 +++--------- content/system/raycast/raycast.gd | 8 +-- content/ui/components/button/button.gd | 22 +++++++- content/ui/components/button/button.tscn | 10 ++++ content/ui/components/input/input.gd | 26 ++++----- content/ui/components/input/input.tscn | 2 + content/ui/{ => menu/edit}/device/device.gd | 0 content/ui/{ => menu/edit}/device/device.tscn | 2 +- content/ui/menu/edit/edit_menu.gd | 32 +++-------- content/ui/menu/edit/edit_menu.tscn | 23 ++------ content/ui/{ => menu/edit}/entity/entity.gd | 0 content/ui/{ => menu/edit}/entity/entity.tscn | 2 +- content/ui/menu/edit/entity_creator.gd | 21 ++++++++ content/ui/menu/menu.tscn | 53 ++++--------------- content/ui/menu/room/room_menu.gd | 4 +- content/ui/menu/room/room_menu.tscn | 13 ++--- content/ui/menu/settings/ball.tscn | 16 +++--- content/ui/menu/settings/credits.gd | 8 +++ content/ui/menu/settings/credits.tscn | 50 +++++++++++++++++ content/ui/menu/settings/settings_menu.gd | 15 +++++- content/ui/menu/settings/settings_menu.tscn | 47 +++++++++++----- 39 files changed, 517 insertions(+), 194 deletions(-) create mode 100644 assets/badges/github.svg.import create mode 100644 assets/badges/itch.svg.import create mode 100644 assets/badges/sidequest.svg.import create mode 100644 assets/models/basketball/license.txt create mode 100644 assets/models/basketball/scene.bin create mode 100644 assets/models/basketball/scene.gltf create mode 100644 assets/models/basketball/scene.gltf.import create mode 100644 assets/models/basketball/textures/Scene_-_Root_baseColor.jpeg create mode 100644 assets/models/basketball/textures/Scene_-_Root_baseColor.jpeg.import create mode 100644 assets/models/basketball/textures/Scene_-_Root_metallicRoughness.png create mode 100644 assets/models/basketball/textures/Scene_-_Root_metallicRoughness.png.import create mode 100644 assets/models/basketball/textures/Scene_-_Root_normal.jpeg create mode 100644 assets/models/basketball/textures/Scene_-_Root_normal.jpeg.import create mode 100644 content/entities/media_player/media_player.tscn delete mode 100644 content/system/keyboard/key.tscn rename content/ui/{ => menu/edit}/device/device.gd (100%) rename content/ui/{ => menu/edit}/device/device.tscn (88%) rename content/ui/{ => menu/edit}/entity/entity.gd (100%) rename content/ui/{ => menu/edit}/entity/entity.tscn (90%) create mode 100644 content/ui/menu/edit/entity_creator.gd create mode 100644 content/ui/menu/settings/credits.gd create mode 100644 content/ui/menu/settings/credits.tscn diff --git a/assets/badges/github.svg.import b/assets/badges/github.svg.import new file mode 100644 index 0000000..c7b2de4 --- /dev/null +++ b/assets/badges/github.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d2m7dsy45cm45" +path="res://.godot/imported/github.svg-b4e0b9256be113f9a0665e9c95790b59.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/badges/github.svg" +dest_files=["res://.godot/imported/github.svg-b4e0b9256be113f9a0665e9c95790b59.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/badges/itch.svg.import b/assets/badges/itch.svg.import new file mode 100644 index 0000000..f3ac49c --- /dev/null +++ b/assets/badges/itch.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://7ygo5y1i64ww" +path="res://.godot/imported/itch.svg-3d15cca1133e170befe9a26d9161ddf6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/badges/itch.svg" +dest_files=["res://.godot/imported/itch.svg-3d15cca1133e170befe9a26d9161ddf6.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/badges/sidequest.svg.import b/assets/badges/sidequest.svg.import new file mode 100644 index 0000000..cbdf0e7 --- /dev/null +++ b/assets/badges/sidequest.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://4eu0xm566idr" +path="res://.godot/imported/sidequest.svg-e25d54ee38a5859d424a8e70762bf4ef.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/badges/sidequest.svg" +dest_files=["res://.godot/imported/sidequest.svg-e25d54ee38a5859d424a8e70762bf4ef.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/design.afdesign b/assets/design.afdesign index 5df2868..577f591 100644 --- a/assets/design.afdesign +++ b/assets/design.afdesign @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9e25fabb4455ad3207f25fbc1ca0410e44a66ae995241d3a636f457730f50cdf -size 2947483 +oid sha256:7d7a2a14b2ff07822a00a59534d6ab1126984356895e27b703005e9eb0de5e81 +size 3379915 diff --git a/assets/models/basketball/license.txt b/assets/models/basketball/license.txt new file mode 100644 index 0000000..c181abb --- /dev/null +++ b/assets/models/basketball/license.txt @@ -0,0 +1,11 @@ +Model Information: +* title: Basketball +* source: https://sketchfab.com/3d-models/basketball-19f76a0df81747369acf46406b36afa6 +* author: Mateus Schwaab (https://sketchfab.com/Mehrus) + +Model License: +* license type: CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/) +* requirements: Author must be credited. Commercial use is allowed. + +If you use this 3D model in your project be sure to copy paste this credit wherever you share it: +This work is based on "Basketball" (https://sketchfab.com/3d-models/basketball-19f76a0df81747369acf46406b36afa6) by Mateus Schwaab (https://sketchfab.com/Mehrus) licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/) \ No newline at end of file diff --git a/assets/models/basketball/scene.bin b/assets/models/basketball/scene.bin new file mode 100644 index 0000000..c932990 --- /dev/null +++ b/assets/models/basketball/scene.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:649cd7ff5e3cb7afbb8f5a54722df0abd83cc3c7927745e11f14462bd3e30c7b +size 27744 diff --git a/assets/models/basketball/scene.gltf b/assets/models/basketball/scene.gltf new file mode 100644 index 0000000..15692dc --- /dev/null +++ b/assets/models/basketball/scene.gltf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:19f5b238df4d029855b1e53f2f421ad4fde09eccdad054cc026522eef5360425 +size 4942 diff --git a/assets/models/basketball/scene.gltf.import b/assets/models/basketball/scene.gltf.import new file mode 100644 index 0000000..dbdd771 --- /dev/null +++ b/assets/models/basketball/scene.gltf.import @@ -0,0 +1,32 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://o1qeng8cu244" +path="res://.godot/imported/scene.gltf-9936f7e96e5b12c84242086a50bcd0af.scn" + +[deps] + +source_file="res://assets/models/basketball/scene.gltf" +dest_files=["res://.godot/imported/scene.gltf-9936f7e96e5b12c84242086a50bcd0af.scn"] + +[params] + +nodes/root_type="Node3D" +nodes/root_name="Scene Root" +nodes/apply_root_scale=true +nodes/root_scale=0.001 +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +import_script/path="" +_subresources={} +gltf/embedded_image_handling=1 diff --git a/assets/models/basketball/textures/Scene_-_Root_baseColor.jpeg b/assets/models/basketball/textures/Scene_-_Root_baseColor.jpeg new file mode 100644 index 0000000..5551cb0 --- /dev/null +++ b/assets/models/basketball/textures/Scene_-_Root_baseColor.jpeg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec14f788dce23df6b5cc30993dd0cded09502a67367ea053aafe88ec06e534f1 +size 274128 diff --git a/assets/models/basketball/textures/Scene_-_Root_baseColor.jpeg.import b/assets/models/basketball/textures/Scene_-_Root_baseColor.jpeg.import new file mode 100644 index 0000000..064919e --- /dev/null +++ b/assets/models/basketball/textures/Scene_-_Root_baseColor.jpeg.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bw35kpxn8wn1t" +path.s3tc="res://.godot/imported/Scene_-_Root_baseColor.jpeg-669d7332c39c241b55cea79d53931b22.s3tc.ctex" +path.etc2="res://.godot/imported/Scene_-_Root_baseColor.jpeg-669d7332c39c241b55cea79d53931b22.etc2.ctex" +metadata={ +"imported_formats": ["s3tc_bptc", "etc2_astc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/models/basketball/textures/Scene_-_Root_baseColor.jpeg" +dest_files=["res://.godot/imported/Scene_-_Root_baseColor.jpeg-669d7332c39c241b55cea79d53931b22.s3tc.ctex", "res://.godot/imported/Scene_-_Root_baseColor.jpeg-669d7332c39c241b55cea79d53931b22.etc2.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/models/basketball/textures/Scene_-_Root_metallicRoughness.png b/assets/models/basketball/textures/Scene_-_Root_metallicRoughness.png new file mode 100644 index 0000000..e8e5922 --- /dev/null +++ b/assets/models/basketball/textures/Scene_-_Root_metallicRoughness.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9de5ebd70a2387b83dfb3c7888510a9c892f4897610b227147ebb13f5fb4fd51 +size 33554 diff --git a/assets/models/basketball/textures/Scene_-_Root_metallicRoughness.png.import b/assets/models/basketball/textures/Scene_-_Root_metallicRoughness.png.import new file mode 100644 index 0000000..9652c50 --- /dev/null +++ b/assets/models/basketball/textures/Scene_-_Root_metallicRoughness.png.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bj2xcn273ri2q" +path.s3tc="res://.godot/imported/Scene_-_Root_metallicRoughness.png-3693ee5b1966a3ac4738bca1d2eaf3a8.s3tc.ctex" +path.etc2="res://.godot/imported/Scene_-_Root_metallicRoughness.png-3693ee5b1966a3ac4738bca1d2eaf3a8.etc2.ctex" +metadata={ +"imported_formats": ["s3tc_bptc", "etc2_astc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/models/basketball/textures/Scene_-_Root_metallicRoughness.png" +dest_files=["res://.godot/imported/Scene_-_Root_metallicRoughness.png-3693ee5b1966a3ac4738bca1d2eaf3a8.s3tc.ctex", "res://.godot/imported/Scene_-_Root_metallicRoughness.png-3693ee5b1966a3ac4738bca1d2eaf3a8.etc2.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/models/basketball/textures/Scene_-_Root_normal.jpeg b/assets/models/basketball/textures/Scene_-_Root_normal.jpeg new file mode 100644 index 0000000..d4d94fc --- /dev/null +++ b/assets/models/basketball/textures/Scene_-_Root_normal.jpeg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0aabefd3229a3c8ea281e103533522c90613ee447da841218c45da69ea5161f +size 669017 diff --git a/assets/models/basketball/textures/Scene_-_Root_normal.jpeg.import b/assets/models/basketball/textures/Scene_-_Root_normal.jpeg.import new file mode 100644 index 0000000..efc65ec --- /dev/null +++ b/assets/models/basketball/textures/Scene_-_Root_normal.jpeg.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cw3ucknjur4e1" +path.s3tc="res://.godot/imported/Scene_-_Root_normal.jpeg-5e054ed6b46e2f7b3e419b7d8ec5f86a.s3tc.ctex" +path.etc2="res://.godot/imported/Scene_-_Root_normal.jpeg-5e054ed6b46e2f7b3e419b7d8ec5f86a.etc2.ctex" +metadata={ +"imported_formats": ["s3tc_bptc", "etc2_astc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/models/basketball/textures/Scene_-_Root_normal.jpeg" +dest_files=["res://.godot/imported/Scene_-_Root_normal.jpeg-5e054ed6b46e2f7b3e419b7d8ec5f86a.s3tc.ctex", "res://.godot/imported/Scene_-_Root_normal.jpeg-5e054ed6b46e2f7b3e419b7d8ec5f86a.etc2.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=1 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=1 +roughness/src_normal="res://assets/models/basketball/textures/Scene_-_Root_normal.jpeg" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/content/entities/media_player/media_player.tscn b/content/entities/media_player/media_player.tscn new file mode 100644 index 0000000..9acf581 --- /dev/null +++ b/content/entities/media_player/media_player.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=2 format=3 uid="uid://dyktdg7ggiwl4"] + +[ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="1_8opk3"] + +[node name="Node3D" type="Node3D"] + +[node name="Button" parent="." instance=ExtResource("1_8opk3")] +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, -4.65661e-08, 0, 0) + +[node name="Button2" parent="." instance=ExtResource("1_8opk3")] +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, -0.07, 0, 0) + +[node name="Button3" parent="." instance=ExtResource("1_8opk3")] +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0.07, 0, 0) diff --git a/content/main.tscn b/content/main.tscn index 409b0a1..047de62 100644 --- a/content/main.tscn +++ b/content/main.tscn @@ -25,7 +25,6 @@ background_color = Color(0.466667, 0.47451, 0.462745, 0) sky = SubResource("Sky_vhymk") ambient_light_color = Color(1, 1, 1, 1) ambient_light_sky_contribution = 0.72 -ssao_enabled = true ssao_radius = 6.52 ssao_intensity = 5.68 diff --git a/content/system/keyboard/key.tscn b/content/system/keyboard/key.tscn deleted file mode 100644 index 188ca90..0000000 --- a/content/system/keyboard/key.tscn +++ /dev/null @@ -1,20 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://c40yyuev2k8c2"] - -[ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="1_byj6h"] -[ext_resource type="Material" uid="uid://bujy3egn1oqac" path="res://assets/materials/ui_element.material" id="2_sskv8"] - -[sub_resource type="BoxMesh" id="BoxMesh_guj81"] -resource_local_to_scene = true -material = ExtResource("2_sskv8") -size = Vector3(0.05, 0.02, 0.05) - -[node name="Button" groups=["ui_focus_skip"] instance=ExtResource("1_byj6h")] - -[node name="MeshInstance3D" parent="." index="0"] -mesh = SubResource("BoxMesh_guj81") - -[node name="Label" type="Label3D" parent="." index="3"] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.012, 0) -pixel_size = 0.001 -text = "E" -outline_size = 0 diff --git a/content/system/keyboard/keyboard.gd b/content/system/keyboard/keyboard.gd index cfaebe3..751f108 100644 --- a/content/system/keyboard/keyboard.gd +++ b/content/system/keyboard/keyboard.gd @@ -1,7 +1,7 @@ @tool extends StaticBody3D -const key_scene = preload("res://content/system/keyboard/key.tscn") +const button_scene = preload("res://content/ui/components/button/button.tscn") @onready var keys = $Keys @onready var caps_button = $Caps @@ -68,9 +68,11 @@ func _ready(): ) func create_key(key: Key): - var key_node = key_scene.instantiate() + var key_node = button_scene.instantiate() - key_node.get_node("Label").text = EventKey.key_to_string(key, caps) + key_node.label = EventKey.key_to_string(key, caps) + key_node.add_to_group("ui_focus_skip") + key_node.get_node("Label").font_size = 32 key_node.set_meta("key", key) return key_node diff --git a/content/system/keyboard/keyboard.tscn b/content/system/keyboard/keyboard.tscn index 294a3bd..9450a96 100644 --- a/content/system/keyboard/keyboard.tscn +++ b/content/system/keyboard/keyboard.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=8 format=3 uid="uid://lrehk38exd5n"] +[gd_scene load_steps=7 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="FontVariation" uid="uid://sshfnckriqxn" path="res://assets/icons/icons.tres" id="3_3glvw"] [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"] @@ -18,38 +17,20 @@ script = ExtResource("1_maojw") [node name="Backspace" parent="." groups=["ui_focus_skip"] instance=ExtResource("1_xdpwr")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.66, 0, 0.02) +label = "backspace" +icon = true metadata/key = 4194308 -[node name="Label3D" type="Label3D" parent="Backspace"] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.012, 0) -pixel_size = 0.001 -text = "backspace" -font = ExtResource("3_3glvw") -font_size = 48 -outline_size = 0 - [node name="Caps" parent="." groups=["ui_focus_skip"] instance=ExtResource("1_xdpwr")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.06, 0, 0.15) +label = "keyboard_capslock" +icon = true toggleable = true -[node name="Label3D" type="Label3D" parent="Caps"] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.012, 0) -pixel_size = 0.001 -text = "keyboard_capslock" -font = ExtResource("3_3glvw") -font_size = 48 -outline_size = 0 - [node name="Paste" parent="." groups=["ui_focus_skip"] instance=ExtResource("1_xdpwr")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.66, 0, 0.18) - -[node name="Label3D" type="Label3D" parent="Paste"] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.012, 0) -pixel_size = 0.001 -text = "assignment" -font = ExtResource("3_3glvw") -font_size = 48 -outline_size = 0 +label = "assignment" +icon = true [node name="Keys" type="Node3D" parent="."] script = ExtResource("3_mx544") diff --git a/content/system/raycast/raycast.gd b/content/system/raycast/raycast.gd index 5c4cca9..db1c963 100644 --- a/content/system/raycast/raycast.gd +++ b/content/system/raycast/raycast.gd @@ -30,6 +30,11 @@ func _handle_move(): moved = true + # reset if last_collided gets deleted + if is_instance_valid(last_collided) == false: + last_collided = null + return + if is_pressed: _emit_event("press_move", last_collided ) @@ -65,9 +70,6 @@ func _on_button_pressed(button: String): _emit_event("grab_down", collider ) func _on_button_released(button: String): - if last_collided == null: - return - match button: "trigger_click": if is_pressed: diff --git a/content/ui/components/button/button.gd b/content/ui/components/button/button.gd index 1d3f351..bd48488 100644 --- a/content/ui/components/button/button.gd +++ b/content/ui/components/button/button.gd @@ -1,9 +1,29 @@ +@tool + extends StaticBody3D class_name Button3D signal on_button_down() signal on_button_up() +const IconFont = preload("res://assets/icons/icons.tres") + +@onready var label_node: Label3D = $Label + +@export var label: String = "": + set(value): + if !is_inside_tree(): await ready + label_node.text = value + get: + return label_node.text +@export var icon: bool = false: + set(value): + icon = value + + if !is_inside_tree(): await ready + label_node.font = IconFont if value else null + label_node.font_size = 48 if value else 10 + @export var toggleable: bool = false @export var disabled: bool = false @export var external_state: bool = false @@ -26,7 +46,7 @@ var active: bool = false : func _ready(): if initial_active: active = true - + func _on_press_down(event): if disabled: event.bubbling = false diff --git a/content/ui/components/button/button.tscn b/content/ui/components/button/button.tscn index a2c6572..ecd1ebd 100644 --- a/content/ui/components/button/button.tscn +++ b/content/ui/components/button/button.tscn @@ -81,6 +81,7 @@ _data = { [node name="Button" type="StaticBody3D" groups=["ui_focus"]] script = ExtResource("1_74x7g") +label = "Example Text" [node name="MeshInstance3D" type="MeshInstance3D" parent="."] mesh = SubResource("BoxMesh_jwpm5") @@ -92,3 +93,12 @@ shape = SubResource("ConvexPolygonShape3D_o4j7g") libraries = { "": SubResource("AnimationLibrary_sbgno") } + +[node name="Label" type="Label3D" parent="."] +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.011, 0) +pixel_size = 0.001 +text = "Example Text" +font_size = 10 +outline_size = 0 +autowrap_mode = 3 +width = 50.0 diff --git a/content/ui/components/input/input.gd b/content/ui/components/input/input.gd index 5633288..97dc833 100644 --- a/content/ui/components/input/input.gd +++ b/content/ui/components/input/input.gd @@ -13,7 +13,13 @@ var text_handler = preload("res://content/ui/components/input/text_handler.gd"). get: return text_handler.width set(value): - set_width(value) + text_handler.width = value + + if !is_inside_tree(): await ready + + mesh_box.mesh.size.x = value + collision.shape.size.x = value + label.position.x = -value / 2 + 0.002 @export var text: String: get: @@ -22,8 +28,8 @@ var text_handler = preload("res://content/ui/components/input/text_handler.gd"). var focused = Engine.is_editor_hint() == false && EventSystem.is_focused(self) == false text_handler.set_text(value, focused) - if label != null: - label.text = text_handler.get_display_text() + if !is_inside_tree(): await ready + label.text = text_handler.get_display_text() var keyboard_input: bool = false @@ -31,8 +37,6 @@ var input_plane = Plane(Vector3.UP, Vector3.ZERO) func _ready(): text_handler.label = label - text = text - width = width if Engine.is_editor_hint(): return @@ -62,17 +66,7 @@ func _process(_delta): if get_tree().debug_collisions_hint && OS.get_name() != "Android": _draw_debug_text_gaps() - -func set_width(value: float): - text_handler.width = value - - if mesh_box == null || collision == null || label == null: - return - - mesh_box.mesh.size.x = value - collision.shape.size.x = value - label.position.x = -value / 2 + 0.002 - + func _on_press_move(event): var ray_pos = event.ray.global_position var ray_dir = -event.ray.global_transform.basis.z diff --git a/content/ui/components/input/input.tscn b/content/ui/components/input/input.tscn index fd77aa9..ff9666c 100644 --- a/content/ui/components/input/input.tscn +++ b/content/ui/components/input/input.tscn @@ -55,6 +55,7 @@ _data = { [node name="Input" type="StaticBody3D" groups=["ui_focus"]] script = ExtResource("1_uml3t") width = 0.2 +text = "Example" [node name="Box" type="MeshInstance3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.003, 0) @@ -68,6 +69,7 @@ shape = SubResource("BoxShape3D_x4yp8") [node name="Label" type="Label3D" parent="."] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, -0.098, 0.00618291, 0) pixel_size = 0.001 +text = "Example" font = ExtResource("3_ij5fh") font_size = 18 outline_size = 0 diff --git a/content/ui/device/device.gd b/content/ui/menu/edit/device/device.gd similarity index 100% rename from content/ui/device/device.gd rename to content/ui/menu/edit/device/device.gd diff --git a/content/ui/device/device.tscn b/content/ui/menu/edit/device/device.tscn similarity index 88% rename from content/ui/device/device.tscn rename to content/ui/menu/edit/device/device.tscn index 0d866b1..22373f1 100644 --- a/content/ui/device/device.tscn +++ b/content/ui/menu/edit/device/device.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=4 format=3 uid="uid://dbe8slnyhro2n"] -[ext_resource type="Script" path="res://content/ui/device/device.gd" id="1_rbo86"] +[ext_resource type="Script" path="res://content/ui/menu/edit/device/device.gd" id="1_rbo86"] [ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="2_go2es"] [ext_resource type="Script" path="res://content/functions/clickable.gd" id="3_6wicx"] diff --git a/content/ui/menu/edit/edit_menu.gd b/content/ui/menu/edit/edit_menu.gd index 4804e7e..c34537a 100644 --- a/content/ui/menu/edit/edit_menu.gd +++ b/content/ui/menu/edit/edit_menu.gd @@ -1,10 +1,8 @@ extends Node3D -const Device = preload("res://content/ui/device/device.tscn") -const Entity = preload("res://content/ui/entity/entity.tscn") -const Switch = preload("res://content/entities/switch/switch.tscn") -const Light = preload("res://content/entities/light/light.tscn") -const Sensor = preload("res://content/entities/sensor/sensor.tscn") +const Device = preload("./device/device.tscn") +const Entity = preload("./entity/entity.tscn") +const EntityCreator = preload("./entity_creator.gd") @onready var devices_node: GridContainer3D = $Devices @onready var next_page_button = $Buttons/NextPageButton @@ -150,29 +148,11 @@ func _on_entity_click(entity_name): return var type = entity_name.split(".")[0] - print(type) AudioPlayer.play_effect("spawn") - if type == "switch": - var switch = Switch.instantiate() - switch.entity_id = entity_name - - switch.set_position(global_position) - get_node("/root").add_child(switch) - - if type == "light": - var light = Light.instantiate() - light.entity_id = entity_name - - light.set_position(global_position) - get_node("/root").add_child(light) - - if type == "sensor": - var sensor = Sensor.instantiate() - sensor.entity_id = entity_name - - sensor.set_position(global_position) - get_node("/root").add_child(sensor) + var entity = EntityCreator.create_entity(type, entity_name) + entity.set_position(global_position) + get_node("/root").add_child(entity) func clear_menu(): for child in devices_node.get_children(): diff --git a/content/ui/menu/edit/edit_menu.tscn b/content/ui/menu/edit/edit_menu.tscn index 1b45f16..b9ca02f 100644 --- a/content/ui/menu/edit/edit_menu.tscn +++ b/content/ui/menu/edit/edit_menu.tscn @@ -1,9 +1,8 @@ -[gd_scene load_steps=6 format=3 uid="uid://crrb0l3ekuotj"] +[gd_scene load_steps=5 format=3 uid="uid://crrb0l3ekuotj"] [ext_resource type="Script" path="res://content/ui/menu/edit/edit_menu.gd" id="1_34cbn"] [ext_resource type="Script" path="res://content/ui/menu/grid.gd" id="3_0xvyw"] [ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="4_tvimg"] -[ext_resource type="FontVariation" uid="uid://sshfnckriqxn" path="res://assets/icons/icons.tres" id="5_0josb"] [ext_resource type="Script" path="res://content/functions/clickable.gd" id="6_pf8jy"] [node name="EditMenu" type="Node3D"] @@ -27,28 +26,16 @@ outline_size = 0 transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.19, 0.01, 0.27) [node name="NextPageButton" parent="Buttons" instance=ExtResource("4_tvimg")] +label = "navigate_next" +icon = true [node name="Clickable" type="Node" parent="Buttons/NextPageButton"] script = ExtResource("6_pf8jy") -[node name="Label3D" type="Label3D" parent="Buttons/NextPageButton"] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.012, 0) -pixel_size = 0.001 -text = "navigate_next" -font = ExtResource("5_0josb") -font_size = 48 -outline_size = 0 - [node name="PreviousPageButton" parent="Buttons" instance=ExtResource("4_tvimg")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.08, 0, 0) +label = "navigate_before" +icon = true [node name="Clickable" type="Node" parent="Buttons/PreviousPageButton"] script = ExtResource("6_pf8jy") - -[node name="Label3D2" type="Label3D" parent="Buttons/PreviousPageButton"] -transform = Transform3D(-1, 8.74228e-08, 3.82137e-15, 0, -4.37114e-08, 1, 8.74228e-08, 1, 4.37114e-08, 0, 0.012, 0) -pixel_size = 0.001 -text = "navigate_next" -font = ExtResource("5_0josb") -font_size = 48 -outline_size = 0 diff --git a/content/ui/entity/entity.gd b/content/ui/menu/edit/entity/entity.gd similarity index 100% rename from content/ui/entity/entity.gd rename to content/ui/menu/edit/entity/entity.gd diff --git a/content/ui/entity/entity.tscn b/content/ui/menu/edit/entity/entity.tscn similarity index 90% rename from content/ui/entity/entity.tscn rename to content/ui/menu/edit/entity/entity.tscn index ea809c1..f969f43 100644 --- a/content/ui/entity/entity.tscn +++ b/content/ui/menu/edit/entity/entity.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=3 uid="uid://xo0o5nrfjl23"] -[ext_resource type="Script" path="res://content/ui/entity/entity.gd" id="1_825oj"] +[ext_resource type="Script" path="res://content/ui/menu/edit/entity/entity.gd" id="1_825oj"] [ext_resource type="Script" path="res://content/functions/clickable.gd" id="2_i054q"] [sub_resource type="BoxMesh" id="BoxMesh_aa3i4"] diff --git a/content/ui/menu/edit/entity_creator.gd b/content/ui/menu/edit/entity_creator.gd new file mode 100644 index 0000000..94d57ab --- /dev/null +++ b/content/ui/menu/edit/entity_creator.gd @@ -0,0 +1,21 @@ +extends Object + +const Switch = preload("res://content/entities/switch/switch.tscn") +const Light = preload("res://content/entities/light/light.tscn") +const Sensor = preload("res://content/entities/sensor/sensor.tscn") + +static func create_entity(type: String, id: String): + var entity = null + + match type: + "switch": + entity = Switch.instantiate() + "light": + entity = Light.instantiate() + "sensor": + entity = Sensor.instantiate() + _: + return null + + entity.entity_id = id + return entity \ No newline at end of file diff --git a/content/ui/menu/menu.tscn b/content/ui/menu/menu.tscn index b48b52d..888355e 100644 --- a/content/ui/menu/menu.tscn +++ b/content/ui/menu/menu.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=13 format=3 uid="uid://c3kdssrmv84kv"] +[gd_scene load_steps=12 format=3 uid="uid://c3kdssrmv84kv"] [ext_resource type="Script" path="res://content/ui/menu/menu.gd" id="1_ng4u3"] -[ext_resource type="FontVariation" uid="uid://sshfnckriqxn" path="res://assets/icons/icons.tres" id="3_5qlpm"] [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"] @@ -166,69 +165,39 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.06, 0, 0) [node name="View" parent="AnimationContainer/Navigation" instance=ExtResource("5_w4i01")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, 0, 0.03) +label = "visibility" +icon = true toggleable = true external_state = true -[node name="Label3D" type="Label3D" parent="AnimationContainer/Navigation/View"] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.012, 0) -pixel_size = 0.001 -text = "visibility" -font = ExtResource("3_5qlpm") -font_size = 48 -outline_size = 0 - [node name="Edit" parent="AnimationContainer/Navigation" instance=ExtResource("5_w4i01")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, 0, 0.09) +label = "widgets" +icon = true toggleable = true external_state = true -[node name="Label3D2" type="Label3D" parent="AnimationContainer/Navigation/Edit"] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.012, 0) -pixel_size = 0.001 -text = "widgets" -font = ExtResource("3_5qlpm") -font_size = 48 -outline_size = 0 - [node name="Room" parent="AnimationContainer/Navigation" instance=ExtResource("5_w4i01")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, 0, 0.15) +label = "view_in_ar" +icon = true toggleable = true external_state = true -[node name="Label3D3" type="Label3D" parent="AnimationContainer/Navigation/Room"] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.012, 0) -pixel_size = 0.001 -text = "view_in_ar" -font = ExtResource("3_5qlpm") -font_size = 48 -outline_size = 0 - [node name="Automate" parent="AnimationContainer/Navigation" instance=ExtResource("5_w4i01")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, 0, 0.21) +label = "schema" +icon = true toggleable = true external_state = true -[node name="Label3D4" type="Label3D" parent="AnimationContainer/Navigation/Automate"] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.012, 0) -pixel_size = 0.001 -text = "schema" -font = ExtResource("3_5qlpm") -font_size = 48 -outline_size = 0 - [node name="Settings" parent="AnimationContainer/Navigation" instance=ExtResource("5_w4i01")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, 0, 0.27) +label = "settings" +icon = true toggleable = true external_state = true -[node name="Label3D5" type="Label3D" parent="AnimationContainer/Navigation/Settings"] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.012, 0) -pixel_size = 0.001 -text = "settings" -font = ExtResource("3_5qlpm") -font_size = 48 -outline_size = 0 - [node name="Content" type="Node3D" parent="AnimationContainer"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.06, 0, 0) diff --git a/content/ui/menu/room/room_menu.gd b/content/ui/menu/room/room_menu.gd index df3f0e3..4afbfb6 100644 --- a/content/ui/menu/room/room_menu.gd +++ b/content/ui/menu/room/room_menu.gd @@ -1,7 +1,7 @@ extends Node3D -const wall_corner_scene = preload("res://content/ui/menu/room/wall_corner.tscn") -const wall_edge_scene = preload("res://content/ui/menu/room/wall_edge.tscn") +const wall_corner_scene = preload("./wall_corner.tscn") +const wall_edge_scene = preload("./wall_edge.tscn") @onready var teleport_root = $TeleportRoot @onready var wall_corners = $TeleportRoot/WallCorners diff --git a/content/ui/menu/room/room_menu.tscn b/content/ui/menu/room/room_menu.tscn index 356b044..b706edd 100644 --- a/content/ui/menu/room/room_menu.tscn +++ b/content/ui/menu/room/room_menu.tscn @@ -1,10 +1,9 @@ -[gd_scene load_steps=9 format=3 uid="uid://c01gkeldvjwtr"] +[gd_scene load_steps=8 format=3 uid="uid://c01gkeldvjwtr"] [ext_resource type="Script" path="res://content/ui/menu/room/room_menu.gd" id="1_ch4jb"] [ext_resource type="Script" path="res://content/functions/clickable.gd" id="2_elugy"] [ext_resource type="Material" uid="uid://bbx6fv7jq50tr" path="res://content/ui/menu/room/walls.tres" id="3_fke3j"] [ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="3_whl7a"] -[ext_resource type="FontVariation" uid="uid://sshfnckriqxn" path="res://assets/icons/icons.tres" id="5_kr7ln"] [sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_08sv0"] @@ -45,19 +44,13 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.01, 0) [node name="ToggleEdit" parent="Interface" instance=ExtResource("3_whl7a")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.05, 0, 0.05) +label = "room_preferences" +icon = true toggleable = true [node name="Clickable" type="Node" parent="Interface/ToggleEdit"] script = ExtResource("2_elugy") -[node name="Label3D" type="Label3D" parent="Interface/ToggleEdit"] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.012, 0) -pixel_size = 0.001 -text = "room_preferences" -font = ExtResource("5_kr7ln") -font_size = 48 -outline_size = 0 - [node name="Label3D" type="Label3D" parent="Interface"] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.13, -1.86265e-09, 0.05) pixel_size = 0.001 diff --git a/content/ui/menu/settings/ball.tscn b/content/ui/menu/settings/ball.tscn index 03a7b90..f549a12 100644 --- a/content/ui/menu/settings/ball.tscn +++ b/content/ui/menu/settings/ball.tscn @@ -1,17 +1,19 @@ -[gd_scene load_steps=3 format=3 uid="uid://cn3axur15ftft"] +[gd_scene load_steps=4 format=3 uid="uid://cn3axur15ftft"] + +[ext_resource type="PackedScene" uid="uid://o1qeng8cu244" path="res://assets/models/basketball/scene.gltf" id="1_x2hv5"] + +[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_f6jtg"] +bounce = 0.7 [sub_resource type="SphereShape3D" id="SphereShape3D_orlq6"] radius = 0.08 -[sub_resource type="SphereMesh" id="SphereMesh_rfu32"] -radius = 0.08 -height = 0.16 - [node name="Ball" type="RigidBody3D"] +physics_material_override = SubResource("PhysicsMaterial_f6jtg") angular_damp = 4.0 [node name="CollisionShape3D" type="CollisionShape3D" parent="."] shape = SubResource("SphereShape3D_orlq6") -[node name="MeshInstance3D" type="MeshInstance3D" parent="."] -mesh = SubResource("SphereMesh_rfu32") +[node name="scene" parent="." instance=ExtResource("1_x2hv5")] +transform = Transform3D(0.4, 0, 0, 0, 0.4, 0, 0, 0, 0.4, 0, 0, 0) diff --git a/content/ui/menu/settings/credits.gd b/content/ui/menu/settings/credits.gd new file mode 100644 index 0000000..5f023fe --- /dev/null +++ b/content/ui/menu/settings/credits.gd @@ -0,0 +1,8 @@ +extends StaticBody3D + +@onready var close = $Content/Button + +func _ready(): + close.on_button_down.connect(func(): + queue_free() + ) diff --git a/content/ui/menu/settings/credits.tscn b/content/ui/menu/settings/credits.tscn new file mode 100644 index 0000000..252500f --- /dev/null +++ b/content/ui/menu/settings/credits.tscn @@ -0,0 +1,50 @@ +[gd_scene load_steps=6 format=3 uid="uid://d1h1ii47dfwnk"] + +[ext_resource type="Script" path="res://content/ui/menu/settings/credits.gd" id="1_6iala"] +[ext_resource type="Script" path="res://content/functions/movable.gd" id="1_napfi"] +[ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="2_dejch"] + +[sub_resource type="BoxMesh" id="BoxMesh_ssj75"] +size = Vector3(0.5, 0.01, 0.5) + +[sub_resource type="BoxShape3D" id="BoxShape3D_glrua"] +size = Vector3(0.5, 0.01, 0.5) + +[node name="Credits" type="StaticBody3D"] +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0) +script = ExtResource("1_6iala") + +[node name="MeshInstance3D" type="MeshInstance3D" parent="."] +mesh = SubResource("BoxMesh_ssj75") + +[node name="Movable" type="Node" parent="."] +script = ExtResource("1_napfi") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +shape = SubResource("BoxShape3D_glrua") + +[node name="Content" type="Node3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.01, 0) + +[node name="Basketball" type="Label3D" parent="Content"] +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, -0.14) +pixel_size = 0.001 +modulate = Color(0, 0, 0, 1) +text = "This work is based on \"Basketball\" (https://sketchfab.com/3d-models/basketball-19f76a0df81747369acf46406b36afa6) by Mateus Schwaab (https://sketchfab.com/Mehrus) licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)" +font_size = 14 +outline_size = 0 +autowrap_mode = 3 + +[node name="Room" type="Label3D" parent="Content"] +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, -0.06) +pixel_size = 0.001 +modulate = Color(0, 0, 0, 1) +text = "This work is based on \"Living Room\" (https://sketchfab.com/3d-models/living-room-2978ca6c93fb4f5c83e346d5ecdef0b0) by Chin.Seng.Choy (https://sketchfab.com/Chin.Seng.Choy) licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)" +font_size = 14 +outline_size = 0 +autowrap_mode = 3 + +[node name="Button" parent="Content" instance=ExtResource("2_dejch")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.22, 0, -0.22) +label = "close" +icon = true diff --git a/content/ui/menu/settings/settings_menu.gd b/content/ui/menu/settings/settings_menu.gd index 1138dfd..8642a89 100644 --- a/content/ui/menu/settings/settings_menu.gd +++ b/content/ui/menu/settings/settings_menu.gd @@ -1,6 +1,7 @@ extends Node3D -const ball_scene = preload("res://content/ui/menu/settings/ball.tscn") +const ball_scene = preload("./ball.tscn") +const credits_scene = preload("./credits.tscn") @onready var clickable = $Content/Button/Clickable @onready var connection_status = $Content/ConnectionStatus @@ -8,8 +9,12 @@ const ball_scene = preload("res://content/ui/menu/settings/ball.tscn") @onready var input_url = $Content/InputURL @onready var input_token = $Content/InputToken @onready var button_connect = $Content/Connect +@onready var credits = $Content/Credits/Clickable +@onready var background = $Background func _ready(): + background.visible = false + clickable.on_click.connect(func(event): var ball = ball_scene.instantiate() ball.transform = event.controller.transform @@ -17,6 +22,14 @@ func _ready(): get_tree().root.add_child(ball) ) + credits.on_click.connect(func(_event): + print("_active_controller") + var credits_instance = credits_scene.instantiate() + get_tree().root.add_child(credits_instance) + var label = $Content/Credits/Label + credits_instance.global_position = + label.to_global(label.position + Vector3(0.1, 0, -0.15)) + ) + var config = ConfigData.load_config() if config.has("url"): diff --git a/content/ui/menu/settings/settings_menu.tscn b/content/ui/menu/settings/settings_menu.tscn index 1fccf8b..e279d0a 100644 --- a/content/ui/menu/settings/settings_menu.tscn +++ b/content/ui/menu/settings/settings_menu.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=3 uid="uid://c6r4higceibif"] +[gd_scene load_steps=8 format=3 uid="uid://c6r4higceibif"] [ext_resource type="Script" path="res://content/ui/menu/settings/settings_menu.gd" id="1_0lte6"] [ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="1_faxng"] @@ -9,6 +9,9 @@ [sub_resource type="BoxMesh" id="BoxMesh_e51x8"] size = Vector3(0.3, 0.01, 0.3) +[sub_resource type="BoxShape3D" id="BoxShape3D_3qdps"] +size = Vector3(0.08, 0.01, 0.02) + [node name="SettingsMenu" type="Node3D"] script = ExtResource("1_0lte6") @@ -17,7 +20,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.15, 0, 0.15) mesh = SubResource("BoxMesh_e51x8") [node name="Content" type="Node3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0102286, 0) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.007, 0) [node name="Label3D" type="Label3D" parent="Content"] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.134377, 0, 0.253575) @@ -29,17 +32,12 @@ outline_size = 0 [node name="Button" parent="Content" instance=ExtResource("1_faxng")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0458097, 0, 0.253575) +label = "sports_basketball" +icon = true [node name="Clickable" type="Node" parent="Content/Button"] script = ExtResource("3_qmg6q") -[node name="Label3D" type="Label3D" parent="Content/Button"] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0) -pixel_size = 0.001 -text = "ball" -font_size = 18 -outline_size = 0 - [node name="ConnectionStatus" type="Label3D" parent="Content"] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.250698, 0, 0.151303) pixel_size = 0.001 @@ -86,11 +84,32 @@ horizontal_alignment = 0 [node name="Connect" parent="Content" instance=ExtResource("1_faxng")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.25, 0, 0.12) +label = "wifi" +icon = true -[node name="Label3D" type="Label3D" parent="Content/Connect"] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.012, 0) +[node name="Credits" type="StaticBody3D" parent="Content"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0102286, 0) + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Content/Credits"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.26, 0.005, 0.29) +shape = SubResource("BoxShape3D_3qdps") + +[node name="Label" type="Label3D" parent="Content/Credits"] +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.26, 0.0102286, 0.29) pixel_size = 0.001 -text = "wifi" -font = ExtResource("5_eiwd4") -font_size = 42 +modulate = Color(0, 0, 0, 1) +text = "credits" +font_size = 12 outline_size = 0 + +[node name="Hearth" type="Label3D" parent="Content/Credits"] +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.29, 0.0102286, 0.29) +pixel_size = 0.001 +modulate = Color(0.584314, 0, 0, 1) +text = "favorite" +font = ExtResource("5_eiwd4") +font_size = 14 +outline_size = 0 + +[node name="Clickable" type="Node" parent="Content/Credits"] +script = ExtResource("3_qmg6q")