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

Commit

Permalink
Fix code generator generating code from outdated project
Browse files Browse the repository at this point in the history
  • Loading branch information
Mammad900 committed Jan 17, 2021
1 parent 2978e6e commit 8143446
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions res/code-generator/generateCode.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
'use strict';
function generateCode(libPath) {
// Save everything
if(elements.selectedElement!=-1){
elements.types[elements.data[elements.selectedElement].type].saveProperties(elements.selectedElement)
}

pages.selectPage(pages.currentPage);

// Indents text by 4 characters
function indent(text) {
return " "+ text.replace(new RegExp("\n","g"), "\n ");
}

// Generate element creation code
var elCode="";
pages.data.forEach(function (pg, pi) {
pg.elements.forEach(function (el,ei) {
elCode+= elements.types[el.type].generateCode(pi, el);
})
})

// Assemble everything
return projectCode.globalBeginning+
"\n\n"+
CodeGen_Config()+
Expand Down

0 comments on commit 8143446

Please sign in to comment.