Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor resets map format when related extension is reloaded. #2911

Closed
elmm opened this issue Oct 9, 2020 · 2 comments
Closed

Editor resets map format when related extension is reloaded. #2911

elmm opened this issue Oct 9, 2020 · 2 comments
Labels
bug Broken behavior.

Comments

@elmm
Copy link

elmm commented Oct 9, 2020

If a map was loaded through the JS extension - the editor will save this map through this extension when a save key combination is pressed.
But if the extension code changes editor will lose the association between map a format writer and override map file with the default TMX format.

For example:

  • a map MyMap.json is in custom JSON format loaded with MyPlugin.js extension;
  • I do some changes to the map a press "save" -> map saved to MyMap.json in my format implemented in MyPlugin.js;
  • I do some changes in MyPlugin.js and save it. Editor reloads MyPlugin.js;
  • I hit "Save" again and the editor override the content of MyMap.json with TMX data.

Tested with version: 1.4.2
Platform: MacOS

PS: This issue doesn't affect end-users' workflow but significantly slows down the process of extension development.

@bjorn bjorn added the bug Broken behavior. label Oct 9, 2020
@bjorn
Copy link
Member

bjorn commented Oct 14, 2020

Alright, this bug indeed occurs for the regular Save action. The Export action is not affected. For some reason I never changed the Save action to remember the last format by its name, as opposed to remembering it by a pointer. Since it's a pointer, this pointer gets reset when the scripts are reloaded, which then triggers the behavior of saving in TMX format (which really shouldn't happen either, it should preferably open the Save As dialog again when the previous format is ambiguous or has disappeared).

Thanks for reporting it, I'll have a look at fixing it soon!

@bjorn bjorn closed this as completed in 59f7930 Oct 20, 2020
@bjorn
Copy link
Member

bjorn commented Oct 20, 2020

The fix for this turned out to be a little involved, so for now I haven't pushed it to the 1.4 branch, but it will be included in the next development snapshot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broken behavior.
Projects
None yet
Development

No branches or pull requests

2 participants