This commit is contained in:
Nick Winter 2014-02-12 16:42:31 -08:00
commit d2345432ff
7 changed files with 13 additions and 5 deletions

View file

@ -64,7 +64,7 @@ self.transferableSupported = transferableSupported = ->
if args.level
self.world.loadFromLevel args.level, true
self.goalManager = new GoalManager self.world
self.goalManager.setGoals args.goals
self.goalManager.setGoals args.level?.goals or args.goals
self.goalManager.setCode args.userCodeMap
self.goalManager.worldGenerationWillBegin()
self.world.setGoalManager self.goalManager

View file

@ -15,7 +15,7 @@ module.exports = class GoalManager extends CocoClass
nextGoalID: 0
constructor: (@world) ->
constructor: (@world, @initialGoals) ->
super()
@init()
@ -25,6 +25,7 @@ module.exports = class GoalManager extends CocoClass
@userCodeMap = {} # @userCodeMap.thangID.methodName.aether.raw = codeString
@thangTeams = {}
@initThangTeams()
@addGoal goal for goal in @initialGoals if @initialGoals
initThangTeams: ->
return unless @world

View file

@ -35,7 +35,7 @@
position: relative
top: 3px
#marker-button
#marker-button, #end-button
float: right
margin-right: 10px
position: relative

View file

@ -39,6 +39,9 @@ block content
button.btn.btn-small.btn-primary#marker-button
i.icon-map-marker
button.btn.btn-small.btn-primary#end-button
i.icon-stop
div.slider-cell
| Rotation:
span.rotation-label

View file

@ -29,6 +29,7 @@ module.exports = class ThangTypeEditView extends View
'change #real-upload-button': 'animationFileChosen'
'change #animations-select': 'showAnimation'
'click #marker-button': 'toggleDots'
'click #end-button': 'endAnimation'
subscriptions:
'save-new-version': 'saveNewThangType'
@ -130,6 +131,9 @@ module.exports = class ThangTypeEditView extends View
@aboveHeadDot.y = CENTER.y + aboveHead.y * @scale
@stage.addChild(@groundDot, @torsoDot, @mouthDot, @aboveHeadDot)
endAnimation: ->
@currentSprite?.queueAction('idle')
updateGrid: ->
grid = new createjs.Container()
line = new createjs.Shape()

View file

@ -327,7 +327,7 @@ module.exports = class PlayLevelView extends View
@surface.camera.zoomTo({x:0, y:0}, 0.1, 0)
initGoalManager: ->
@goalManager = new GoalManager(@world)
@goalManager = new GoalManager(@world, @level.get('goals'))
@god.goalManager = @goalManager
initScriptManager: ->

View file

@ -46,7 +46,7 @@
"mongoose": "3.8.x",
"mongoose-text-search": "~0.0.2",
"request": "2.12.x",
"tv4": "1.0.x",
"tv4": "1.0.11",
"lodash": "~2.0.0",
"underscore.string": "2.3.x",
"async": "0.2.x",