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"]
[sub_resource type="SphereShape3D" id="SphereShape3D_ukj14"]
radius = 0.1
radius = 0.0482081
[sub_resource type="SpriteFrames" id="SpriteFrames_ldpuo"]
animations = [{
@ -31,7 +31,7 @@ script = ExtResource("1_8ffhi")
shape = SubResource("SphereShape3D_ukj14")
[node name="Icon" type="AnimatedSprite3D" parent="."]
pixel_size = 0.0005
pixel_size = 0.0002
billboard = 1
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/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"]

View File

@ -1,5 +1,5 @@
{% set devices = states | map(attribute='entity_id') | map('device_id') | unique | reject('eq',None) | list %}
{%- set ns = namespace(devices = []) %}
{%- for device in devices %}
{%- set entities = device_entities(device) | list %}
@ -7,4 +7,13 @@
{%- set ns.devices = ns.devices + [ {device: {"name": device_attr(device, "name"), "entities": entities }} ] %}
{%- endif %}
{%- 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 }}