fix ui depth, finish ui styling and finally add proper wall occlusion

This commit is contained in:
Nitwel 2024-04-25 00:22:27 +02:00
parent eae0ec377a
commit b2f6b707d2
34 changed files with 465 additions and 305 deletions

View File

@ -31,6 +31,8 @@ static func _bind_store(target, prop, store: RdotStore, key, watch_signal=null):
return _bind_state(target, prop, store._proxied_value[key], watch_signal)
static func _bind_state(target, prop, value, watch_signal=null):
assert(state != null, "target cannot be null")
var graph = RdotGraph.getInstance()
var watch_c = func(new_value):

View File

@ -1,21 +1,17 @@
[gd_scene load_steps=6 format=3 uid="uid://c2j7nev6qx25s"]
[gd_scene load_steps=5 format=3 uid="uid://c2j7nev6qx25s"]
[ext_resource type="Script" path="res://content/entities/button/button.gd" id="1_ja7lt"]
[ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="1_r4tef"]
[ext_resource type="Script" path="res://content/functions/movable.gd" id="3_vrobf"]
[ext_resource type="Script" path="res://content/functions/occludable.gd" id="4_7upxo"]
[sub_resource type="BoxShape3D" id="BoxShape3D_um5pa"]
size = Vector3(0.0700684, 0.011734, 0.0703125)
size = Vector3(0.07, 0.07, 0.012)
[node name="Button" type="StaticBody3D"]
script = ExtResource("1_ja7lt")
[node name="Button" parent="." instance=ExtResource("1_r4tef")]
[node name="Occludable" type="Node" parent="."]
script = ExtResource("4_7upxo")
[node name="Movable" type="Node" parent="."]
script = ExtResource("3_vrobf")

View File

@ -1,8 +1,7 @@
[gd_scene load_steps=6 format=3 uid="uid://b0nq4wjfckxsa"]
[gd_scene load_steps=5 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)
@ -26,6 +25,3 @@ shape = SubResource("BoxShape3D_te0pn")
[node name="Movable" type="Node" parent="."]
script = ExtResource("2_e2u6o")
[node name="Occludable" type="Node" parent="."]
script = ExtResource("3_jheyx")

View File

@ -1,9 +1,8 @@
[gd_scene load_steps=15 format=3 uid="uid://cw86rc42dv2d8"]
[gd_scene load_steps=14 format=3 uid="uid://cw86rc42dv2d8"]
[ext_resource type="Script" path="res://content/entities/light/light.gd" id="1_ykxy3"]
[ext_resource type="Script" path="res://content/functions/movable.gd" id="4_4sfxb"]
[ext_resource type="Material" uid="uid://vce66e7sbc3n" path="res://content/entities/light/light_on.tres" id="5_50gph"]
[ext_resource type="Script" path="res://content/functions/occludable.gd" id="5_oh4jg"]
[ext_resource type="PackedScene" uid="uid://pk5k1q8bx0rj" path="res://content/ui/components/slider/slider.tscn" id="6_mhjlm"]
[ext_resource type="Texture2D" uid="uid://hy2f6is7qjyv" path="res://assets/canvas.png" id="7_ximu1"]
[ext_resource type="Script" path="res://content/functions/clickable.gd" id="8_1sfll"]
@ -37,9 +36,6 @@ script = ExtResource("1_ykxy3")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("SphereShape3D_ukj14")
[node name="Occludable" type="Node" parent="."]
script = ExtResource("5_oh4jg")
[node name="Movable" type="Node" parent="."]
script = ExtResource("4_4sfxb")
@ -59,11 +55,10 @@ height = 0.03
sides = 36
[node name="Slider" parent="." instance=ExtResource("6_mhjlm")]
transform = Transform3D(1.91069e-15, 4.37114e-08, 1, 1, -4.37114e-08, 0, 4.37114e-08, 1, -4.37114e-08, 0.08, 0, 0)
transform = Transform3D(-4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0, 1, 0.08, 0, 0)
max = 100.0
value = 100.0
step = 1.0
size = Vector3(10, 0.4, 1)
[node name="ColorWheel" type="StaticBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, -0.15, 0, 0)
@ -95,12 +90,12 @@ mesh = SubResource("CylinderMesh_x68ys")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.11, 0)
[node name="Next" parent="Modes" instance=ExtResource("8_nhcff")]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, -0.04, 0, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.04, 0, 0)
label = "navigate_next"
icon = true
[node name="Previous" parent="Modes" instance=ExtResource("8_nhcff")]
transform = Transform3D(1, 0, 0, 0, 2.98023e-08, -1, 0, 1, 2.98023e-08, -0.1, 0, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.1, 0, 0)
label = "navigate_before"
icon = true

View File

@ -1,9 +1,8 @@
[gd_scene load_steps=8 format=3 uid="uid://dyktdg7ggiwl4"]
[gd_scene load_steps=7 format=3 uid="uid://dyktdg7ggiwl4"]
[ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="1_8opk3"]
[ext_resource type="Script" path="res://content/entities/media_player/media_player.gd" id="1_ame17"]
[ext_resource type="Script" path="res://content/functions/movable.gd" id="3_bguto"]
[ext_resource type="Script" path="res://content/functions/occludable.gd" id="4_fnfum"]
[ext_resource type="PackedScene" uid="uid://pk5k1q8bx0rj" path="res://content/ui/components/slider/slider.tscn" id="4_w73hw"]
[ext_resource type="FontVariation" uid="uid://sshfnckriqxn" path="res://assets/icons/icons.tres" id="5_koe28"]
@ -19,17 +18,17 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0364514, -0.01)
shape = SubResource("BoxShape3D_vi3eg")
[node name="Previous" parent="." instance=ExtResource("1_8opk3")]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, -0.07, 0, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.07, 0, 0)
label = "skip_previous"
icon = true
[node name="Play" 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)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.65661e-08, 0, 0)
label = "pause"
icon = true
[node name="Next" parent="." instance=ExtResource("1_8opk3")]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0.07, 0, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.07, 0, 0)
label = "skip_next"
icon = true
@ -60,20 +59,15 @@ pixel_size = 0.001
[node name="Movable" type="Node" parent="."]
script = ExtResource("3_bguto")
[node name="Occludable" type="Node" parent="."]
script = ExtResource("4_fnfum")
[node name="Slider" parent="." instance=ExtResource("4_w73hw")]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, -0.0562844, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0562844, 0)
max = 100.0
value = 30.0
step = 1.0
show_label = true
label_unit = "%"
size = Vector3(15, 0.4, 1)
[node name="Label3D" type="Label3D" parent="Slider"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, -0.088399, 0, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.088399, 0, 0.01)
pixel_size = 0.001
text = "volume_up"
font = ExtResource("5_koe28")

View File

