Restored Tiled 1.8 file format compatibility by default #3560
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since Tiled 1.9, the "type" attribute was written out as "class", for consistency with the new "class" attribute added to other elements. This change affected the TMX, JSON and Lua formats. For compatibility, a "Compatibility Version" option was introduced for projects, which could be used to restore compatibility with Tiled 1.8.
This change has unfortunately caused considerable confusion, and many existing libraries and frameworks supporting Tiled files still do not support "class" even half a year after this change. Renaming this attribute just for consistency was clearly a mistake.
This change restores the compatibility with Tiled 1.8 by default, using "class" only in new places but reverting back to the older "type" attribute for map objects and tiles. This is not consistent, but compatibility is more important than consistency.
For projects that came to rely on the Tiled 1.9 approach of using "class" consistently, a new "Tiled 1.9" compatibility mode has been introduced.
Finally, new projects no longer default to the latest version, but rather to the current version. This means that should there ever be a reason to break compatibility in the future, such breakage will not affect existing projects (when they are using a .tiled-project file at least).