diff --git a/common/locales/en/npc.json b/common/locales/en/npc.json index 3955b8a7d7..e1ef831aa6 100644 --- a/common/locales/en/npc.json +++ b/common/locales/en/npc.json @@ -45,5 +45,13 @@ "tourGP": "Buy the Training Sword with the gold you just earned!", "tourAvatar": "Now your avatar has the Training Sword. Click on your avatar to customize it!", "tourScrollDown": "Be sure to scroll all the way down to see all the options! Click on your avatar again to return to the tasks page.", - "tourMuchMore": "When you're done with tasks, you can form a Party with friends, chat in the shared-interest Guilds, join Challenges, and more!" + "tourMuchMore": "When you're done with tasks, you can form a Party with friends, chat in the shared-interest Guilds, join Challenges, and more!", + + "tourStatsPage": "This is your Stats page! Earn achievements by completing the listed tasks.", + "tourTavernPage": "Welcome to the Tavern, an all-ages chatroom! You can freeze your account in case of illness or travel by clicking 'Rest in the Inn.' Come say hi!", + "tourPartyPage": "Your Party will help you stay accountable. Invite friends to unlock a Quest Scroll!", + "tourGuildsPage": "Guilds are social groups with common themes. Search for the subjects that interest you! We recommend the Newbies Guild.", + "tourChallengesPage": "Joining a Challenge will add tasks to your account. Compete against other users to win gem prizes!", + "tourMarketPage": "Starting at Level 4, eggs and hatching potions drop randomly when you complete tasks. They appear here - use them to hatch pets! You can also buy items from the Market." + } diff --git a/migrations/20150218_interactive_tour.js b/migrations/20150218_interactive_tour.js index 50e633b1c4..91769742ed 100644 --- a/migrations/20150218_interactive_tour.js +++ b/migrations/20150218_interactive_tour.js @@ -1,3 +1,10 @@ -//db.users.update({'flags.showTour':{$ne:false}},{$set:{'flags.tour.intro':0}},{multi:1}) -//db.users.update({'flags.showTour':false},{$set:{'flags.tour.intro':-1}},{multi:1}) -db.users.update({},{$set:{'flags.tour.intro':-1}},{multi:1}) \ No newline at end of file +db.users.update({},{$set:{ + 'flags.tour.intro':-2, + //'flags.tour.classes':-2, + 'flags.tour.stats':-2, + 'flags.tour.tavern':-2, + 'flags.tour.party':-2, + 'flags.tour.guilds':-2, + 'flags.tour.challenges':-2, + 'flags.tour.market':-2 +}},{multi:1}) \ No newline at end of file diff --git a/website/public/js/services/guideServices.js b/website/public/js/services/guideServices.js index 5249598579..fb5566c26d 100644 --- a/website/public/js/services/guideServices.js +++ b/website/public/js/services/guideServices.js @@ -109,8 +109,51 @@ function($rootScope, User, $timeout, $state) { final: true } ] - ] + ], + stats: [[ + { + orphan: true, + content: window.env.t('tourStatsPage'), + final: true + } + ]], + tavern: [[ + { + orphan: true, + content: window.env.t('tourTavernPage'), + final: true + } + ]], + party: [[ + { + orphan: true, + content: window.env.t('tourPartyPage'), + final: true + } + ]], + guilds: [[ + { + orphan: true, + content: window.env.t('tourGuildsPage'), + final: true + } + ]], + challenges: [[ + { + orphan: true, + content: window.env.t('tourChallengesPage'), + final: true + } + ]], + market: [[ + { + orphan: true, + content: window.env.t('tourMarketPage'), + final: true + } + ]] } + _.each(chapters, function(chapter, k){ _(chapter).flatten().each(function(step) { step.content = "
" + step.content + "
"; @@ -124,8 +167,8 @@ function($rootScope, User, $timeout, $state) { } } step.onHide = function(){ - if (step.final) { // -1 indicates complete - var ups={};ups['flags.tour.'+k] = -1; + if (step.final) { // -2 indicates complete + var ups={};ups['flags.tour.'+k] = -2; User.set(ups); } } @@ -162,7 +205,7 @@ function($rootScope, User, $timeout, $state) { var goto = function(chapter, page, force) { var curr = User.user.flags.tour[chapter]; - if ((page != curr+1 || curr > page) && !force) return; + if (page != curr+1 && !force) return; var updates = {};updates['flags.tour.'+chapter] = page; User.set(updates); var chap = tour[chapter], opts = chap._options; @@ -191,7 +234,15 @@ function($rootScope, User, $timeout, $state) { var alreadyShown = function(before, after) { return !(!before && after === true) }; //$rootScope.$watch('user.flags.dropsEnabled', _.flow(alreadyShown, function(already) { //FIXME requires lodash@~3.2.0 $rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams){ - if (toState.name == 'options.profile.avatar') goto('intro', 5); + switch (toState.name) { + case 'options.profile.avatar': return goto('intro', 5); + case 'options.profile.stats': return goto('stats', 0); + case 'options.social.tavern': return goto('tavern', 0); + case 'options.social.party': return goto('party', 0); + case 'options.social.guilds': return goto('guilds', 0); + case 'options.social.challenges':return goto('challenges', 0); + case 'options.inventory.drops': return goto('market', 0); + } }) $rootScope.$watch('user.flags.dropsEnabled', function(after, before) { if (alreadyShown(before,after)) return; @@ -207,7 +258,7 @@ function($rootScope, User, $timeout, $state) { $(document).on("keyup.tour-intro", function(e) { if (e.which == 27) { - return User.set({'flags.tour.intro':-1}); + return User.set({'flags.tour.intro':-2}); } }) diff --git a/website/src/models/user.js b/website/src/models/user.js index 024bcedcc1..4429b7839b 100644 --- a/website/src/models/user.js +++ b/website/src/models/user.js @@ -120,8 +120,15 @@ var UserSchema = new Schema({ customizationsNotification: {type: Boolean, 'default': false}, showTour: {type: Boolean, 'default': true}, tour: { - intro: {type: Number, 'default': 0}, - classes: {type: Number, 'default': 0} + // -1 indicates "uninitiated", -2 means "complete", any other number is the current tour step (0-index) + intro: {type: Number, 'default': 0}, + classes: {type: Number, 'default': -1}, + stats: {type: Number, 'default': -1}, + tavern: {type: Number, 'default': -1}, + party: {type: Number, 'default': -1}, + guilds: {type: Number, 'default': -1}, + challenges: {type: Number, 'default': -1}, + market: {type: Number, 'default': -1} }, dropsEnabled: {type: Boolean, 'default': false}, itemsEnabled: {type: Boolean, 'default': false},