improt random levle

This commit is contained in:
Peter Cottle 2013-01-13 11:27:23 -08:00
parent 45aa088796
commit 24139d8ec5
4 changed files with 192 additions and 24 deletions

View file

@ -91,7 +91,7 @@ var Level = Sandbox.extend({
},
initName: function() {
if (!this.level.name || !this.level.id) {
if (!this.level.name) {
this.level.name = 'Rebase Classic';
console.warn('REALLY BAD FORM need ids and names');
}
@ -401,11 +401,6 @@ var Level = Sandbox.extend({
throw new Errors.CommandResult({
msg: hintMsg
});
}],
[/^build level$/, function() {
throw new Errors.GitError({
msg: "You can't build a level inside a level! Please exit level first"
});
}]
];
},
@ -416,6 +411,20 @@ var Level = Sandbox.extend({
Level.__super__.reset.apply(this, arguments);
},
buildLevel: function(command, deferred) {
this.exitLevel();
setTimeout(function() {
Main.getSandbox().buildLevel(command, deferred);
}, this.getAnimationTime() * 1.5);
},
importLevel: function(command, deferred) {
this.exitLevel();
setTimeout(function() {
Main.getSandbox().importLevel(command, deferred);
}, this.getAnimationTime() * 1.5);
},
startLevel: function(command, deferred) {
this.exitLevel();