@ -1,20 +1,18 @@
[gd_scene load_steps=6 format=3 uid="uid://bbwedgq63bj84"]
[gd_scene load_steps=5 format=3 uid="uid://bbwedgq63bj84"]
[ext_resource type="Script" path="res://content/entities/number/number.gd" id="1_26xwp"]
[ext_resource type="PackedScene" uid="uid://pk5k1q8bx0rj" path="res://content/ui/components/slider/slider.tscn" id="2_sninv"]
[ext_resource type="Script" path="res://content/functions/movable.gd" id="3_x8wda"]
[ext_resource type="Script" path="res://content/functions/occludable.gd" id="4_3xwop"]
[sub_resource type="BoxShape3D" id="BoxShape3D_7mk8w"]
size = Vector3(0.0390625, 0.114258, 0.0142822)
size = Vector3(0.0390625, 0.150391, 0.0142822)
[node name="Number" type="StaticBody3D"]
script = ExtResource("1_26xwp")
[node name="Slider" parent="." instance=ExtResource("2_sninv")]
transform = Transform3D(8.74228e-08, 4.37114e-08, 1, 1, 4.37114e-08, -8.74228e-08, -4.37114e-08, 1, -4.37114e-08, 0, 0, 0)
transform = Transform3D(-4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0, 1, 0, 0, 0)
value = 0.0
size = Vector3(20, 0.8, 2)
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.00762939)
@ -22,6 +20,3 @@ shape = SubResource("BoxShape3D_7mk8w")
[node name="Movable" type="Node" parent="."]
script = ExtResource("3_x8wda")
[node name="Occludable" type="Node" parent="."]
script = ExtResource("4_3xwop")

View File

@ -1,9 +1,8 @@
[gd_scene load_steps=7 format=3 uid="uid://xsiy71rsqulj"]
[gd_scene load_steps=6 format=3 uid="uid://xsiy71rsqulj"]
[ext_resource type="Script" path="res://content/entities/sensor/sensor.gd" id="1_57ac8"]
[ext_resource type="FontVariation" uid="uid://d2ofyimg5s65q" path="res://assets/fonts/ui_font_500.tres" id="2_4np3x"]
[ext_resource type="Script" path="res://content/functions/movable.gd" id="2_fpq5q"]
[ext_resource type="Script" path="res://content/functions/occludable.gd" id="3_l3sp5"]
[ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="5_bmtkc"]
[sub_resource type="BoxShape3D" id="BoxShape3D_phuot"]
@ -28,11 +27,8 @@ font_size = 80
[node name="Movable" type="Node" parent="."]
script = ExtResource("2_fpq5q")
[node name="Occludable" type="Node" parent="."]
script = ExtResource("3_l3sp5")
[node name="Button" parent="." instance=ExtResource("5_bmtkc")]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, -0.1, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.1, 0)
label = "add_chart"
icon = true

View File

