mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-02 00:43:34 -04:00
A couple tweaks to the ordering of events when starting to play a level. Renaming A Bolt in the Dark to Crossing the Distance.
This commit is contained in:
parent
f00fd66bed
commit
dfdcf66f4b
2 changed files with 13 additions and 8 deletions
app/views/play
|
@ -661,10 +661,10 @@ hero = [
|
||||||
y: 48
|
y: 48
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name: 'A Bolt in the Dark'
|
name: 'Closing the Distance'
|
||||||
type: 'hero'
|
type: 'hero'
|
||||||
difficulty: 1
|
difficulty: 1
|
||||||
id: 'a-bolt-in-the-dark'
|
id: 'closing-the-distance'
|
||||||
original: '541b288e1ccc8eaae19f3c25'
|
original: '541b288e1ccc8eaae19f3c25'
|
||||||
description: 'Kithmen are not the only ones to stand in your way.'
|
description: 'Kithmen are not the only ones to stand in your way.'
|
||||||
x: 76
|
x: 76
|
||||||
|
|
|
@ -131,6 +131,14 @@ module.exports = class PlayLevelView extends RootView
|
||||||
@levelLoader = new LevelLoader supermodel: @supermodel, levelID: @levelID, sessionID: @sessionID, opponentSessionID: @getQueryVariable('opponent'), team: @getQueryVariable('team')
|
@levelLoader = new LevelLoader supermodel: @supermodel, levelID: @levelID, sessionID: @sessionID, opponentSessionID: @getQueryVariable('opponent'), team: @getQueryVariable('team')
|
||||||
@listenToOnce @levelLoader, 'world-necessities-loaded', @onWorldNecessitiesLoaded
|
@listenToOnce @levelLoader, 'world-necessities-loaded', @onWorldNecessitiesLoaded
|
||||||
|
|
||||||
|
trackLevelLoadEnd: ->
|
||||||
|
return if @isEditorPreview
|
||||||
|
@loadEndTime = new Date()
|
||||||
|
loadDuration = @loadEndTime - @loadStartTime
|
||||||
|
console.debug "Level unveiled after #{(loadDuration / 1000).toFixed(2)}s"
|
||||||
|
application.tracker?.trackEvent 'Finished Level Load', level: @levelID, label: @levelID, loadDuration: loadDuration, ['Google Analytics']
|
||||||
|
application.tracker?.trackTiming loadDuration, 'Level Load Time', @levelID, @levelID
|
||||||
|
|
||||||
# CocoView overridden methods ###############################################
|
# CocoView overridden methods ###############################################
|
||||||
|
|
||||||
updateProgress: (progress) ->
|
updateProgress: (progress) ->
|
||||||
|
@ -338,6 +346,7 @@ module.exports = class PlayLevelView extends RootView
|
||||||
onLevelStarted: ->
|
onLevelStarted: ->
|
||||||
return unless @surface?
|
return unless @surface?
|
||||||
@loadingView.showReady()
|
@loadingView.showReady()
|
||||||
|
@trackLevelLoadEnd()
|
||||||
if window.currentModal and not window.currentModal.destroyed and window.currentModal.constructor isnt VictoryModal
|
if window.currentModal and not window.currentModal.destroyed and window.currentModal.constructor isnt VictoryModal
|
||||||
return Backbone.Mediator.subscribeOnce 'modal:closed', @onLevelStarted, @
|
return Backbone.Mediator.subscribeOnce 'modal:closed', @onLevelStarted, @
|
||||||
@surface.showLevel()
|
@surface.showLevel()
|
||||||
|
@ -355,12 +364,6 @@ module.exports = class PlayLevelView extends RootView
|
||||||
@loadingView.$el.remove()
|
@loadingView.$el.remove()
|
||||||
@removeSubView @loadingView
|
@removeSubView @loadingView
|
||||||
@loadingView = null
|
@loadingView = null
|
||||||
unless @isEditorPreview
|
|
||||||
@loadEndTime = new Date()
|
|
||||||
loadDuration = @loadEndTime - @loadStartTime
|
|
||||||
console.debug "Level unveiled after #{(loadDuration / 1000).toFixed(2)}s"
|
|
||||||
application.tracker?.trackEvent 'Finished Level Load', level: @levelID, label: @levelID, loadDuration: loadDuration, ['Google Analytics']
|
|
||||||
application.tracker?.trackTiming loadDuration, 'Level Load Time', @levelID, @levelID
|
|
||||||
@playAmbientSound()
|
@playAmbientSound()
|
||||||
|
|
||||||
playAmbientSound: ->
|
playAmbientSound: ->
|
||||||
|
@ -379,7 +382,9 @@ module.exports = class PlayLevelView extends RootView
|
||||||
@alreadyLoadedState = true
|
@alreadyLoadedState = true
|
||||||
state = @originalSessionState
|
state = @originalSessionState
|
||||||
if @level.get('type', true) is 'hero'
|
if @level.get('type', true) is 'hero'
|
||||||
|
Backbone.Mediator.publish 'level:suppress-selection-sounds', suppress: true
|
||||||
Backbone.Mediator.publish 'tome:select-primary-sprite', {}
|
Backbone.Mediator.publish 'tome:select-primary-sprite', {}
|
||||||
|
Backbone.Mediator.publish 'level:suppress-selection-sounds', suppress: false
|
||||||
@surface.focusOnHero()
|
@surface.focusOnHero()
|
||||||
Backbone.Mediator.publish 'level:set-time', time: 0
|
Backbone.Mediator.publish 'level:set-time', time: 0
|
||||||
Backbone.Mediator.publish 'level:set-playing', playing: true
|
Backbone.Mediator.publish 'level:set-playing', playing: true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue