Skip to content

Instantly share code, notes, and snippets.

@chrisgervang
Created July 25, 2013 23:00
Show Gist options
  • Save chrisgervang/6084539 to your computer and use it in GitHub Desktop.
Save chrisgervang/6084539 to your computer and use it in GitHub Desktop.
Meteor.startup(function () {
if (Assets.find().count() === 0) {
console.log('calling loadCSV');
Meteor.call('loadCSV', function (error, result) {
console.log('err: ', error);
console.log(result, 'gameAssets');
//var filePath = '/public/Textures/' + lines[i].match(/\(?<="\)[^"]*\(?="\)/);
//var fileHandle = lines[i].match(/^[^,*]+/);
for(var i = 0; i < result.length; i++) {
console.log('inserting');
Assets.insert({
name: result[i][1],
handle: result[i][0],
image: '/Textures/' + result[i][1],
type: result[i][2],
color: [255, 255, 255],
used: false,
usedBy: []
});
}
});
} else {
console.log('no file load');
}
Session.set('showAll', true);
Session.set('showPlant', true);
Session.set('showProp', true);
Session.set('showTerrain', true);
$('.show-all').attr('checked', true);
$('.show-prop').attr('checked', true);
$('.show-plant').attr('checked', true);
$('.show-terrain').attr('checked', true);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment