Skip to content

Commit

Permalink
⚡ Move the default project template out to node_requires/resources
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmoMyzrailGorynych committed Mar 27, 2020
1 parent 3e954ea commit d5f6330
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 46 deletions.
50 changes: 50 additions & 0 deletions src/node_requires/resources/projects/defaultProject.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
const defaultProjectTemplate = {
ctjsVersion: require('electron').remote.app.getVersion(),
notes: '/* empty */',
libs: {
place: {
gridX: 1024,
gridY: 1024
},
fittoscreen: {
mode: 'scaleFit'
},
mouse: {},
keyboard: {},
'keyboard.polyfill': {},
'sound.howler': {}
},
textures: [],
skeletons: [],
types: [],
sounds: [],
styles: [],
rooms: [],
actions: [],
emitterTandems: [],
starting: 0,
settings: {
minifyhtmlcss: false,
minifyjs: false,
fps: 60,
version: [0, 0, 0],
versionPostfix: '',
usePixiLegacy: true,
export: {
windows: true,
linux: true,
mac: true
},
branding: {
icon: -1,
accent: '#446adb', // ct.js' crystal blue
invertPreloaderScheme: true
}
}
};

module.exports = {
get() {
return JSON.parse(JSON.stringify(defaultProjectTemplate));
}
};
5 changes: 5 additions & 0 deletions src/node_requires/resources/projects/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const defaultProject = require('./defaultProject');

module.exports = {
defaultProject
};
47 changes: 1 addition & 46 deletions src/riotTags/project-selector.tag
Original file line number Diff line number Diff line change
Expand Up @@ -91,52 +91,7 @@ project-selector
*/
this.newProject = async (way, codename) => {
sessionStorage.showOnboarding = true;
var projectData = {
ctjsVersion: this.ctjsVersion,
notes: '/* empty */',
libs: {
place: {
gridX: 512,
gridY: 512
},
fittoscreen: {
mode: "scaleFit"
},
mouse: {},
keyboard: {},
'keyboard.polyfill': {},
'sound.howler': {}
},
textures: [],
skeletons: [],
types: [],
sounds: [],
styles: [],
rooms: [],
actions: [],
emitterTandems: [],
starting: 0,
settings: {
minifyhtmlcss: false,
minifyjs: false,
fps: 60,
version: [0, 0, 0],
versionPostfix: '',
export: {
windows64: true,
windows32: true,
linux64: true,
linux32: true,
mac64: true,
debug: false
},
branding: {
icon: -1,
accent: '#446adb', // ct.js' crystal blue
invertPreloaderScheme: true
}
}
};
const projectData = require('./data/node_requires/resources/projects/defaultProject').get();
const YAML = require('js-yaml');
const data = YAML.safeDump(projectData);
fs.outputFile(path.join(way, codename + '.ict'), data)
Expand Down

0 comments on commit d5f6330

Please sign in to comment.