Simple-Tiled-Implementation icon indicating copy to clipboard operation
Simple-Tiled-Implementation copied to clipboard

Tile collections

Open Luca-spopo opened this issue 5 years ago • 5 comments

Works as expected. In this screenshot, the blue regions are tiles from a tile collection, and the red regions are tiles from a batch sheet Screenshot 2020-06-19 at 3 48 33 PM

Luca-spopo avatar Jun 19 '20 10:06 Luca-spopo

Linked issues: https://github.com/karai17/Simple-Tiled-Implementation/issues/214 https://github.com/karai17/Simple-Tiled-Implementation/issues/173

Luca-spopo avatar Jun 19 '20 10:06 Luca-spopo

I definitely appreciate the plugin but I feel like it's written in a bit of a strange way that could be simplified. Instead of adding a field called loadStyle, why not just check the loaded table to see if it has a __call function, and if so, execute it? In the same vain, instead of having a hook function, just assign it directly to __call. Tilesets don't really have any functionality, they are just data, so they don't need to have metatables, you can just process them directly. And finally, I don't think you need to create a new table for tilesets since you're just looping through them and assigning data as you go; you can use the same table that loaded in with the map.

karai17 avatar Jun 19 '20 22:06 karai17

I'll refactor it later and update the PR. Regarding reusing the tilesets table that loads with the map, what do you have in mind? Inserting elements into a table while iterator over it is sometimes unsafe, and I also don't know if the order of the tilesets needs to be preserved.

Luca-spopo avatar Jun 20 '20 10:06 Luca-spopo

that particular one doesn't bother me so much, of it makes the most sense to use a new table, that's fine

On Sat., Jun. 20, 2020, 07:27 Luca-spopo, [email protected] wrote:

I'll refactor it later and update the PR. Regarding reusing the tilesets table that loads with the map, what do you have in mind? Inserting elements into a table while iterator over it is sometimes unsafe, and I also don't know if the order of the tilesets needs to be preserved.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/karai17/Simple-Tiled-Implementation/pull/236#issuecomment-646973908, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEQD7BJMKCQRPFHSDZ5HNDRXSFKVANCNFSM4OCTJVJQ .

karai17 avatar Jun 20 '20 22:06 karai17

Any progress on this?

Sven65 avatar Sep 12 '20 10:09 Sven65