@ -1,10 +1,9 @@
[gd_scene load_steps=8 format=3 uid="uid://cscl5k7lhopj5"]
[gd_scene load_steps=7 format=3 uid="uid://cscl5k7lhopj5"]
[ext_resource type="Script" path="res://content/entities/switch/switch.gd" id="1_8ffhi"]
[ext_resource type="Texture2D" uid="uid://br3p0c2foputg" path="res://assets/materials/swich_on.png" id="1_w68gw"]
[ext_resource type="Texture2D" uid="uid://co2ishj2hx57p" path="res://assets/materials/switch_off.png" id="2_86ba1"]
[ext_resource type="Script" path="res://content/functions/movable.gd" id="4_6xr03"]
[ext_resource type="Script" path="res://content/functions/occludable.gd" id="5_j5ucu"]
[sub_resource type="SphereShape3D" id="SphereShape3D_ukj14"]
radius = 0.0482081
@ -37,6 +36,3 @@ sprite_frames = SubResource("SpriteFrames_ldpuo")
[node name="Movable" type="Node" parent="."]
script = ExtResource("4_6xr03")
[node name="Occludable" type="Node" parent="."]
script = ExtResource("5_j5ucu")

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=17 format=3 uid="uid://eecv28y6jxk4"]
[gd_scene load_steps=18 format=3 uid="uid://eecv28y6jxk4"]
[ext_resource type="PackedScene" uid="uid://clc5dre31iskm" path="res://addons/godot-xr-tools/xr/start_xr.tscn" id="1_i4c04"]
[ext_resource type="Script" path="res://content/main.gd" id="1_uvrd4"]
@ -35,6 +35,8 @@ ao_enabled = true
material = SubResource("StandardMaterial3D_m58yb")
size = Vector3(0.01, 0.01, 0.01)
[sub_resource type="CylinderMesh" id="CylinderMesh_72c80"]
[node name="Main" type="Node3D"]
transform = Transform3D(1, -0.000296142, 0.000270963, 0.000296143, 1, -4.5899e-06, -0.000270962, 4.67014e-06, 1, 0, 0, 0)
script = ExtResource("1_uvrd4")
@ -88,4 +90,8 @@ transform = Transform3D(0.5, 5.24309e-05, 0.000144384, -0.000139169, 0.353553, 0
[node name="Onboarding" parent="." instance=ExtResource("12_uq2nj")]
transform = Transform3D(1, -9.48098e-12, 0, 9.48098e-12, 1, 0, 0, 0, 1, -0.529594, 0.820154, -0.600147)
[node name="MeshInstance3D2" type="MeshInstance3D" parent="."]
transform = Transform3D(1, -1.39635e-11, 0, 1.02449e-10, 1, 0, 0, 0, 1, 0.327865, -9.50548e-05, 0.44448)
mesh = SubResource("CylinderMesh_72c80")
[editable path="XROrigin3D/XRControllerLeft"]

View File

@ -51,7 +51,7 @@ transform = Transform3D(1, -7.45058e-09, -2.22045e-16, 7.45058e-09, 1, 0, 0, 0,
shape = SubResource("CapsuleShape3D_dopke")
[node name="ThumbTip" type="BoneAttachment3D" parent="XRHandLeft"]
transform = Transform3D(0.937246, 0.0284254, -0.347508, 0.0184905, 0.991216, 0.130949, 0.348178, -0.129157, 0.928487, 0.0498668, 0.0560917, -0.112777)
transform = Transform3D(0.937246, 0.0284254, -0.347508, 0.0184905, 0.991216, 0.130949, 0.348178, -0.129157, 0.928488, 0.0498668, 0.0560917, -0.112777)
bone_name = "Thumb_Tip_L"
bone_idx = 4
use_external_skeleton = true
@ -61,7 +61,7 @@ external_skeleton = NodePath("../left_hand/Armature_001/Skeleton3D")
gizmo_extents = 0.02
[node name="MiddleTip" type="BoneAttachment3D" parent="XRHandLeft"]
transform = Transform3D(0.0812012, -0.650531, -0.755125, 0.996576, 0.064817, 0.051326, 0.0155558, -0.756708, 0.653567, 0.032112, 0.00654224, -0.171612)
transform = Transform3D(0.0812012, -0.650531, -0.755125, 0.996577, 0.064817, 0.051326, 0.0155558, -0.756708, 0.653568, 0.032112, 0.00654224, -0.171612)
bone_name = "Middle_Tip_L"
bone_idx = 14
use_external_skeleton = true
@ -112,7 +112,7 @@ transform = Transform3D(1, 0, 4.7579e-13, 0, 1, 0, -1.34149e-12, 1.77636e-15, 1,
material_override = SubResource("StandardMaterial3D_n27ki")
[node name="IndexTip" type="BoneAttachment3D" parent="XRHandRight"]
transform = Transform3D(0.19221, 0.669966, 0.717078, -0.091543, -0.715277, 0.69282, 0.977075, -0.19881, -0.0761527, -0.0345978, -0.164767, -0.0355401)
transform = Transform3D(0.19221, 0.669966, 0.717079, -0.091543, -0.715277, 0.69282, 0.977075, -0.19881, -0.0761527, -0.0345977, -0.164767, -0.0355401)
bone_name = "Index_Tip_R"
bone_idx = 9
use_external_skeleton = true
@ -142,7 +142,7 @@ external_skeleton = NodePath("../right_hand/Armature/Skeleton3D")
gizmo_extents = 0.02
[node name="MiddleTip" type="BoneAttachment3D" parent="XRHandRight"]
transform = Transform3D(0.0812011, 0.650531, 0.755126, -0.0155557, -0.756708, 0.653568, 0.996576, -0.0648169, -0.0513262, -0.032112, -0.171612, -0.00654216)
transform = Transform3D(0.0812011, 0.650531, 0.755126, -0.0155557, -0.756709, 0.653568, 0.996576, -0.0648169, -0.0513262, -0.032112, -0.171612, -0.00654216)
bone_name = "Middle_Tip_R"
bone_idx = 14
use_external_skeleton = true

View File

@ -1,7 +1,8 @@
[gd_scene load_steps=8 format=3 uid="uid://bswgmclohuqui"]
[gd_scene load_steps=9 format=3 uid="uid://bswgmclohuqui"]
[ext_resource type="Script" path="res://content/system/house/room/room.gd" id="1_fccq0"]
[ext_resource type="Script" path="res://content/functions/clickable.gd" id="1_ugebq"]
[ext_resource type="Material" uid="uid://bbx6fv7jq50tr" path="res://content/system/house/room/wall.tres" id="3_w4vos"]
[ext_resource type="Script" path="res://lib/utils/state_machine/state_machine.gd" id="4_nbbo6"]
[ext_resource type="Script" path="res://content/system/house/room/states/view.gd" id="6_g066t"]
[ext_resource type="Script" path="res://content/system/house/room/states/edit.gd" id="7_ap14h"]
@ -25,8 +26,10 @@ shape = SubResource("WorldBoundaryShape3D_08sv0")
script = ExtResource("1_ugebq")
[node name="WallMesh" type="MeshInstance3D" parent="."]
material_override = ExtResource("3_w4vos")
[node name="CeilingMesh" type="MeshInstance3D" parent="."]
material_override = ExtResource("3_w4vos")
[node name="WallCollision" type="StaticBody3D" parent="."]
collision_layer = 24

View File

@ -8,9 +8,6 @@ func _on_enter():
if room_store == null||room_store.corners.size() < 3:
return
room.wall_mesh.visible = false
room.ceiling_mesh.visible = false
room.wall_mesh.mesh = Room.generate_wall_mesh(room_store)
if room.wall_mesh.mesh == null:
@ -38,3 +35,5 @@ func _on_leave():
room.room_floor.get_node("CollisionShape3D").disabled = true
room.wall_collision.shape = null
room.wall_mesh.mesh = null
room.ceiling_mesh.mesh = null

View File

@ -1,6 +1,8 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://bbx6fv7jq50tr"]
[resource]
transparency = 1
render_priority = -100
blend_mode = 2
cull_mode = 2
albedo_color = Color(1, 1, 1, 0)
depth_draw_mode = 1
shading_mode = 0

View File

@ -71,6 +71,7 @@ func create_key(key: Key):
var key_node = button_scene.instantiate()
key_node.label = EventKey.key_to_string(key, caps)
key_node.size = Vector3(0.05, 0.05, 0.01)
key_node.focusable = false
key_node.font_size = 32
key_node.echo = true

View File

@ -11,7 +11,7 @@
size = Vector3(0.86, 0.27, 0.02)
[sub_resource type="ShaderMaterial" id="ShaderMaterial_x72nd"]
render_priority = -1
render_priority = 19
shader = ExtResource("5_0dbg6")
shader_parameter/color = Color(1, 1, 1, 0.3)
shader_parameter/border_color = Color(1, 1, 1, 1)
@ -39,6 +39,7 @@ focusable = false
label = "backspace"
icon = true
echo = true
size = Vector3(0.05, 0.05, 0.01)
metadata/key = 4194308
[node name="Caps" parent="." instance=ExtResource("1_xdpwr")]
@ -47,12 +48,14 @@ focusable = false
label = "keyboard_capslock"
icon = true
toggleable = true
size = Vector3(0.05, 0.05, 0.01)
[node name="Paste" parent="." instance=ExtResource("1_xdpwr")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.38, -0.09, 0)
focusable = false
label = "assignment"
icon = true
size = Vector3(0.05, 0.05, 0.01)
[node name="Keys" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.325, 0.09, 0)

View File

@ -5,20 +5,20 @@
[sub_resource type="QuadMesh" id="QuadMesh_bt05p"]
resource_local_to_scene = true
size = Vector2(0.05, 0.05)
size = Vector2(0.04, 0.04)
[sub_resource type="BoxShape3D" id="BoxShape3D_xwopm"]
resource_local_to_scene = true
size = Vector3(0.05, 0.05, 0.01)
size = Vector3(0.04, 0.04, 0.01)
[sub_resource type="BoxShape3D" id="BoxShape3D_bqjii"]
resource_local_to_scene = true
size = Vector3(0.05, 0.05, 0.03)
size = Vector3(0.04, 0.04, 0.03)
[node name="Button" type="Node3D" groups=["ui_focus"]]
script = ExtResource("1_74x7g")
label = "Example Text"
size = Vector3(0.05, 0.05, 0.01)
size = Vector3(0.04, 0.04, 0.01)
[node name="Body" type="StaticBody3D" parent="." groups=["ui_focus_skip"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.005)
@ -38,11 +38,12 @@ shape = SubResource("BoxShape3D_xwopm")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.006)
pixel_size = 0.001
double_sided = false
render_priority = 30
text = "Example Text"
font_size = 10
outline_size = 0
autowrap_mode = 3
width = 50.0
width = 40.0
[node name="FingerArea" type="Area3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.015)

View File

@ -5,7 +5,8 @@
[ext_resource type="Shader" path="res://assets/materials/glass.gdshader" id="3_nl02b"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_c5qdm"]
render_priority = -1
resource_local_to_scene = true
render_priority = 20
shader = ExtResource("3_nl02b")
shader_parameter/color = Color(1, 1, 1, 0.3)
shader_parameter/border_color = Color(1, 1, 1, 1)
@ -19,6 +20,7 @@ shader_parameter/roughness = 0.3
shader_parameter/grain_amount = 0.02
[sub_resource type="QuadMesh" id="QuadMesh_5rrua"]
resource_local_to_scene = true
size = Vector2(0.15, 0.03)
[sub_resource type="BoxShape3D" id="BoxShape3D_x4yp8"]
@ -88,10 +90,10 @@ shape = SubResource("BoxShape3D_x4yp8")
[node name="Label" type="Label3D" parent="Body"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.073, 0, 0.005)
sorting_offset = 0.1
pixel_size = 0.001
double_sided = false
alpha_cut = 2
render_priority = 30
outline_render_priority = 29
text = "Example Text"
font = ExtResource("3_ij5fh")
font_size = 18

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6a4d9b6aba4df0f124a285b82d6adc8b0682751d95ee946da6478ebcc3cfbd5f
size 449
oid sha256:dbcd34e34bfbe649b5ee3b0c2df93869b18124ec89499cc54f9c5c287f83d0cc
size 465

View File

@ -1,5 +1,8 @@
@tool
extends FlexContainer3D
class_name Pagination3D
signal on_page_changed(page: int)
const ButtonScene = preload ("res://content/ui/components/button/button.tscn")
const LabelScene = preload ("res://content/ui/components/label_container/label_container.tscn")
@ -12,14 +15,20 @@ const ButtonActiveMaterial = preload ("button_active.material")
@export var page: int = 0:
set(value):
if page == value: return
page = clamp(value, 0, pages - 1)
_update()
@export var pages: int = 5:
set(value):
if pages == value: return
pages = max(1, value)
_update()
@export var visible_pages: int = 5:
set(value):
if visible_pages == value: return
visible_pages = max(5, value)
_update()
@ -27,12 +36,17 @@ func _ready():
_update()
func _update():
if !is_inside_tree(): return
print("update %s %s %s %s" % [page, pages, visible_pages, get_parent()])
if !is_node_ready(): return
for child in get_children():
if child != prev_button&&child != next_button:
child.queue_free()
await child.tree_exited
remove_child(child)
child.free()
# child.queue_free()
# print("queue free", child)
# await child.tree_exited
# print("exited", child)
var display_pages = min(pages, visible_pages)
var center_pos = floor(display_pages / 2)
@ -48,6 +62,9 @@ func _update():
next_button.mesh.visible = !at_end
prev_button.size = Vector3(size.y, size.y, size.z)
next_button.size = Vector3(size.y, size.y, size.z)
print("A %s %s %s %s" % [display_pages, center_pos, start_dots, end_dots])
for i in range(display_pages):
if (start_dots&&i == 1)||(end_dots&&i == display_pages - 2):
@ -77,12 +94,13 @@ func _update():
button.on_button_up.connect(func(_arg):
page=int(button.label) - 1
on_page_changed.emit(page)
)
add_child(button)
move_child(button, -2)
button.mesh.material_override = ButtonActiveMaterial if (int(button.label) - 1) == page else ButtonMaterial
button.get_node("Body/MeshInstance3D").material_override = ButtonActiveMaterial if (int(button.label) - 1) == page else ButtonMaterial
super._update()

View File

@ -5,17 +5,19 @@
[node name="Pagination" type="Node3D"]
script = ExtResource("1_3ylfj")
page = 4
pages = 9
visible_pages = 6
pages = 4
visible_pages = 7
gap = 0.01
size = Vector3(9.92, 0.05, 0.01)
[node name="Prev" parent="." instance=ExtResource("2_lsc4w")]
label = "navigate_before"
icon = true
disabled = true
size = Vector3(0.05, 0.05, 0.01)
[node name="Next" parent="." instance=ExtResource("2_lsc4w")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.42, 0, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.3, 0, 0)
label = "navigate_next"
icon = true
size = Vector3(0.05, 0.05, 0.01)

View File

@ -9,7 +9,7 @@ size = Vector3(0.15, 0.02, 0.01)
[sub_resource type="ShaderMaterial" id="ShaderMaterial_vgpd3"]
resource_local_to_scene = true
render_priority = -2
render_priority = 20
shader = ExtResource("2_by0d8")
shader_parameter/color = Color(1, 1, 1, 0.3)
shader_parameter/border_color = Color(1, 1, 1, 1)
@ -28,7 +28,7 @@ size = Vector2(0.15, 0.02)
[sub_resource type="ShaderMaterial" id="ShaderMaterial_mv0la"]
resource_local_to_scene = true
render_priority = -1
render_priority = 30
shader = ExtResource("2_by0d8")
shader_parameter/color = Color(1, 1, 1, 0.3)
shader_parameter/border_color = Color(1, 1, 1, 1)
@ -70,6 +70,8 @@ mesh = SubResource("QuadMesh_k78f4")
[node name="Label" type="Label3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.08, 0, 0.01)
pixel_size = 0.001
render_priority = 30
outline_render_priority = 29
text = "0.2 "
font_size = 10
outline_size = 4

View File

@ -0,0 +1,47 @@
extends Node3D
signal on_select_device(device_id)
const ButtonScene = preload ("res://content/ui/components/button/button.tscn")
@onready var grid_container = $GridContainer3D
@onready var pagination = $Pagination3D
var page = R.state(0)
var page_size = 28.0
func _ready():
var pages = R.computed(func(_arg):
var devices=Store.devices.state.devices
print("recalc pages ", ceil(devices.size() / page_size))
return ceil(devices.size() / page_size)
)
var visible_devices = R.computed(func(_arg):
var devices=Store.devices.state.devices
return devices.slice(page.value * page_size, page.value * page_size + page_size)
)
R.bind(pagination, "pages", pages)
R.bind(pagination, "page", page, pagination.on_page_changed)
R.effect(func(_arg):
for child in grid_container.get_children():
grid_container.remove_child(child)
child.free()
for device in visible_devices.value:
var info=device.values()[0]
var button_instance=ButtonScene.instantiate()
button_instance.label=info["name"]
button_instance.on_button_down.connect(func():
on_select_device.emit(device.keys()[0])
)
grid_container.add_child(button_instance)
)

View File

@ -2,160 +2,45 @@ extends Node3D
const ButtonScene = preload ("res://content/ui/components/button/button.tscn")
@onready var devices_node: GridContainer3D = $Devices
@onready var next_page_button = $Buttons/NextPageButton
@onready var previous_page_button = $Buttons/PreviousPageButton
@onready var page_number_label = $PageNumberLabel
@onready var devices_page = $Devices
@onready var entities_page = $Entities
var page = R.state(0)
var last_device_page = 0
var page_size = 20
var pages = 0
var selected_device = R.state(null)
var selected_device = null
# Called when the node enters the scene tree for the first time.
func _ready():
next_page_button.on_button_down.connect(func():
next_page()
entities_page.selected_device = selected_device
remove_child(entities_page)
devices_page.on_select_device.connect(func(device):
selected_device.value=device
entities_page.page.value=0
)
previous_page_button.on_button_down.connect(func():
previous_page()
)
func _enter_tree():
if !HomeApi.has_connected(): await HomeApi.on_connect
if is_node_ready():
load_devices()
func load_devices():
if devices.size() == 0:
devices = await HomeApi.get_devices()
devices.sort_custom(func(a, b):
return a.values()[0]["name"].to_lower() < b.values()[0]["name"].to_lower()
)
for device in devices:
device.values()[0]["entities"].sort_custom(func(a, b):
return a.to_lower() < b.to_lower()
)
render()
HomeApi.on_disconnect.connect(func():
devices=[]
if is_node_ready():
render()
)
func update_pages():
if selected_device == null:
pages = ceil(float(devices.size()) / page_size)
else:
for device in devices:
if device.keys()[0] == selected_device:
pages = ceil(float(device.values()[0]["entities"].size()) / page_size)
func get_page():
if selected_device == null:
return devices.slice(page * page_size, page * page_size + page_size)
else:
for device in devices:
if device.keys()[0] == selected_device:
return device.values()[0]["entities"].slice(page * page_size, page * page_size + page_size)
func next_page():
if page >= pages - 1:
return
page += 1
render()
func previous_page():
if page <= 0:
return
page -= 1
render()
func render():
if devices.size() == 0:
return
update_pages()
page_number_label.set_text(str(page + 1) + " / " + str(pages))
var has_prev_page = page > 0
var has_next_page = page < pages - 1
previous_page_button.visible = has_prev_page
previous_page_button.disabled = !has_prev_page
previous_page_button.body.get_node("CollisionShape3D").disabled = !has_prev_page
next_page_button.visible = has_next_page
next_page_button.disabled = !has_next_page
next_page_button.body.get_node("CollisionShape3D").disabled = !has_next_page
clear_menu()
if selected_device == null:
render_devices()
else:
render_entities()
func render_devices():
var page_devices = get_page()
for device in page_devices:
var info = device.values()[0]
var button_instance = ButtonScene.instantiate()
button_instance.label = info["name"]
button_instance.on_button_down.connect(func():
_on_device_click(device.keys()[0])
)
devices_node.add_child(button_instance)
func render_entities():
var entities = get_page()
var back_button = ButtonScene.instantiate()
back_button.label = "arrow_back"
back_button.icon = true
back_button.on_button_down.connect(func():
_on_entity_click("#back")
)
devices_node.add_child(back_button)
for entity in entities:
var button_instance = ButtonScene.instantiate()
button_instance.label = entity
button_instance.on_button_down.connect(func():
_on_entity_click(entity)
)
devices_node.add_child(button_instance)
func _on_device_click(device_id):
selected_device = device_id
last_device_page = page
page = 0
render()
func _on_entity_click(entity_name):
if entity_name == "#back":
selected_device = null
page = last_device_page
AudioPlayer.play_effect("click")
render()
return
entities_page.on_select_entity.connect(func(entity_name):
AudioPlayer.play_effect("spawn")
var entity=House.body.create_entity(entity_name, global_position)
if entity == null:
EventSystem.notify("Entity is not in Room", EventNotify.Type.INFO)
)
func clear_menu():
for child in devices_node.get_children():
devices_node.remove_child(child)
child.queue_free()
entities_page.on_back.connect(func():
selected_device.value=null
)
R.effect(func(_arg):
if selected_device.value == null:
if devices_page.is_inside_tree() == false:
add_child(devices_page)
if entities_page.is_inside_tree():
remove_child(entities_page)
if selected_device.value != null:
if entities_page.is_inside_tree() == false:
add_child(entities_page)
if devices_page.is_inside_tree():
remove_child(devices_page)
)

View File

@ -1,9 +1,12 @@
[gd_scene load_steps=7 format=3 uid="uid://crrb0l3ekuotj"]
[gd_scene load_steps=10 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/edit/devices.gd" id="2_rkvf4"]
[ext_resource type="Script" path="res://content/ui/components/grid_container/grid_container.gd" id="3_0xvyw"]
[ext_resource type="PackedScene" uid="uid://bef3gamrm6at2" path="res://content/ui/components/pagination/pagination.tscn" id="4_4jiu6"]
[ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="4_lpv7m"]
[ext_resource type="Shader" path="res://assets/materials/glass.gdshader" id="4_xunmy"]
[ext_resource type="Script" path="res://content/ui/menu/edit/entities.gd" id="5_t34xe"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_hstwo"]
render_priority = -3
@ -26,28 +29,64 @@ size = Vector2(0.42, 0.32)
script = ExtResource("1_34cbn")
[node name="Devices" type="Node3D" parent="."]
script = ExtResource("2_rkvf4")
[node name="Devices" type="Node3D" parent="Devices"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.045, -0.045, 0.01)
[node name="GridContainer3D" type="Node3D" parent="Devices"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.05, -0.08, 0)
script = ExtResource("3_0xvyw")
columns = 7
gaps = Vector2(0.01, 0.01)
size = Vector3(0.24, 0.1, 0.1)
[node name="Background" type="MeshInstance3D" parent="Devices"]
transform = Transform3D(1, 0, 0, 0, 1, 1.06581e-14, 0, -1.06581e-14, 1, 0.21, -0.16, 0)
material_override = SubResource("ShaderMaterial_hstwo")
mesh = SubResource("QuadMesh_4pj6f")
skeleton = NodePath("../../..")
size = Vector3(0.28, 0.1, 0.1)
[node name="Label3D" type="Label3D" parent="Devices"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.02, -0.03, 0)
pixel_size = 0.001
double_sided = false
render_priority = 15
outline_render_priority = 14
text = "Devices"
font_size = 26
font_size = 24
outline_size = 0
horizontal_alignment = 0
[node name="Entities" type="Node3D" parent="."]
[node name="Pagination3D" parent="Devices" instance=ExtResource("4_4jiu6")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.03, -0.29, 0)
size = Vector3(9.92, 0.03, 0.01)
[node name="Pagination" parent="." instance=ExtResource("4_4jiu6")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.03, -0.27, 0)
[node name="Entities" type="Node3D" parent="."]
script = ExtResource("5_t34xe")
[node name="GridContainer3D" type="Node3D" parent="Entities"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.05, -0.08, 0)
script = ExtResource("3_0xvyw")
columns = 7
gaps = Vector2(0.01, 0.01)
size = Vector3(0.28, 0.1, 0.1)
[node name="Pagination3D" parent="Entities" instance=ExtResource("4_4jiu6")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.03, -0.29, 0)
size = Vector3(9.92, 0.03, 0.01)
[node name="Label3D" type="Label3D" parent="Entities"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.05, -0.03, 0)
pixel_size = 0.001
double_sided = false
render_priority = 15
outline_render_priority = 14
text = "My Entity"
font_size = 24
outline_size = 0
horizontal_alignment = 0
[node name="Button" parent="Entities" instance=ExtResource("4_lpv7m")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.03, -0.03, 0)
label = "arrow_back"
icon = true
size = Vector3(0.03, 0.03, 0.01)
[node name="Background" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 1.06581e-14, 0, -1.06581e-14, 1, 0.21, -0.16, 0)
visible = false
material_override = SubResource("ShaderMaterial_hstwo")
mesh = SubResource("QuadMesh_4pj6f")
skeleton = NodePath("../..")

View File

@ -0,0 +1,55 @@
extends Node3D
signal on_select_entity(entity_id)
signal on_back()
const ButtonScene = preload ("res://content/ui/components/button/button.tscn")
@onready var grid_container = $GridContainer3D
@onready var pagination = $Pagination3D
@onready var back_button = $Button
var page = R.state(0)
var page_size = 28.0
var selected_device = R.state(null)
func _ready():
var entities = R.computed(func(_arg):
var devices=Store.devices.state.devices
for device in devices:
if device.keys()[0] == selected_device.value:
return device.values()[0]["entities"]
return []
)
var pages = R.computed(func(_arg):
return ceil(entities.value.size() / page_size)
)
var visible_entities = R.computed(func(_arg):
return entities.value.slice(page.value * page_size, page.value * page_size + page_size)
)
R.bind(pagination, "pages", pages)
R.bind(pagination, "page", page, pagination.on_page_changed)
back_button.on_button_up.connect(func():
on_back.emit()
)
R.effect(func(_arg):
for child in grid_container.get_children():
grid_container.remove_child(child)
child.free()
for entity in visible_entities.value:
var button_instance=ButtonScene.instantiate()
button_instance.label=entity
button_instance.on_button_down.connect(func():
on_select_entity.emit(entity)
)
grid_container.add_child(button_instance)
)

View File

@ -16,7 +16,7 @@
size = Vector3(0.51, 0.32, 0.013)
[sub_resource type="ShaderMaterial" id="ShaderMaterial_du6qr"]
render_priority = -3
render_priority = 0
shader = ExtResource("3_htaoi")
shader_parameter/color = Color(1, 1, 1, 0.3)
shader_parameter/border_color = Color(1, 1, 1, 1)
@ -30,10 +30,11 @@ shader_parameter/roughness = 0.3
shader_parameter/grain_amount = 0.02
[sub_resource type="QuadMesh" id="QuadMesh_4bh1v"]
lightmap_size_hint = Vector2i(4, 3)
size = Vector2(0.42, 0.32)
[sub_resource type="ShaderMaterial" id="ShaderMaterial_mhqg4"]
render_priority = -1
render_priority = 0
shader = ExtResource("3_htaoi")
shader_parameter/color = Color(1, 1, 1, 0.3)
shader_parameter/border_color = Color(1, 1, 1, 1)
@ -192,7 +193,7 @@ collision_mask = 2
script = ExtResource("1_ng4u3")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, 0, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, 0, -0.005)
shape = SubResource("BoxShape3D_e1esh")
[node name="Movable" type="Node" parent="."]
@ -204,7 +205,7 @@ collision_layer = 6
collision_mask = 6
[node name="CollisionShape3D" type="CollisionShape3D" parent="AnimationContainer"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.2, -0.15, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.2, -0.15, -0.005)
shape = SubResource("BoxShape3D_e1esh")
[node name="Background" type="MeshInstance3D" parent="AnimationContainer"]
@ -232,41 +233,45 @@ label = "visibility"
icon = true
toggleable = true
disabled = true
size = Vector3(0.05, 0.05, 0.01)
[node name="Edit" parent="AnimationContainer/Tabs" instance=ExtResource("5_w4i01")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.06, 0)
label = "widgets"
icon = true
toggleable = true
size = Vector3(0.05, 0.05, 0.01)
[node name="Room" parent="AnimationContainer/Tabs" instance=ExtResource("5_w4i01")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.12, 0)
label = "view_in_ar"
icon = true
toggleable = true
size = Vector3(0.05, 0.05, 0.01)
[node name="Automate" parent="AnimationContainer/Tabs" instance=ExtResource("5_w4i01")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.18, 0)
label = "schema"
icon = true
toggleable = true
size = Vector3(0.05, 0.05, 0.01)
[node name="Settings" parent="AnimationContainer/Tabs" instance=ExtResource("5_w4i01")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.24, 0)
label = "settings"
icon = true
toggleable = true
size = Vector3(0.05, 0.05, 0.01)
[node name="TabsContent" type="Node3D" parent="AnimationContainer" node_paths=PackedStringArray("tabs")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.01, 0.00999999, -0.01)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.02, 0.00999999, 0)
script = ExtResource("6_7rntr")
tabs = NodePath("../Tabs")
[node name="ViewMenu" parent="AnimationContainer/TabsContent" instance=ExtResource("8_71pkg")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.01, 0, 0.01)
visible = false
[node name="EditMenu" parent="AnimationContainer/TabsContent" instance=ExtResource("4_r2raj")]
visible = false
[node name="RoomMenu" parent="AnimationContainer/TabsContent" instance=ExtResource("10_u4i1x")]
visible = false

View File

@ -1,29 +1,40 @@
[gd_scene load_steps=9 format=3 uid="uid://c01gkeldvjwtr"]
[gd_scene load_steps=10 format=3 uid="uid://c01gkeldvjwtr"]
[ext_resource type="Script" path="res://content/ui/menu/room/room_menu.gd" id="1_ch4jb"]
[ext_resource type="Material" uid="uid://bujy3egn1oqac" path="res://assets/materials/pri-500.material" id="2_7m4yn"]
[ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="4_cghmp"]
[ext_resource type="Script" path="res://content/ui/components/tabs/tabs.gd" id="5_ddrep"]
[ext_resource type="PackedScene" uid="uid://dd71loi64gnmp" path="res://content/ui/menu/room/views/overview.tscn" id="6_206ad"]
[ext_resource type="Script" path="res://content/ui/components/tabs/tabs_content.gd" id="6_ba00g"]
[ext_resource type="PackedScene" uid="uid://bpta22fahai46" path="res://content/ui/menu/room/views/rooms.tscn" id="7_2f8e0"]
[ext_resource type="Shader" path="res://assets/materials/glass.gdshader" id="7_bxp1w"]
[sub_resource type="BoxMesh" id="BoxMesh_e37nn"]
size = Vector3(0.3, 0.01, 0.3)
[sub_resource type="ShaderMaterial" id="ShaderMaterial_2asng"]
render_priority = -3
shader = ExtResource("7_bxp1w")
shader_parameter/color = Color(1, 1, 1, 0.3)
shader_parameter/border_color = Color(1, 1, 1, 1)
shader_parameter/edge_color = Color(0, 0, 0, 1)
shader_parameter/size = Vector2(0.42, 0.32)
shader_parameter/border_size = 0.001
shader_parameter/border_fade_in = 0.005
shader_parameter/border_fade_out = 0.0
shader_parameter/corner_radius = 0.02
shader_parameter/roughness = 0.3
shader_parameter/grain_amount = 0.02
[sub_resource type="QuadMesh" id="QuadMesh_16sg5"]
size = Vector2(0.42, 0.32)
[node name="RoomMenu" type="Node3D"]
script = ExtResource("1_ch4jb")
[node name="Background" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.15, 0, 0.15)
material_override = ExtResource("2_7m4yn")
mesh = SubResource("BoxMesh_e37nn")
[node name="Interface" type="Node3D" parent="."]
[node name="Tabs3D" type="Node3D" parent="Interface" node_paths=PackedStringArray("initial_selected")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.04, -0.04, 0)
script = ExtResource("5_ddrep")
initial_selected = NodePath("Overview")
gap = 0.01
[node name="Overview" parent="Interface/Tabs3D" instance=ExtResource("4_cghmp")]
label = "Overview"
@ -37,6 +48,12 @@ script = ExtResource("6_ba00g")
tabs = NodePath("../Tabs3D")
[node name="Overview" parent="Interface/TabsContent3D" instance=ExtResource("6_206ad")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.04)
[node name="Rooms" parent="Interface/TabsContent3D" instance=ExtResource("7_2f8e0")]
[node name="Background" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 1.06581e-14, 0, -1.06581e-14, 1, 0.21, -0.16, 0)
visible = false
material_override = SubResource("ShaderMaterial_2asng")
mesh = SubResource("QuadMesh_16sg5")
skeleton = NodePath("../..")

View File

@ -1,24 +1,52 @@
[gd_scene load_steps=3 format=3 uid="uid://dd71loi64gnmp"]
[gd_scene load_steps=6 format=3 uid="uid://dd71loi64gnmp"]
[ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="1_fteh8"]
[ext_resource type="Script" path="res://content/ui/menu/room/views/overview.gd" id="1_jesad"]
[ext_resource type="Shader" path="res://assets/materials/glass.gdshader" id="3_2yl2s"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_n3lbn"]
render_priority = -3
shader = ExtResource("3_2yl2s")
shader_parameter/color = Color(1, 1, 1, 0.3)
shader_parameter/border_color = Color(1, 1, 1, 1)
shader_parameter/edge_color = Color(0, 0, 0, 1)
shader_parameter/size = Vector2(0.42, 0.32)
shader_parameter/border_size = 0.001
shader_parameter/border_fade_in = 0.005
shader_parameter/border_fade_out = 0.0
shader_parameter/corner_radius = 0.02
shader_parameter/roughness = 0.3
shader_parameter/grain_amount = 0.02
[sub_resource type="QuadMesh" id="QuadMesh_l1dos"]
size = Vector2(0.42, 0.32)
[node name="Overview" type="Node3D"]
script = ExtResource("1_jesad")
[node name="EditButton" parent="." instance=ExtResource("1_fteh8")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.04, 0, 0.07)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.04, -0.12, 0)
label = "edit"
icon = true
[node name="FixButton" parent="." instance=ExtResource("1_fteh8")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.1, 0, 0.07)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.1, -0.12, 0)
label = "healing"
icon = true
[node name="Label3D" type="Label3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.06, 0.01, 0.02)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.02, -0.08, 0.01)
pixel_size = 0.001
render_priority = 15
outline_render_priority = 14
text = "Reference"
font_size = 18
outline_size = 0
horizontal_alignment = 0
[node name="Background" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 1.06581e-14, 0, -1.06581e-14, 1, 0.21, -0.16, 0)
visible = false
material_override = SubResource("ShaderMaterial_n3lbn")
mesh = SubResource("QuadMesh_l1dos")
skeleton = NodePath("../..")

View File

@ -1,21 +1,46 @@
[gd_scene load_steps=4 format=3 uid="uid://bpta22fahai46"]
[gd_scene load_steps=7 format=3 uid="uid://bpta22fahai46"]
[ext_resource type="Script" path="res://content/ui/menu/room/views/rooms.gd" id="1_3a1oa"]
[ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="1_y3lty"]
[ext_resource type="PackedScene" uid="uid://blrhy2uccrdn4" path="res://content/ui/components/input/input.tscn" id="2_hstw7"]
[ext_resource type="Shader" path="res://assets/materials/glass.gdshader" id="4_jx6i3"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_dah0r"]
render_priority = -3
shader = ExtResource("4_jx6i3")
shader_parameter/color = Color(1, 1, 1, 0.3)
shader_parameter/border_color = Color(1, 1, 1, 1)
shader_parameter/edge_color = Color(0, 0, 0, 1)
shader_parameter/size = Vector2(0.42, 0.32)
shader_parameter/border_size = 0.001
shader_parameter/border_fade_in = 0.005
shader_parameter/border_fade_out = 0.0
shader_parameter/corner_radius = 0.02
shader_parameter/roughness = 0.3
shader_parameter/grain_amount = 0.02
[sub_resource type="QuadMesh" id="QuadMesh_fq44b"]
size = Vector2(0.42, 0.32)
[node name="Rooms" type="Node3D"]
script = ExtResource("1_3a1oa")
[node name="Rooms" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.15, 0.01, 0.17)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.14, -0.13, 0)
[node name="Button" parent="." instance=ExtResource("1_y3lty")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.27, 0, 0.27)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.2, -0.28, 0)
label = "add"
icon = true
[node name="Input" parent="." instance=ExtResource("2_hstw7")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.12, 0.005, 0.27)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.09, -0.28, 0)
text = "Room 1"
disabled = true
[node name="Background" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 1.06581e-14, 0, -1.06581e-14, 1, 0.21, -0.16, 0)
visible = false
material_override = SubResource("ShaderMaterial_dah0r")
mesh = SubResource("QuadMesh_fq44b")
skeleton = NodePath("../..")

View File

@ -1,38 +1,47 @@
[gd_scene load_steps=9 format=3 uid="uid://c6r4higceibif"]
[gd_scene load_steps=10 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"]
[ext_resource type="Material" uid="uid://bujy3egn1oqac" path="res://assets/materials/pri-500.material" id="2_6lhhi"]
[ext_resource type="Script" path="res://content/functions/clickable.gd" id="3_qmg6q"]
[ext_resource type="PackedScene" uid="uid://blrhy2uccrdn4" path="res://content/ui/components/input/input.tscn" id="4_q3x6k"]
[ext_resource type="FontVariation" uid="uid://sshfnckriqxn" path="res://assets/icons/icons.tres" id="5_eiwd4"]
[sub_resource type="BoxMesh" id="BoxMesh_e51x8"]
size = Vector3(0.3, 0.01, 0.3)
[ext_resource type="Shader" path="res://assets/materials/glass.gdshader" id="6_mubnp"]
[sub_resource type="BoxShape3D" id="BoxShape3D_3qdps"]
size = Vector3(0.08, 0.01, 0.02)
size = Vector3(0.07, 0.02, 0.01)
[sub_resource type="ShaderMaterial" id="ShaderMaterial_3iv64"]
render_priority = -3
shader = ExtResource("6_mubnp")
shader_parameter/color = Color(1, 1, 1, 0.3)
shader_parameter/border_color = Color(1, 1, 1, 1)
shader_parameter/edge_color = Color(0, 0, 0, 1)
shader_parameter/size = Vector2(0.42, 0.32)
shader_parameter/border_size = 0.001
shader_parameter/border_fade_in = 0.005
shader_parameter/border_fade_out = 0.0
shader_parameter/corner_radius = 0.02
shader_parameter/roughness = 0.3
shader_parameter/grain_amount = 0.02
[sub_resource type="QuadMesh" id="QuadMesh_d0l0p"]
size = Vector2(0.42, 0.32)
[node name="SettingsMenu" type="Node3D"]
script = ExtResource("1_0lte6")
[node name="Background" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.15, 0, 0.15)
material_override = ExtResource("2_6lhhi")
mesh = SubResource("BoxMesh_e51x8")
[node name="Content" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.007, 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)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.251, -0.151, 0)
pixel_size = 0.001
text = "Disconnected"
font_size = 8
outline_size = 0
[node name="LabelURL" type="Label3D" parent="Content"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.01, 0, 0.03)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.01, -0.03, 0)
pixel_size = 0.001
text = "url:
"
@ -41,11 +50,12 @@ outline_size = 0
horizontal_alignment = 0
[node name="InputURL" parent="Content" instance=ExtResource("4_q3x6k")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.18, 0, 0.03)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.18, -0.03, 0)
text = "ws://192.168.0.1:8123"
size = Vector3(0.2, 0.03, 0.01)
[node name="LabelToken" type="Label3D" parent="Content"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.01, 0, 0.07)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.01, -0.07, 0)
pixel_size = 0.001
text = "token:"
font_size = 18
@ -53,11 +63,12 @@ outline_size = 0
horizontal_alignment = 0
[node name="InputToken" parent="Content" instance=ExtResource("4_q3x6k")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.18, 0, 0.07)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.18, -0.07, 0)
text = "..."
size = Vector3(0.2, 0.03, 0.01)
[node name="LabelConnect" type="Label3D" parent="Content"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.14, 0, 0.12)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.14, -0.12, 0)
pixel_size = 0.001
text = "Connect"
font_size = 18
@ -65,26 +76,26 @@ outline_size = 0
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)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.25, -0.12, 0)
label = "login"
icon = true
[node name="Credits" type="StaticBody3D" parent="Content"]
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.37, -0.300229, 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)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.005, 0, 0)
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)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.98023e-08, 0, 0)
pixel_size = 0.001
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)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.03, 0, 0)
pixel_size = 0.001
modulate = Color(0.584314, 0, 0, 1)
text = "favorite"
@ -96,7 +107,7 @@ outline_size = 0
script = ExtResource("3_qmg6q")
[node name="SaveLabel" type="Label3D" parent="Content"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.01, 0, 0.21)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.01, -0.21, 0)
pixel_size = 0.001
text = "Manual Save:"
font_size = 18
@ -104,12 +115,12 @@ outline_size = 0
horizontal_alignment = 0
[node name="Save" parent="Content" instance=ExtResource("1_faxng")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.17, 0, 0.21)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.17, -0.21, 0)
label = "save"
icon = true
[node name="clearSaveLabel" type="Label3D" parent="Content"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.01, 0, 0.26)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.01, -0.26, 0)
pixel_size = 0.001
text = "Clear Save:"
font_size = 18
@ -117,12 +128,12 @@ outline_size = 0
horizontal_alignment = 0
[node name="ClearSave" parent="Content" instance=ExtResource("1_faxng")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.17, 0, 0.27)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.17, -0.27, 0)
label = "close"
icon = true
[node name="clearSaveWarning" type="Label3D" parent="Content"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.01, 0, 0.28)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.01, -0.28, 0)
pixel_size = 0.001
modulate = Color(1, 0, 0, 1)
text = "Caution! This will delete all your rooms and placed devices."
@ -133,16 +144,22 @@ autowrap_mode = 3
width = 150.0
[node name="VoiceAssist" parent="Content" instance=ExtResource("1_faxng")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.1, 0, 0.12)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.1, -0.12, 0)
label = "mic_off"
icon = true
toggleable = true
[node name="LabelVoiceAssist" type="Label3D" parent="Content"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.01, 0, 0.12)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.01, -0.12, 0)
pixel_size = 0.001
text = "Voice-
Assist:"
font_size = 18
outline_size = 0
horizontal_alignment = 0
[node name="Background" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 1.06581e-14, 0, -1.06581e-14, 1, 0.21, -0.16, 0)
material_override = SubResource("ShaderMaterial_3iv64")
mesh = SubResource("QuadMesh_d0l0p")
skeleton = NodePath("../..")

