You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe this happens for the same reason that the Asset you get in write() is read-only: it may be a copy (e.g. if any export settings are applied) that's not connected to the original file. Because of this, it would often not make sense for it to have a fileName.
Although in theory the original's map file path should never be relevant when writing and only the provided path should be used, in practice it is occasionally useful (to e.g. grab the relative tileset path, get the World for the original map, get some external config in the original directory, etc), so it would be nice to perhaps get a third parameter to write() that has the original map's path, if there is one.
then why that property fileName exist, and is empty?
just example of my use case - i have some custom map exporter - that requires wold info to safe map. im using patter to collect all maps into world. in same time there could be loaded multiple worlds in Tiled (app) - so i need to find out to what world map that im exporting belongs to - and only way (what i found) is to go over all worlds, use allMaps(): WorldMapEntry[] method, and then based on map path compare with all paths in world.
and based on containsMap code it do exactly same and compares fileName field
Describe the bug
When i create new map format i need access to source map file name (to find word where map belongs, as example)
To Reproduce
register new map format:
export, use it to export map - and look at console output:
Expected behavior
in console you see
Specifications:
The text was updated successfully, but these errors were encountered: