diff --git a/migrations/20130208_user_customizations.js b/migrations/20130208_user_customizations.js index de16c6b029..27cf5c28a7 100644 --- a/migrations/20130208_user_customizations.js +++ b/migrations/20130208_user_customizations.js @@ -12,7 +12,9 @@ db.users.find().forEach(function(user){ 'preferences.hair': 'blond', 'items.head': user.items.armor, - 'items.shield': user.items.armor + 'items.shield': user.items.armor, + + 'flags.customizationsNotification': 'show' } db.users.update({_id:user._id}, {$set:updates}); diff --git a/src/app/character.coffee b/src/app/character.coffee index a347738761..751900a545 100644 --- a/src/app/character.coffee +++ b/src/app/character.coffee @@ -70,6 +70,19 @@ module.exports.app = (appExports, model) -> appExports.customizeArmorSet = (e, el) -> user.set 'preferences.armorSet', $(el).attr('data-value') + user.on 'set', 'flags.customizationsNotification', (captures, args) -> + return unless captures == true + html = """ + Click your avatar to customize your appearance. [Close] + """ + $('.main-avatar').popover + title: "Customize Your Avatar" + placement: 'bottom' + trigger: 'manual' + html: true + content: html + $('.main-avatar').popover 'show' + userSchema = # _id diff --git a/src/app/items.coffee b/src/app/items.coffee index 85f9a708e3..7631b8c00b 100644 --- a/src/app/items.coffee +++ b/src/app/items.coffee @@ -123,7 +123,6 @@ module.exports.app = (appExports, model) -> user.on 'set', 'flags.itemsEnabled', (captures, args) -> return unless captures == true - console.log "IH" html = """
diff --git a/src/app/scoring.coffee b/src/app/scoring.coffee index 25f15dec5c..ac21b95d4e 100644 --- a/src/app/scoring.coffee +++ b/src/app/scoring.coffee @@ -82,6 +82,13 @@ updateStats = (newStats, batch) -> newStats.exp -= tnl obj.stats.lvl++ obj.stats.hp = 50 + + obj.stats.exp = newStats.exp + + # Set flags when they unlock features + if !obj.flags.customizationsNotification and (obj.stats.exp > 10 or obj.stats.lvl > 1) + batch.set 'flags.customizationsNotification', true + obj.flags.customizationsNotification = true if !obj.flags.itemsEnabled and obj.stats.lvl >= 2 # Set to object, then also send to browser right away to get model.on() subscription notification batch.set 'flags.itemsEnabled', true @@ -89,7 +96,6 @@ updateStats = (newStats, batch) -> if !obj.flags.partyEnabled and obj.stats.lvl >= 3 batch.set 'flags.partyEnabled', true obj.flags.partyEnabled = true - obj.stats.exp = newStats.exp if newStats.gp? #FIXME what was I doing here? I can't remember, gp isn't defined