Create new TMX maps in your project, and edit them with Tiled from ATCS

!! Also, "created" elements show the "unsaved" asterisk in their
description until they're saved to disk. 
Added a button to the spritesheet editor to open image in an external
tool too. This may or may not remain in the app.
This commit is contained in:
Zukero
2017-02-28 18:43:47 +01:00
parent 41462137d6
commit 061a0fa11b
14 changed files with 369 additions and 15 deletions

View File

@@ -850,6 +850,34 @@ public class Project implements ProjectTreeNode, Serializable {
}
}
/**
*
* @param node. Before calling this method, make sure that no other map with the same id exist in either created or altered.
*/
public void createElement(TMXMap node) {
node.writable = true;
if (getMap(node.id) != null) {
GameDataElement existingNode = getMap(node.id);
for (GameDataElement backlink : existingNode.getBacklinks()) {
backlink.elementChanged(existingNode, node);
}
existingNode.getBacklinks().clear();
node.writable = true;
node.tmxFile = new File(alteredContent.baseFolder, node.tmxFile.getName());
node.parent = alteredContent.gameMaps;
alteredContent.gameMaps.addMap(node);
node.link();
node.state = GameDataElement.State.created;
} else {
node.tmxFile = new File(createdContent.baseFolder, node.tmxFile.getName());
node.parent = createdContent.gameMaps;
createdContent.gameMaps.addMap(node);
node.link();
node.state = GameDataElement.State.created;
}
fireElementAdded(node, getNodeIndex(node));
}
public void moveToCreated(JSONElement target) {
target.childrenRemoved(new ArrayList<ProjectTreeNode>());