JoshLee0915 / GodotLDtkImporter

A plugin for importing LDtk files into Godot
MIT License
26 stars 4 forks source link

Alway re-import scenes and fix re-import always issue on Godot 3.2.3 #19

Closed stefanmielke closed 3 years ago

stefanmielke commented 3 years ago

I found a few issues when using your plugin. Mainly an always re-import issue (whenever I alt-tab'd it would re-import and show 3 errors on the Output window), and some tiles not updating when re-importing.

My take on it was to change "get_save_extension()" to have an empty string (resolves one of the errors), and some file closes that might have been missing.

Also removed the part that would re-use the current scene if existed, it was causing issues with some tiles not updating, mainly the ones when you use rules to change adjacent tiles (for some reason they weren't updating correctly. It also makes sure that it uses the latest version in LDtk, removing any changes made by the user.

And added some prints to make sure some of the errors are logged in case they happen (not sure what is the correct way of doing that in Godot to show as error, so I used that).

Let me know if there' anything you don't want from it, or feel free to close this if you don't feel these changes make any sense.