mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 08:50:06 +02:00
improt random levle
This commit is contained in:
parent
45aa088796
commit
24139d8ec5
4 changed files with 192 additions and 24 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue