Created
July 25, 2013 23:00
-
-
Save chrisgervang/6084539 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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