Analytics tracking individual note group starts/ends. Showing next level arrow faster. Added a couple munchkin names from one of yesterday's playtesters.

This commit is contained in:
Nick Winter 2014-11-01 16:59:12 -07:00
parent af686f562d
commit 9ebd09ec40
4 changed files with 9 additions and 2 deletions

View file

@ -43,6 +43,7 @@ module.exports = ScriptManager = class ScriptManager extends CocoClass
super(options) super(options)
@originalScripts = options.scripts @originalScripts = options.scripts
@session = options.session @session = options.session
@levelID = options.levelID
@debugScripts = application.isIPadApp or CocoView.getQueryVariable 'dev' @debugScripts = application.isIPadApp or CocoView.getQueryVariable 'dev'
@initProperties() @initProperties()
@addScriptSubscriptions() @addScriptSubscriptions()
@ -219,6 +220,8 @@ module.exports = ScriptManager = class ScriptManager extends CocoClass
@notifyScriptStateChanged() @notifyScriptStateChanged()
@scriptInProgress = true @scriptInProgress = true
@currentTimeouts = [] @currentTimeouts = []
scriptLabel = "#{@levelID}: #{nextNoteGroup.scriptID} - #{nextNoteGroup.name}"
application.tracker?.trackEvent 'Script Started', {label: scriptLabel}, ['Google Analytics']
console.debug "SCRIPT: Starting note group '#{nextNoteGroup.name}'" if @debugScripts console.debug "SCRIPT: Starting note group '#{nextNoteGroup.name}'" if @debugScripts
for module in nextNoteGroup.modules for module in nextNoteGroup.modules
@processNote(note, nextNoteGroup) for note in module.startNotes() @processNote(note, nextNoteGroup) for note in module.startNotes()
@ -280,6 +283,8 @@ module.exports = ScriptManager = class ScriptManager extends CocoClass
return if @ending # kill infinite loops right here return if @ending # kill infinite loops right here
@ending = true @ending = true
return unless @currentNoteGroup? return unless @currentNoteGroup?
scriptLabel = "#{@levelID}: #{@currentNoteGroup.scriptID} - #{@currentNoteGroup.name}"
application.tracker?.trackEvent 'Script Ended', {label: scriptLabel}, ['Google Analytics']
console.debug "SCRIPT: Ending note group '#{@currentNoteGroup.name}'" if @debugScripts console.debug "SCRIPT: Ending note group '#{@currentNoteGroup.name}'" if @debugScripts
clearTimeout(timeout) for timeout in @currentTimeouts clearTimeout(timeout) for timeout in @currentTimeouts
for module in @currentNoteGroup.modules for module in @currentNoteGroup.modules

View file

@ -177,6 +177,7 @@ module.exports.thangNames = thangNames =
'Kog' 'Kog'
'Ursa' 'Ursa'
'Ragtime' 'Ragtime'
'Blob'
] ]
'Ogre Munchkin F': [ 'Ogre Munchkin F': [
'Iyert' 'Iyert'
@ -188,6 +189,7 @@ module.exports.thangNames = thangNames =
'Inski' 'Inski'
'Lacos' 'Lacos'
'Upfish' 'Upfish'
'Hoot'
] ]
'Ogre Peon M': [ 'Ogre Peon M': [
'Durbo' 'Durbo'

View file

@ -104,7 +104,7 @@ module.exports = class WorldMapView extends RootView
@$el.find('.level').tooltip() @$el.find('.level').tooltip()
@$el.addClass _.string.slugify @terrain @$el.addClass _.string.slugify @terrain
@updateVolume() @updateVolume()
@highlightElement '.level.next', delay: 2000, duration: 60000, rotation: 0, sides: ['top'] unless window.currentModal @highlightElement '.level.next', delay: 500, duration: 60000, rotation: 0, sides: ['top'] unless window.currentModal
onSessionsLoaded: (e) -> onSessionsLoaded: (e) ->
for session in @sessions.models for session in @sessions.models

View file

@ -258,7 +258,7 @@ module.exports = class PlayLevelView extends RootView
Backbone.Mediator.publish 'level:set-volume', volume: volume Backbone.Mediator.publish 'level:set-volume', volume: volume
initScriptManager: -> initScriptManager: ->
@scriptManager = new ScriptManager({scripts: @world.scripts or [], view: @, session: @session}) @scriptManager = new ScriptManager({scripts: @world.scripts or [], view: @, session: @session, levelID: @level.get('slug')})
@scriptManager.loadFromSession() @scriptManager.loadFromSession()
register: -> register: ->