Skip to content

Commit

Permalink
Edited to add legendary action output
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrevolution5 committed Feb 18, 2021
1 parent 85817e7 commit 0548ebe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/containers/legActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const LegActions=({sendData})=> {
setActions(actionGroup);
}
const callBackMethod=(value)=>{
sendData("actions", value);
sendData("legendaryActions", value);
}
useEffect(()=>{callBackMethod(actions)}, [actions])

Expand Down
6 changes: 6 additions & 0 deletions src/containers/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ const toXML = (stateObject) => {

}
}
if (stateObject.legendaryActions.length > 0){
for (let i = 0; i < stateObject.legendaryActions.length; i++) {
const element = stateObject.legendaryActions[i];
xmlDocumentString+= "\t<legendary>\n\t\t<name>" + element.title + "</name>\n\t\t<text>" + element.text +"</text>\n\t</legendary>\n"
}
}
//finish xml by closing monster tag
xmlDocumentString += "</monster>"
console.log(xmlDocumentString)
Expand Down

0 comments on commit 0548ebe

Please sign in to comment.