fix dots not updating position

This commit is contained in:
Nitwel 2024-04-17 19:57:34 +02:00
parent 0793dd44f9
commit d645ed7e9a
3 changed files with 8 additions and 3 deletions

View File

@ -8,7 +8,7 @@
[sub_resource type="BoxShape3D" id="BoxShape3D_um5pa"]
size = Vector3(0.0700684, 0.011734, 0.0703125)
[node name="Button" type="StaticBody3D" ]
[node name="Button" type="StaticBody3D"]
script = ExtResource("1_ja7lt")
[node name="Button" parent="." instance=ExtResource("1_r4tef")]

View File

@ -250,5 +250,6 @@ func save_all_entities():
entity_data["interface"] = entity.get_interface()
Store.house.state.entities.append(entity_data)
Store.house.state.entities = Store.house.state.entities
Store.house.save_local()

View File

@ -19,9 +19,11 @@ func _ready():
group_entity.queue_free()
group_entity=null
elif group_entity == null:
print(editing.value.map(func(entity): return entity.entity_id))
var id=HomeApi.groups.create(editing.value.map(func(entity): return entity.entity_id))
group_entity=EntityFactory.create_entity(id, active_type)
for entity_node in group_entity.get_children():
if entity_node is Movable:
group_entity.remove_child(entity_node)
add_child(group_entity)
else:
HomeApi.groups.update_entities(group_entity.entity_id, editing.value.map(func(entity): return entity.entity_id))
@ -39,6 +41,8 @@ func _ready():
if Store.house.state.entities.size() == 0:
return
print("Updating Dots")
for old_dot in dots.get_children():
dots.remove_child(old_dot)
old_dot.free()