Skip to content

Commit

Permalink
Merge pull request HabitRPG#4713 from HabitRPG/lefnire/interactive-tour
Browse files Browse the repository at this point in the history
Interactive Tour
  • Loading branch information
lefnire committed Mar 11, 2015
2 parents c86257b + 962bb65 commit de67f44
Show file tree
Hide file tree
Showing 13 changed files with 253 additions and 357 deletions.
127 changes: 5 additions & 122 deletions common/dist/scripts/habitrpg-shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ gear = {
0: {
text: t('weaponWarrior0Text'),
notes: t('weaponWarrior0Notes'),
value: 0
value: 1
},
1: {
text: t('weaponWarrior1Text'),
Expand Down Expand Up @@ -4574,15 +4574,15 @@ api.userDefaults = {
value: 0,
up: true,
down: false,
attribute: 'per'
attribute: 'str'
}, {
type: 'habit',
text: t('defaultHabit2Text'),
notes: t('defaultHabit2Notes'),
value: 0,
up: false,
down: true,
attribute: 'con'
attribute: 'str'
}, {
type: 'habit',
text: t('defaultHabit3Text'),
Expand All @@ -4593,134 +4593,17 @@ api.userDefaults = {
attribute: 'str'
}
],
dailys: [
{
type: 'daily',
text: t('defaultDaily1Text'),
notes: t('defaultDaily1Notes'),
value: 0,
completed: false,
repeat: repeat,
attribute: 'per'
}, {
type: 'daily',
text: t('defaultDaily2Text'),
notes: t('defaultDaily2Notes'),
value: 3,
completed: false,
repeat: repeat,
attribute: 'con'
}, {
type: 'daily',
text: t('defaultDaily3Text'),
notes: t('defaultDaily3Notes'),
value: -10,
completed: false,
repeat: repeat,
attribute: 'int'
}, {
type: 'daily',
text: t('defaultDaily4Text'),
notes: t('defaultDaily4Notes'),
checklist: [
{
completed: true,
text: t('defaultDaily4Checklist1')
}, {
completed: false,
text: t('defaultDaily4Checklist2')
}, {
completed: false,
text: t('defaultDaily4Checklist3')
}
],
completed: false,
repeat: repeat,
attribute: 'str'
}
],
dailys: [],
todos: [
{
type: 'todo',
text: t('defaultTodo1Text'),
notes: t('defaultTodoNotes'),
completed: false,
attribute: 'int'
}, {
type: 'todo',
text: t('defaultTodo2Text'),
notes: t('defaultTodoNotes'),
checklist: [
{
completed: false,
text: t('defaultTodo2Checklist1')
}, {
completed: false,
text: t('defaultTodo2Checklist2')
}, {
completed: false,
text: t('defaultTodo2Checklist3')
}
],
completed: false,
attribute: 'per'
}, {
type: 'todo',
text: t('defaultTodo3Text'),
notes: t('defaultTodoNotes'),
checklist: [
{
completed: false,
text: t('defaultTodo3Checklist1')
}, {
completed: false,
text: t('defaultTodo3Checklist2')
}, {
completed: false,
text: t('defaultTodo3Checklist3')
}
],
completed: false,
attribute: 'per'
}, {
type: 'todo',
text: t('defaultTodo4Text'),
notes: t('defaultTodoNotes'),
checklist: [
{
completed: false,
text: t('defaultTodo4Checklist1')
}, {
completed: false,
text: t('defaultTodo4Checklist2')
}, {
completed: false,
text: t('defaultTodo4Checklist3')
}
],
completed: false,
attribute: 'per'
}, {
type: 'todo',
text: t('defaultTodo5Text'),
notes: t('defaultTodoNotes'),
completed: false,
attribute: 'per'
}
],
rewards: [
{
type: 'reward',
text: t('defaultReward1Text'),
notes: t('defaultReward1Notes'),
value: 20
}, {
type: 'reward',
text: t('defaultReward2Text'),
notes: t('defaultReward2Notes'),
value: 10
}
],
rewards: [],
tags: [
{
name: t('defaultTag1')
Expand Down
14 changes: 7 additions & 7 deletions common/locales/en/defaultTasks.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"defaultHabit1Text": "1h Productive Work",
"defaultHabit1Notes": "When you create a new Habit, you can click the Edit icon and choose for it to represent a positive habit, a negative habit, or both. For some Habits, like this one, it only makes sense to gain points.",
"defaultHabit1Text": "Good Habit",
"defaultHabit1Notes": " ",

"defaultHabit2Text": "Eat Junk Food",
"defaultHabit2Notes": "For others, it only makes sense to *lose* points.",
"defaultHabit3Text": "Take The Stairs",
"defaultHabit3Notes": "For the rest, both + and - make sense (stairs = gain, elevator = lose).",
"defaultHabit2Text": "Bad Habit",
"defaultHabit2Notes": " ",

"defaultHabit3Text": "Good or Bad Habit",
"defaultHabit3Notes": " ",

"defaultDaily1Text": "1h Personal Project",
"defaultDaily1Notes": "All tasks default to yellow when they are created. This means you will take only moderate damage when they are missed and will gain only a moderate reward when they are completed.",
Expand Down
15 changes: 14 additions & 1 deletion common/locales/en/npc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"payNote": "Note: PayPal sometimes takes a long time to clear. We recommend paying with card.",
"card": "Card",
"paymentMethods": "Payment Methods:",

"welcomeHabit": "Welcome to HabitRPG",
"welcomeHabitT1": "Welcome to HabitRPG, a habit tracker that treats your tasks like a Role Playing Game. I'm",
"welcomeHabitT2": "your guide!",
Expand Down Expand Up @@ -61,5 +62,17 @@
"spells": "Spells",
"spellsText": "You can now unlock class-specific spells. You'll see your first at level 11. Your mana replenishes 10 points per day, plus 1 point per completed ",
"toDo": "To-Do",
"moreClass": "For more information on the class-system, see"
"moreClass": "For more information on the class-system, see",

"tourWelcome": "Welcome to Habitica! This is your To-Do list. Check off a task!",
"tourExp": "Great job! Checking off a task gives you Experience and Gold!",
"tourDailies": "This column is for Daily tasks. Enter a task you should do every day! <b>Sample Dailies</b>: <b>Make Bed</b>, <b>Floss</b>, <b>Check Work Email</b>",
"tourCron": "Splendid! Your Dailies will reset every day.",
"tourHP": "Watch out! If you don't complete a Daily by midnight, it will hurt you!",
"tourHabits": "This column is for good and bad Habits that you do many times a day! Click the pencil to edit the names.<ul><li><b>Sample Good Habits</b>: <b>Eat a vegetable</b>, <b>15 minutes productive work</b></li><li><b>Sample Bad Habits</b>: <b>Smoke</b>, <b>Procrastinate</b></li><li><b>Sample Good or Bad Habits</b>: <b>Took Stairs/Elevator</b>, <b>Drank Water/Soda</b>",
"tourStats": "Good Habits add Experience and Gold! Bad Habits remove health.",
"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!"
}
26 changes: 13 additions & 13 deletions common/script/content.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ gear =
0:
text: t('weaponBase0Text'), notes: t('weaponBase0Notes'), value:0
warrior:
0: text: t('weaponWarrior0Text'), notes: t('weaponWarrior0Notes'), value:0
0: text: t('weaponWarrior0Text'), notes: t('weaponWarrior0Notes'), value:1
1: text: t('weaponWarrior1Text'), notes: t('weaponWarrior1Notes', {str: 3}), str: 3, value:20
2: text: t('weaponWarrior2Text'), notes: t('weaponWarrior2Notes', {str: 6}), str: 6, value:30
3: text: t('weaponWarrior3Text'), notes: t('weaponWarrior3Notes', {str: 9}), str: 9, value:45
Expand Down Expand Up @@ -1654,29 +1654,29 @@ _.each api.subscriptionBlocks, (b,k)->b.key = k
repeat = {m:true,t:true,w:true,th:true,f:true,s:true,su:true}
api.userDefaults =
habits: [
{type: 'habit', text: t('defaultHabit1Text'), notes: t('defaultHabit1Notes'), value: 0, up: true, down: false, attribute: 'per' }
{type: 'habit', text: t('defaultHabit2Text'), notes: t('defaultHabit2Notes'), value: 0, up: false, down: true, attribute: 'con'}
{type: 'habit', text: t('defaultHabit1Text'), notes: t('defaultHabit1Notes'), value: 0, up: true, down: false, attribute: 'str' }
{type: 'habit', text: t('defaultHabit2Text'), notes: t('defaultHabit2Notes'), value: 0, up: false, down: true, attribute: 'str'}
{type: 'habit', text: t('defaultHabit3Text'), notes: t('defaultHabit3Notes'), value: 0, up: true, down: true, attribute: 'str'}
]

dailys: [
{type: 'daily', text: t('defaultDaily1Text'), notes: t('defaultDaily1Notes'), value: 0, completed: false, repeat: repeat, attribute: 'per' }
{type: 'daily', text: t('defaultDaily2Text'), notes: t('defaultDaily2Notes'), value: 3, completed: false, repeat: repeat, attribute: 'con' }
{type: 'daily', text: t('defaultDaily3Text'), notes: t('defaultDaily3Notes'), value: -10, completed: false, repeat: repeat, attribute: 'int' }
{type: 'daily', text: t('defaultDaily4Text'), notes: t('defaultDaily4Notes'), checklist: [{completed: true, text: t('defaultDaily4Checklist1') }, {completed: false, text: t('defaultDaily4Checklist2')}, {completed: false, text: t('defaultDaily4Checklist3')}], completed: false, repeat: repeat, attribute: 'str' }
# {type: 'daily', text: t('defaultDaily1Text'), notes: t('defaultDaily1Notes'), value: 0, completed: false, repeat: repeat, attribute: 'per' }
# {type: 'daily', text: t('defaultDaily2Text'), notes: t('defaultDaily2Notes'), value: 3, completed: false, repeat: repeat, attribute: 'con' }
# {type: 'daily', text: t('defaultDaily3Text'), notes: t('defaultDaily3Notes'), value: -10, completed: false, repeat: repeat, attribute: 'int' }
# {type: 'daily', text: t('defaultDaily4Text'), notes: t('defaultDaily4Notes'), checklist: [{completed: true, text: t('defaultDaily4Checklist1') }, {completed: false, text: t('defaultDaily4Checklist2')}, {completed: false, text: t('defaultDaily4Checklist3')}], completed: false, repeat: repeat, attribute: 'str' }
]

todos: [
{type: 'todo', text: t('defaultTodo1Text'), notes: t('defaultTodoNotes'), completed: false, attribute: 'int' }
{type: 'todo', text: t('defaultTodo2Text'), notes: t('defaultTodoNotes'), checklist: [{completed: false, text: t('defaultTodo2Checklist1') }, {completed: false, text: t('defaultTodo2Checklist2')}, {completed: false, text: t('defaultTodo2Checklist3')}], completed: false, attribute: 'per' }
{type: 'todo', text: t('defaultTodo3Text'), notes: t('defaultTodoNotes'), checklist: [{completed: false, text: t('defaultTodo3Checklist1') }, {completed: false, text: t('defaultTodo3Checklist2')}, {completed: false, text: t('defaultTodo3Checklist3')}], completed: false, attribute: 'per' }
{type: 'todo', text: t('defaultTodo4Text'), notes: t('defaultTodoNotes'), checklist: [{completed: false, text: t('defaultTodo4Checklist1') }, {completed: false, text: t('defaultTodo4Checklist2')}, {completed: false, text: t('defaultTodo4Checklist3')}], completed: false, attribute: 'per' }
{type: 'todo', text: t('defaultTodo5Text'), notes: t('defaultTodoNotes'), completed: false, attribute: 'per' }
# {type: 'todo', text: t('defaultTodo2Text'), notes: t('defaultTodoNotes'), checklist: [{completed: false, text: t('defaultTodo2Checklist1') }, {completed: false, text: t('defaultTodo2Checklist2')}, {completed: false, text: t('defaultTodo2Checklist3')}], completed: false, attribute: 'per' }
# {type: 'todo', text: t('defaultTodo3Text'), notes: t('defaultTodoNotes'), checklist: [{completed: false, text: t('defaultTodo3Checklist1') }, {completed: false, text: t('defaultTodo3Checklist2')}, {completed: false, text: t('defaultTodo3Checklist3')}], completed: false, attribute: 'per' }
# {type: 'todo', text: t('defaultTodo4Text'), notes: t('defaultTodoNotes'), checklist: [{completed: false, text: t('defaultTodo4Checklist1') }, {completed: false, text: t('defaultTodo4Checklist2')}, {completed: false, text: t('defaultTodo4Checklist3')}], completed: false, attribute: 'per' }
# {type: 'todo', text: t('defaultTodo5Text'), notes: t('defaultTodoNotes'), completed: false, attribute: 'per' }
]

rewards: [
{type: 'reward', text: t('defaultReward1Text'), notes: t('defaultReward1Notes'), value: 20 }
{type: 'reward', text: t('defaultReward2Text'), notes: t('defaultReward2Notes'), value: 10 }
# {type: 'reward', text: t('defaultReward1Text'), notes: t('defaultReward1Notes'), value: 20 }
# {type: 'reward', text: t('defaultReward2Text'), notes: t('defaultReward2Notes'), value: 10 }
]

tags: [
Expand Down
3 changes: 3 additions & 0 deletions migrations/20150218_interactive_tour.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//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})
5 changes: 2 additions & 3 deletions website/public/js/controllers/settingsCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ habitrpg.controller('SettingsCtrl',

$scope.showTour = function(){
User.set({'flags.showTour':true});
$location.path('/tasks');
$timeout(Guide.initTour);
Guide.goto('intro', 0, true);
}

$scope.showClassesTour = function(){
Guide.classesTour();
Guide.goto('classes', 0, true);
}

$scope.showBailey = function(){
Expand Down
8 changes: 6 additions & 2 deletions website/public/js/controllers/tasksCtrl.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";

habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','Notification', '$http', 'ApiUrl', '$timeout', 'Shared',
function($scope, $rootScope, $location, User, Notification, $http, ApiUrl, $timeout, Shared) {
habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','Notification', '$http', 'ApiUrl', '$timeout', 'Shared', 'Guide',
function($scope, $rootScope, $location, User, Notification, $http, ApiUrl, $timeout, Shared, Guide) {
$scope.obj = User.user; // used for task-lists
$scope.user = User.user;

Expand All @@ -15,6 +15,7 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
break;
case 'todo':
$rootScope.playSound('ToDo');
Guide.goto('intro', 1);
break;
default:
if (direction === 'down') $rootScope.playSound('Minus_Habit');
Expand Down Expand Up @@ -46,6 +47,7 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
}
delete listDef.newTask;
delete listDef.focus;
if (listDef.type=='daily') Guide.goto('intro', 2);
};

$scope.toggleBulk = function(list) {
Expand Down Expand Up @@ -92,6 +94,7 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
if (!stayOpen) task._editing = false;
if (isSaveAndClose)
$("#task-" + task.id).parent().children('.popover').removeClass('in');
if (task.type == 'habit') Guide.goto('intro', 3);
};

/**
Expand Down Expand Up @@ -194,6 +197,7 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
$scope.buy = function(item) {
User.user.ops.buy({params:{key:item.key}});
$rootScope.playSound('Reward');
Guide.goto('intro', 4);
};


Expand Down
3 changes: 1 addition & 2 deletions website/public/js/controllers/userCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ habitrpg.controller("UserCtrl", ['$rootScope', '$scope', '$location', 'User', '$
User.user.ops.changeClass({query:{class:klass}});
$scope.selectedClass = undefined;
Shared.updateStore(User.user);
$state.go('options.profile.stats');
window.setTimeout(Guide.classesTour, 10);
Guide.goto('classes', 0,true);
}

$scope.save = function(){
Expand Down
Loading

0 comments on commit de67f44

Please sign in to comment.