Set up the WorldMapView to update the gem count when a player purchases gems or items.

This commit is contained in:
Scott Erickson 2014-11-12 10:22:56 -08:00
parent ad35109878
commit c3eecd15be
2 changed files with 3 additions and 1 deletions

View file

@ -64,7 +64,7 @@
.user-status.header-font
span.gem.gem-20
span.spr= me.gems()
span#gems-count.spr= me.gems()
span.spl.spr(data-i18n="general.player_level")
span.spr= me.level()
if me.get('anonymous')

View file

@ -46,6 +46,8 @@ module.exports = class WorldMapView extends RootView
@playMusicTimeout = _.delay (=> @playMusic() unless @destroyed), musicDelay
@preloadTopHeroes()
@hadEverChosenHero = me.get('heroConfig')?.thangType
@listenTo me, 'change:purchased', -> @renderSelectors('#gems-count')
@listenTo me, 'change:spent', -> @renderSelectors('#gems-count')
window.tracker?.trackEvent 'World Map', Action: 'Loaded'
destroy: ->