mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 08:28:50 +02:00
initial level builder stuff
This commit is contained in:
parent
37654162cb
commit
7ce6b591c0
2 changed files with 52 additions and 1 deletions
51
src/js/level/builder.js
Normal file
51
src/js/level/builder.js
Normal file
|
@ -0,0 +1,51 @@
|
|||
var _ = require('underscore');
|
||||
var Backbone = require('backbone');
|
||||
var Q = require('q');
|
||||
|
||||
var util = require('../util');
|
||||
var Main = require('../app');
|
||||
|
||||
var Visualization = require('../visuals/visualization').Visualization;
|
||||
var ParseWaterfall = require('../level/parseWaterfall').ParseWaterfall;
|
||||
var Level = require('../level').Level;
|
||||
|
||||
var Command = require('../models/commandModel').Command;
|
||||
var GitShim = require('../git/gitShim').GitShim;
|
||||
|
||||
var MultiView = require('../views/multiView').MultiView;
|
||||
var CanvasTerminalHolder = require('../views').CanvasTerminalHolder;
|
||||
var ConfirmCancelTerminal = require('../views').ConfirmCancelTerminal;
|
||||
var NextLevelConfirm = require('../views').NextLevelConfirm;
|
||||
var LevelToolbar = require('../views').LevelToolbar;
|
||||
|
||||
var LevelBuilder = Level.extend({
|
||||
initialize: function(options) {
|
||||
options = options || {};
|
||||
this.options = options;
|
||||
this.level = {};
|
||||
|
||||
this.levelToolbar = new LevelToolbar({
|
||||
name: 'Level Builder'
|
||||
});
|
||||
|
||||
this.level.startDialog = {
|
||||
};
|
||||
|
||||
// call our grandparent, not us
|
||||
Level.__super__.initialize.apply(this, [options]);
|
||||
},
|
||||
|
||||
takeControl: function() {
|
||||
Main.getEventBaton().stealBaton('processLevelBuilderCommand', this.processLevelCommand, this);
|
||||
|
||||
LevelBuilder.__super__.takeControl.apply(this);
|
||||
},
|
||||
|
||||
releaseControl: function() {
|
||||
Main.getEventBaton().releaseBaton('processLevelBuilderCommand', this.processLevelCommand, this);
|
||||
|
||||
LevelBuilder.__super__.releaseControl.apply(this);
|
||||
},
|
||||
});
|
||||
|
||||
exports.LevelBuilder = LevelBuilder;
|
|
@ -65,7 +65,7 @@ var Level = Sandbox.extend({
|
|||
}, this), this.getAnimationTime() * 1.2);
|
||||
},
|
||||
|
||||
initName: function(options) {
|
||||
initName: function() {
|
||||
if (!this.level.name || !this.level.id) {
|
||||
this.level.name = 'Rebase Classic';
|
||||
console.warn('REALLY BAD FORM need ids and names');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue