This project aims to create a template system in Tiled. Any created object can be saved as a template. These templates can be instantiated elsewhere as objects that inherit the template’s properties.
Code and Work Details
These are the pull requests created during the project period (Note that all of these changes are merged into the master branch):
This is the first PR of the project, it was inappropriately titled, but its main purpose was creating the new template format and adding functionality to read and write the new files.
The new format provides a way for Tiled to store the saved objects with their properties in order to allow using them later in map files. Also provided a way to test saving a template group by selecting multiple objects and creating a template group from them.
Added the Templates View which enables browsing the exiting template groups in the form of a tree view. Also enabled saving an object as template to a chosen template group.
This PR adds the ability for Tiled to read and display template instances inside the map.
Added a template instance creation tool similar to the insert tile object tool. Also enabled dragging and dropping from the templates dock into the map.
The goal of this PR was to be able to edit the templates and reflect those edits in the map. A new view is embedded into the Templates View to show the template and allow graphical editing, also the properties can be edited through the properties dock.
This PR adds some convenience features to the templates dock and template saving, most importantly:
- Allow opening an existing template group.
- Allow using object name for the template name.
- Allow creating a new group while saving a template.
This PR adds JSON format support for saving the template group files as well as adding support for reading and writing template instances in JSON maps.
Added documentation for the templates functionality to the official documentation
This PR adds improves the usability of the templates in Tiled, mainly:
- Enable detaching template instances from the template.
- Disable some tools when using templates.
- Convert an object to a template instance after saving it as a template.
- Select all instances in the current map when a template is selected.
- Change the format from ttx to something to tgx.
Introduction and discussion about the project on the forum.
Detailed description of the project as well as a the description of all the features is available at the official documentation.
The core functionality of the project is done and is available for usage but there are still many improvements that could be added:
- Resetting overridden properties.
- Locking template properties.
- Handling wrong file paths.
- Managing template groups, e.g. removing a template or a template group.