From c3eecd15bea3e6cd010a8e90d34a21840744012e Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Wed, 12 Nov 2014 10:22:56 -0800 Subject: [PATCH] Set up the WorldMapView to update the gem count when a player purchases gems or items. --- app/templates/play/world-map-view.jade | 2 +- app/views/play/WorldMapView.coffee | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/templates/play/world-map-view.jade b/app/templates/play/world-map-view.jade index 2f254f7d8..b482edccf 100644 --- a/app/templates/play/world-map-view.jade +++ b/app/templates/play/world-map-view.jade @@ -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') diff --git a/app/views/play/WorldMapView.coffee b/app/views/play/WorldMapView.coffee index 64c9ff629..c5aeeb8a5 100644 --- a/app/views/play/WorldMapView.coffee +++ b/app/views/play/WorldMapView.coffee @@ -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: ->