mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-02 00:43:34 -04:00
buildTime stuff.
This commit is contained in:
parent
b5103aaa49
commit
5c352699b0
3 changed files with 11 additions and 0 deletions
app
server/levels
|
@ -300,6 +300,7 @@ _.extend LevelSchema.properties,
|
||||||
free: {type: 'boolean', title: 'Free', description: 'Whether this video is freely available to all players without a subscription.'}
|
free: {type: 'boolean', title: 'Free', description: 'Whether this video is freely available to all players without a subscription.'}
|
||||||
url: c.url {title: 'URL', description: 'Link to the video on Vimeo.'}
|
url: c.url {title: 'URL', description: 'Link to the video on Vimeo.'}
|
||||||
replayable: {type: 'boolean', title: 'Replayable', description: 'Whether this (hero) level infinitely scales up its difficulty and can be beaten over and over for greater rewards.'}
|
replayable: {type: 'boolean', title: 'Replayable', description: 'Whether this (hero) level infinitely scales up its difficulty and can be beaten over and over for greater rewards.'}
|
||||||
|
buildTime: {type: 'number', description: 'How long it has taken to build this level.'}
|
||||||
|
|
||||||
# Admin flags
|
# Admin flags
|
||||||
adventurer: { type: 'boolean' }
|
adventurer: { type: 'boolean' }
|
||||||
|
|
|
@ -63,6 +63,10 @@ module.exports = class LevelEditView extends RootView
|
||||||
@files = new DocumentFiles(@levelLoader.level)
|
@files = new DocumentFiles(@levelLoader.level)
|
||||||
@supermodel.loadCollection(@files, 'file_names')
|
@supermodel.loadCollection(@files, 'file_names')
|
||||||
|
|
||||||
|
destroy: ->
|
||||||
|
clearInterval @timerIntervalID
|
||||||
|
super()
|
||||||
|
|
||||||
showLoading: ($el) ->
|
showLoading: ($el) ->
|
||||||
$el ?= @$el.find('.outer-content')
|
$el ?= @$el.find('.outer-content')
|
||||||
super($el)
|
super($el)
|
||||||
|
@ -73,6 +77,7 @@ module.exports = class LevelEditView extends RootView
|
||||||
_.defer =>
|
_.defer =>
|
||||||
@world = @levelLoader.world
|
@world = @levelLoader.world
|
||||||
@render()
|
@render()
|
||||||
|
@timerIntervalID = setInterval @incrementBuildTime, 1000
|
||||||
|
|
||||||
getRenderData: (context={}) ->
|
getRenderData: (context={}) ->
|
||||||
context = super(context)
|
context = super(context)
|
||||||
|
@ -192,3 +197,7 @@ module.exports = class LevelEditView extends RootView
|
||||||
return if @initializedDocs
|
return if @initializedDocs
|
||||||
@initializedDocs = true
|
@initializedDocs = true
|
||||||
@$el.find('a[href="#components-documentation-view"]').click()
|
@$el.find('a[href="#components-documentation-view"]').click()
|
||||||
|
|
||||||
|
incrementBuildTime: =>
|
||||||
|
return if application.userIsIdle
|
||||||
|
@level.set('buildTime', (@level.get('buildTime') ? 0) + 1)
|
||||||
|
|
|
@ -56,6 +56,7 @@ LevelHandler = class LevelHandler extends Handler
|
||||||
'helpVideos'
|
'helpVideos'
|
||||||
'campaign'
|
'campaign'
|
||||||
'replayable'
|
'replayable'
|
||||||
|
'buildTime'
|
||||||
]
|
]
|
||||||
|
|
||||||
postEditableProperties: ['name']
|
postEditableProperties: ['name']
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue