mirror of
https://github.com/OMGeeky/ATCS.git
synced 2025-12-26 23:57:25 +01:00
Progress on Dialogue Sketch to JSON Data conversion.
Opportunistic bug fix in JSON import wizard.
This commit is contained in:
@@ -801,7 +801,7 @@ public class Project implements ProjectTreeNode, Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param node. Before calling this method, make sure that no other node with the same class exist in either created or altered.
|
||||
* @param node. Before calling this method, make sure that no other node with the same class and id exist in either created or altered.
|
||||
*/
|
||||
public void createElement(JSONElement node) {
|
||||
node.writable = true;
|
||||
@@ -823,6 +823,34 @@ public class Project implements ProjectTreeNode, Serializable {
|
||||
fireElementAdded(node, getNodeIndex(node));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param node. Before calling this method, make sure that no other node with the same class and id exist in either created or altered.
|
||||
*/
|
||||
public void createElements(List<JSONElement> nodes) {
|
||||
for (JSONElement node : nodes) {
|
||||
//Already added.
|
||||
if (node.getProject() != null) continue;
|
||||
node.writable = true;
|
||||
if (getGameDataElement(node.getClass(), node.id) != null) {
|
||||
GameDataElement existingNode = getGameDataElement(node.getClass(), node.id);
|
||||
for (GameDataElement backlink : existingNode.getBacklinks()) {
|
||||
backlink.elementChanged(existingNode, node);
|
||||
}
|
||||
existingNode.getBacklinks().clear();
|
||||
node.writable = true;
|
||||
alteredContent.gameData.addElement(node);
|
||||
} else {
|
||||
createdContent.gameData.addElement(node);
|
||||
}
|
||||
}
|
||||
for (JSONElement node : nodes) {
|
||||
node.link();
|
||||
node.state = GameDataElement.State.created;
|
||||
fireElementAdded(node, getNodeIndex(node));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void moveToCreated(JSONElement target) {
|
||||
target.childrenRemoved(new ArrayList<ProjectTreeNode>());
|
||||
|
||||
Reference in New Issue
Block a user