View File

@ -6,7 +6,7 @@
[ext_resource type="Shader" path="res://assets/materials/glass.gdshader" id="5_cjxo5"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_e5hvo"]
render_priority = -3
render_priority = 10
shader = ExtResource("5_cjxo5")
shader_parameter/color = Color(1, 1, 1, 0.3)
shader_parameter/border_color = Color(1, 1, 1, 1)
@ -37,6 +37,8 @@ toggleable = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.07, -0.04, 0)
pixel_size = 0.001
double_sided = false
render_priority = 15
outline_render_priority = 14
text = "Mini View"
font_size = 18
outline_size = 0
@ -52,6 +54,8 @@ toggleable = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.07, -0.1, 0)
pixel_size = 0.001
double_sided = false
render_priority = 15
outline_render_priority = 14
text = "Heat Map"
font_size = 18
outline_size = 0
@ -67,6 +71,8 @@ toggleable = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.07, -0.16, 0)
pixel_size = 0.001
double_sided = false
render_priority = 15
outline_render_priority = 14
text = "Humidity Map"
font_size = 18
outline_size = 0
@ -81,6 +87,8 @@ step = 1.0
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.2, -0.21, 0)
pixel_size = 0.001
double_sided = false
render_priority = 15
outline_render_priority = 14
text = "Min Value"
font_size = 18
outline_size = 0
@ -95,6 +103,8 @@ step = 1.0
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.2, -0.25, 0)
pixel_size = 0.001
double_sided = false
render_priority = 15
outline_render_priority = 14
text = "Max Value"
font_size = 18
outline_size = 0
@ -111,6 +121,8 @@ label_unit = "%"
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.2, -0.29, 0)
pixel_size = 0.001
double_sided = false
render_priority = 15
outline_render_priority = 14
text = "Opacity"
font_size = 18
outline_size = 0

