Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Templates dock #1612
This pull request represents the second checkpoint of the Reusable Object Templates project, it's mainly concerned with creating the dock and managing the created templates.
These are the main items I will focus on doing:
I've finished loading templates on startup. testing is cumbersome because the file doesn't exist by default.
The file is called templatedocuments.xml and is located in the default data location, this is it's structure
I think renaming it to templategroups.xml and have internal elements as templategroups might be a good idea but not sure.
To make testing easier I will start implementing the new group button to be able to create groups then will work on adding an object to a loaded group as a template, after that I will work on error handling.
One particular part that I don't like is getting a parent of a template group in the model, I loop through all the documents to find the correct parent.
Yes, I think these would be better names as well. The "Document" is only an internal thing referring to the fact that it is a file of which the changes and format are tracked. I'm considering to rename this to "Asset", which is a common name for this as well.
I've done a punch of improvements
I've also handled the tilesets so a template group will have no duplicates, this required storing a reference upon saving any template that had a new tileset.
The references then were required to be deleted upon exit which initially violated some assertions. I had to change the destruction order in the main window as the preferences object which stored the documents was deleted after the tileset manager.