Tiled Map Template Fixes, Proper handling of GIDs from multiple Tilesets. Fix for issue #7726
There was an issue with Templates not taking into account the proper GIDs when multiple tilesets were used. #7726
Implemented the fixes suggested by @damnedpie, who submitted the issue. And also provided most of the suggested code to fix the issue. Many thanks! (if only we had more issue's like this)
It took me some time to replicate this issue using our own template object test. I found out that the issue could be replicated when bringing in a second tileset in to the template. So I was able to successfully break the test and implemented a fix to resolve it.
So our template test has been updated to pull in in the grass tileset for the sole purpose of having a texture load from a different tileset which would need the proper GID.
While doing this fix I also had to make sure to keep both the Tmj and Tmx map loaders to keep them in sync. As both the Tmx and Tmj loader ran into this issue during testing. So I updated both tmx and tmj template test maps as well as made the same changes to the BaseTmjMapLoader and BaseTmxMapLoader.
@damnedpie, I'm not sure if you are able to pull down these changes, build and test for yourself. But it would be very helpful to get feedback. To make sure your original use case works. And not just the one I cobbled together in the test.