Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #49 from setho246/41-Complete-the-nodeView
Browse files Browse the repository at this point in the history
#41 complete the node view
  • Loading branch information
setho246 authored Aug 25, 2021
2 parents 591a331 + d1d8bef commit 409675d
Show file tree
Hide file tree
Showing 6 changed files with 9,505 additions and 314 deletions.
9,127 changes: 9,127 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yarnspinnereditor",
"version": "1.0.0",
"version": "0.1.0",
"description": "A new editor for Yarn Spinner",
"main": ".webpack/main",
"scripts": {
Expand Down Expand Up @@ -86,4 +86,4 @@
"konva": "^8.1.3",
"monaco-editor": "^0.27.0"
}
}
}
2 changes: 1 addition & 1 deletion src/YarnSpinner/yarnSpinnerCompletions.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const completions = {
}];

//Get all of the text in the editor
var text = model.getValueInRange({startLineNumber: 1, startColumn: 1, endLineNumber: position.lineNumber, endColumn: position.column});
var text = model.getValue();
//Regex for both titles and variables, global tag is used.
var nodesRegex = /Title:\s?[A-Za-z0-9_]+[\.]*[A-Za-z0-9_]*/g;
var variablesRegex = /\$[A-Za-z0-9_]+[\.]*[A-Za-z0-9_]*/g;
Expand Down
23 changes: 11 additions & 12 deletions src/controllers/EditorController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,25 +179,24 @@ export class EditorController
console.log("Delete node");
if (currentObject.returnNode)
{
nodeView.removeNode(currentObject.returnNode.getTitle());
nodeView.removeNode(currentObject.returnNode);
}
break;
case ReturnCode.Update:
// console.log("Updating node");
// if(currentObject.returnTitles)
// {
// nodeView.changeNodeName(currentObject.returnTitles[0], currentObject.returnTitles[1]);
// }
console.log("Updating node");
if(currentObject.returnNode)
{
nodeView.changeNodeName(currentObject.returnNode);
}
break;
case ReturnCode.Jumps:
// console.log("Doing the jumps");
// console.log(currentObject.returnJumps[0].getTarget());
console.log("Doing the jumps");
//if (currentObject.returnJumps.length !== 0)
//{
nodeView.receiveJumps(currentObject.returnJumps);

// nodeView.receiveJumps(currentObject.returnJumps);
//}
break;
// case ReturnCode.None:
// //TODO something here, maybe a return from nodeView to get metadata info from nodes
// break;
}
}
}
Expand Down
Loading

0 comments on commit 409675d

Please sign in to comment.