feat(tutorial): GP and EXP awards

This commit is contained in:
Sabe Jones
2015-08-25 17:09:51 -04:00
parent 0c0525640c
commit 2a8529012b
2 changed files with 3 additions and 10 deletions

View File

@@ -189,9 +189,7 @@ function($rootScope, User, $timeout, $state, Analytics) {
$(step.element).popover('destroy'); // destroy existing hover popovers so we can add our own
step.onShow = function(){
Analytics.track({'hitType':'event','eventCategory':'behavior','eventAction':'tutorial','eventLabel':k+'-web','eventValue':i+1,'complete':false});
// step.path doesn't work in Angular do to async ui-router. Our custom solution:
if (step.state && !$state.is(step.state)) {
// $state.go() returns a promise, necessary for async tour steps; however, that's not working here - have to use timeout instead :/
$state.go(step.state);
return $timeout(function(){});
}
@@ -228,7 +226,6 @@ function($rootScope, User, $timeout, $state, Analytics) {
'<h3 class="popover-title"></h3>' +
'<div class="popover-content"></div>' +
'<div class="popover-navigation"> ' +
//'<button class="btn btn-sm btn-default" data-role="end" style="float:none;">' + (step.final ? 'Finish Tour' : 'Hide') + '</button>' +
(showCounter ? '<span style="float:right;">'+ (i+1 +' of '+ _.flatten(chapters[k]).length) +'</span>' : '')+ // counter
'<div class="btn-group">' +
(step.hideNavigation ? '' : '<button class="btn btn-sm btn-default" data-role="prev">&laquo; Previous</button>') +
@@ -240,14 +237,10 @@ function($rootScope, User, $timeout, $state, Analytics) {
'</div>';
},
storage: false
//onEnd: function(){
// User.set({'flags.showTour': false});
//}
});
});
var goto = function(chapter, page, force) {
//return; // TODO temporarily remove old tutorial system while experimenting with leslie's new gettup
if (chapter == 'intro') User.set({'flags.welcomed': true});
var curr = User.user.flags.tour[chapter];
if (page != curr+1 && !force) return;

View File

@@ -51,7 +51,7 @@ angular.module("habitrpg").factory("Notification",
function exp(val) {
if (val < -50) return; // don't show when they level up (resetting their exp)
_notify(_sign(val) + " " + _round(val) + " " + window.env.t('xp'), 'xp', 'glyphicon glyphicon-star');
_notify(_sign(val) + " " + _round(val) + " " + window.env.t('experience'), 'xp', 'glyphicon glyphicon-star');
}
function error(error){
@@ -64,7 +64,7 @@ angular.module("habitrpg").factory("Notification",
function hp(val) {
// don't show notifications if user dead
_notify(_sign(val) + " " + _round(val) + " " + window.env.t('hp'), 'hp', 'glyphicon glyphicon-heart');
_notify(_sign(val) + " " + _round(val) + " " + window.env.t('health'), 'hp', 'glyphicon glyphicon-heart');
}
function lvl(){
@@ -79,7 +79,7 @@ angular.module("habitrpg").factory("Notification",
}
function mp(val) {
_notify(_sign(val) + " " + _round(val) + " " + window.env.t('mp'), 'mp', 'glyphicon glyphicon-fire');
_notify(_sign(val) + " " + _round(val) + " " + window.env.t('mana'), 'mp', 'glyphicon glyphicon-fire');
}
function streak(val) {