Merge pull request #71 from Nitwel/loose-entities

Add deviceless entities
This commit is contained in:
Nitwel 2023-12-09 22:51:37 +01:00 committed by GitHub
commit fd4ff6d388
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

View File

@ -7,7 +7,7 @@
[ext_resource type="Script" path="res://content/functions/occludable.gd" id="5_j5ucu"] [ext_resource type="Script" path="res://content/functions/occludable.gd" id="5_j5ucu"]
[sub_resource type="SphereShape3D" id="SphereShape3D_ukj14"] [sub_resource type="SphereShape3D" id="SphereShape3D_ukj14"]
radius = 0.1 radius = 0.0482081
[sub_resource type="SpriteFrames" id="SpriteFrames_ldpuo"] [sub_resource type="SpriteFrames" id="SpriteFrames_ldpuo"]
animations = [{ animations = [{
@ -31,7 +31,7 @@ script = ExtResource("1_8ffhi")
shape = SubResource("SphereShape3D_ukj14") shape = SubResource("SphereShape3D_ukj14")
[node name="Icon" type="AnimatedSprite3D" parent="."] [node name="Icon" type="AnimatedSprite3D" parent="."]
pixel_size = 0.0005 pixel_size = 0.0002
billboard = 1 billboard = 1
sprite_frames = SubResource("SpriteFrames_ldpuo") sprite_frames = SubResource("SpriteFrames_ldpuo")

View File

@ -2,7 +2,7 @@
[ext_resource type="Script" path="res://content/system/room/room.gd" id="1_fccq0"] [ext_resource type="Script" path="res://content/system/room/room.gd" id="1_fccq0"]
[ext_resource type="Script" path="res://content/functions/clickable.gd" id="1_ugebq"] [ext_resource type="Script" path="res://content/functions/clickable.gd" id="1_ugebq"]
[ext_resource type="Material" path="res://content/system/room/walls.tres" id="3_al1ev"] [ext_resource type="Material" uid="uid://bbx6fv7jq50tr" path="res://content/system/room/walls.tres" id="3_al1ev"]
[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_08sv0"] [sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_08sv0"]

View File

@ -7,4 +7,13 @@
{%- set ns.devices = ns.devices + [ {device: {"name": device_attr(device, "name"), "entities": entities }} ] %} {%- set ns.devices = ns.devices + [ {device: {"name": device_attr(device, "name"), "entities": entities }} ] %}
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
{%- set ns_group = namespace(entities = []) %}
{%- for state in states %}
{%- if device_id(state.entity_id) == None %}
{%- set ns_group.entities = ns_group.entities + [state.entity_id] %}
{%- endif %}
{%- endfor %}
{%- set ns.devices = ns.devices + [ {"other": {"name": "Other", "entities": ns_group.entities }} ] %}
{{ ns.devices }} {{ ns.devices }}