From 5251b4ce3cd1e530d2ea06940463055fdb702ee8 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Mon, 16 Dec 2013 13:33:05 -0700 Subject: [PATCH] classes: add just guide for classes unlock --- public/js/controllers/userCtrl.js | 5 ++- public/js/services/guideServices.js | 58 +++++++++++++++++++++++++- views/options/inventory/inventory.jade | 2 +- views/options/profile.jade | 4 +- views/shared/profiles/stats.jade | 2 +- 5 files changed, 64 insertions(+), 7 deletions(-) diff --git a/public/js/controllers/userCtrl.js b/public/js/controllers/userCtrl.js index f6e6e57e38..8158b904a2 100644 --- a/public/js/controllers/userCtrl.js +++ b/public/js/controllers/userCtrl.js @@ -1,7 +1,7 @@ "use strict"; -habitrpg.controller("UserCtrl", ['$rootScope', '$scope', '$location', 'User', '$http', '$state', - function($rootScope, $scope, $location, User, $http, $state) { +habitrpg.controller("UserCtrl", ['$rootScope', '$scope', '$location', 'User', '$http', '$state', 'Guide', + function($rootScope, $scope, $location, User, $http, $state, Guide) { $scope.profile = User.user; $scope.hideUserAvatar = function() { $(".userAvatar").hide(); @@ -26,6 +26,7 @@ habitrpg.controller("UserCtrl", ['$rootScope', '$scope', '$location', 'User', '$ $scope.selectedClass = undefined; $rootScope.Shared.updateStore(User.user); $state.go('options.profile.stats'); + Guide.classesTour(); } $scope.save = function(){ diff --git a/public/js/services/guideServices.js b/public/js/services/guideServices.js index ddb43467cb..257f7de938 100644 --- a/public/js/services/guideServices.js +++ b/public/js/services/guideServices.js @@ -139,8 +139,64 @@ angular.module('guideServices', []). } }); + + + + /** + * Classes Tour + */ + function classesTour(){ + var tourSteps = [ + { + element: ".allocate-stats", + title: "Stats", + content: "These are your class's stats, they effect the game-play. Each time you level up, you get one point to allocate to particular stat. Hover over each stat for more information.", + }, { + element: ".auto-allocate", + title: "Auto Allocate", + placement: 'left', + content: "If 'automatic allocation' is checked, you're avatar gains stats automatically based on your tasks' attributes, which you can find in TASK > Edit > Advanced > Attributes. Eg, if you hit the gym often, and your 'Gym' Daily is set to 'Physical', you'll gain STR auotmatically.", + }, { + element: ".auto-allocate", + title: "Auto Allocate", + placement: 'left', + content: "We recommend auto-allocate if you (a) want to 'role play' your avatar, or (b) can't be bothered with the class system (HabitRPG jumping the shark?). For other players who desire maximum control, leave 'auto allocate' unchecked.", + }, { + element: ".meter.mana", + title: "Spells", + content: "You can now unlock class-specific spells. You'll see your first at level 6." + }, { +// onShow: function(tour){ +// $rootScope.$state.go('options.inventory.inventory'); +// }, + element: '.stats-equipment', + title: "Class Gear", + content: "Your old gear has been placed into your inventory, you're now wearing your apprentice " + User.user.stats.class + " equippment. Wearing your class's gear grants you a 1.5% bonus to stats. However, feel free to switch back to your old gear." + }, { + element: ".stats-equipment", + title: "Read More", + content: "For more information on the class-system, see Wikia.", + } + ]; + _.each(tourSteps, function(step){ + step.content = "
" + step.content + "
"; // add Justin NPC img + }); + $('.allocate-stats').popover('destroy'); + var tour = new Tour({ +// onEnd: function(){ +// User.set({'flags.showTour': false}); +// } + }); + tourSteps.forEach(function(step) { + tour.addStep(_.defaults(step, {html: true})); + }); + tour.restart(); // Tour doesn't quite mesh with our handling of flags.showTour, just restart it on page load + //tour.start(true); + }; + return { - initTour:initTour + initTour: initTour, + classesTour: classesTour }; } diff --git a/views/options/inventory/inventory.jade b/views/options/inventory/inventory.jade index 835eede4e0..f5cbf8a28f 100644 --- a/views/options/inventory/inventory.jade +++ b/views/options/inventory/inventory.jade @@ -33,7 +33,7 @@ script(type='text/ng-template', id='partials/options.inventory.inventory.html') hr h4 Gear - li.customize-menu + li.customize-menu.inventory-gear menu.pets-menu(label='{{label}}', ng-repeat='(klass,label) in {base:"Base", warrior:"Warrior", wizard:"Wizard", rogue:"Rogue", special:"Special"}', ng-show='gear[klass]') div(ng-repeat='item in gear[klass]') button.customize-option(popover='{{item.notes}}', popover-title='{{item.text}}', popover-trigger='mouseenter', popover-placement='right', ng-click='user.ops.equip({params:{key:item.key}})', class='shop_{{item.key}}', ng-class='{selectableInventory: user.items.gear.equipped[item.type] == item.key}') diff --git a/views/options/profile.jade b/views/options/profile.jade index 5be7059436..c202409cf8 100644 --- a/views/options/profile.jade +++ b/views/options/profile.jade @@ -122,7 +122,7 @@ script(id='partials/options.profile.stats.html', type='text/ng-template') .row-fluid .border-right(ng-class='user.stats.lvl < 5 ? "span6" : "span4"') include ../shared/profiles/stats - .span4.border-right(ng-show='user.stats.lvl >= 5') + .span4.border-right.allocate-stats(ng-show='user.stats.lvl >= 5') h4 | {{user.stats.class}}  a.btn.btn-danger.btn-mini(ng-click='changeClass(null)') @@ -130,7 +130,7 @@ script(id='partials/options.profile.stats.html', type='text/ng-template') small 3 h6 Points: {{user.stats.points}} - fieldset + fieldset.auto-allocate label.checkbox input(type='checkbox', ng-model='user.preferences.automaticAllocation', ng-change='set({"preferences.automaticAllocation": user.preferences.automaticAllocation?true: false})') | Automatic Allocation diff --git a/views/shared/profiles/stats.jade b/views/shared/profiles/stats.jade index 17cc958729..ae5c15962a 100644 --- a/views/shared/profiles/stats.jade +++ b/views/shared/profiles/stats.jade @@ -1,4 +1,4 @@ -h4 Equipment +h4.stats-equipment Equipment p(ng-repeat='(k,v) in user.items.gear.equipped', ng-init='piece=Content.gear.flat[v]', ng-show='piece') strong {{piece.text}}:  span(ng-repeat='stat in ["str","con","per","int"]', ng-show='piece[stat]') {{piece[stat]}}{{stat}}