level arbiter beginning

This commit is contained in:
Peter Cottle 2013-01-05 21:47:05 -08:00
parent d5bddcc6b4
commit 27498419c9
10 changed files with 109 additions and 19 deletions

View file

@ -114,7 +114,8 @@ var Level = Sandbox.extend({
el: this.goalCanvasHolder.getCanvasLocation(),
containerElement: this.goalCanvasHolder.getCanvasLocation(),
treeString: this.goalTreeString,
noKeyboardInput: true
noKeyboardInput: true,
noClick: true
});
},
@ -227,7 +228,6 @@ var Level = Sandbox.extend({
afterCB: _.bind(this.afterCommandCB, this),
afterDeferHandler: _.bind(this.afterCommandDefer, this)
});
console.log('made my git shim');
},
getCommandsThatCount: function() {
@ -332,6 +332,18 @@ var Level = Sandbox.extend({
return instants;
},
startLevel: function(command, deferred) {
command.addWarning(
"You are in a level! You can't start a new one before exiting. I'll add the command for you..."
);
command.set('status', 'error');
Main.getEventBaton().trigger('commandSubmitted',
'delay 3000; exit level; delay 500;' + command.get('rawStr')
);
deferred.resolve();
},
exitLevel: function(command, deferred) {
this.die();
setTimeout(function() {