View File

@ -8,7 +8,7 @@
size = Vector3(0.5, 0.3, 0.01)
[sub_resource type="ShaderMaterial" id="ShaderMaterial_d2ck8"]
render_priority = -1
render_priority = 10
shader = ExtResource("2_87aan")
shader_parameter/color = Color(1, 1, 1, 0.3)
shader_parameter/border_color = Color(1, 1, 1, 1)
@ -32,6 +32,8 @@ script = ExtResource("1_k4yvw")
[node name="Label3D2" type="Label3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.23, -0.1, 0.001)
pixel_size = 0.001
render_priority = 30
outline_render_priority = 29
text = "Getting Started"
font_size = 18
outline_size = 0
@ -50,6 +52,8 @@ mesh = SubResource("QuadMesh_ij2lj")
[node name="GettingStartedLabel" type="Label3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.23, 0.13, 0.001)
pixel_size = 0.001
render_priority = 30
outline_render_priority = 29
text = "Hey!
This app is still early in development and still has a lot of rough edges. Things might break or are sometimes difficult to use, this will improve the more polished the app becomes.
@ -75,6 +79,8 @@ icon = true
[node name="CloseLabel" type="Label3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.06, -0.1, 0.001)
pixel_size = 0.001
render_priority = 30
outline_render_priority = 29
text = "Understood"
font_size = 18
outline_size = 0

View File

@ -7,7 +7,22 @@ func _init():
})
HomeApi.on_connect.connect(func():
self.state.devices=await HomeApi.get_devices()
var devices=await HomeApi.get_devices()
devices.sort_custom(func(a, b):
return a.values()[0]["name"].to_lower() < b.values()[0]["name"].to_lower()
)
for device in devices:
device.values()[0]["entities"].sort_custom(func(a, b):
return a.to_lower() < b.to_lower()
)
self.state.devices=devices
)
HomeApi.on_disconnect.connect(func():
self.state.devices=[]
)
func clear():