Bind layers tilesets
Hello !
This extension aims to bind tile layers to tilesets based on their names. I'm not a javascript dev, and am pretty new to contributing to external projects, so if you have any suggestions on the code, the comments, or on this PR, I will gladly listen.
The linter returned without any prompt on the last commit.
I use Tiled every now and then, and was in need of such a binding, to spare a few clicks, but also to prevent myself from forgetting to change layer before editing, wasting a lot of time doing it on a wring layer. A few days ago, I decided to take some time to actually try and develop the extension myself, and as a perfect coincidence, stumbled upon this issue https://github.com/mapeditor/tiled/issues/3256, providing me with the extra boost I needed to do it.
Thinking back, even though binding tilesets to tile layers through their names is exactly what I needed, and probably what most people could work with, it would be much better to let users define what their bindings should look like.
I'm thinking about using matching rules, probably allowing regular expressions, that could be stored in a file.
This change would probably require the creation of a menu with options for more flexibility.
As I see it, the tool would have a default behaviour, which matches on exact same name, and it would be possible to deactivate that in the options in order to customize it with a project based configuration file.