Skip to content

Commit 58f14d0

Browse files
committed
Return hack to keep cloned node_ids consistent
1 parent 6572da3 commit 58f14d0

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Open your `game.project` file and add the following lines to the dependencies fi
3939
**[Druid](https://github.com/Insality/druid/)**
4040

4141
```
42-
https://github.com/Insality/druid/archive/refs/tags/1.1.2.zip
42+
https://github.com/Insality/druid/archive/refs/tags/1.1.3.zip
4343
```
4444

4545
**[Defold Event](https://github.com/Insality/defold-event)**

druid/component.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,17 @@ function M:set_nodes(nodes)
117117
nodes = gui.clone_tree(nodes) --[[@as table<hash, node>]]
118118
end
119119

120+
-- When we use gui.clone_tree in inner template (template inside other template)
121+
-- this nodes have no id. We have table: hash(correct_id) : hash("") or hash("_nodeX"
122+
-- It's wrong and we use this hack to fix this
123+
if nodes then
124+
for id, node in pairs(nodes) do
125+
gui.set_id(node, id)
126+
end
127+
end
128+
120129
self._meta.nodes = nodes
130+
121131
return self
122132
end
123133

game.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ update_frequency = 60
1414

1515
[project]
1616
title = Druid
17-
version = 1.1.2
17+
version = 1.1.3
1818
publisher = Insality
1919
developer = Maksim Tuprikov
2020
custom_resources = /example/locales

wiki/changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,3 +709,6 @@ Please support me if you like this project! It will help me keep engaged to upda
709709
#### Druid 1.1.2
710710
- [#310] Add data list matrix example (Grid 4 in row)
711711
- [Data List] Fix for data list element amounts issue
712+
713+
#### Druid 1.1.3
714+
- Fix for node_id of cloned nodes with `gui.clone_tree`

0 commit comments

Comments
 (0)