add streak achievement notification

This commit is contained in:
Matteo Pagliazzi 2013-10-23 17:57:02 +02:00
parent f56b76b5ae
commit 20f2d75bbf
3 changed files with 9 additions and 3 deletions

View file

@ -32,6 +32,11 @@ habitrpg.controller('NotificationCtrl',
$rootScope.modals.drop = true;
});
$rootScope.$watch('user.achievements.streak', function(after, before){
if(after == before || after < before) return;
$rootScope.modals.achievements.streak = true;
});
// FIXME: this isn't working for some reason
/*_.each(['weapon', 'head', 'chest', 'shield'], function(watched){
$rootScope.$watch('user.items.' + watched, function(before, after){

View file

@ -6,6 +6,7 @@
habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$http',
function($scope, $rootScope, $location, User, $http) {
$rootScope.modals = {};
$rootScope.modals.achievements = {};
$rootScope.User = User;
$rootScope.user = User.user;
$rootScope.settings = User.settings;

View file

@ -7,7 +7,7 @@ div(modal='modals.achievements.streak')
.achievement.achievement-thermometer
| You have stacked your "Streaker" Achievement! Every 21 days of streak, you gain 1 achievement point here.
.modal-footer
button.btn.btn-default.cancel(ng-click='modals.modals.streakAchievement = false') Cancel
button.btn.btn-default.cancel(ng-click='modals.achievements.streak = false') Cancel
// Max Gear
div(modal='modals.achievements.maxGear')
@ -17,7 +17,7 @@ div(modal='modals.achievements.maxGear')
.achievement.achievement-armor
| You have earned the "Ultimate Gear" Achievement for upgrading to the maximum gear set!
.modal-footer
button.btn.btn-default.cancel(ng-click='modals.modals.streakAchievement = false') Cancel
button.btn.btn-default.cancel(ng-click='modals.achievements.maxGear = false') Cancel
// Beast Master
div(modal='modals.achievements.beastmaster')
@ -28,6 +28,6 @@ div(modal='modals.achievements.beastmaster')
.achievement.achievement-rat
| You have earned the "Beast Master" Achievement for collecting all the pets!
.modal-footer
button.btn.btn-default.cancel(ng-click='modals.modals.beastMaster = false') Cancel
button.btn.btn-default.cancel(ng-click='modals.achievements.beastmaster = false') Cancel