diff --git a/public/css/alerts.styl b/public/css/alerts.styl
index 1054938f0a..ceefaf3926 100644
--- a/public/css/alerts.styl
+++ b/public/css/alerts.styl
@@ -28,6 +28,8 @@ xpColor = #DCC0FB
xpText = #635673
deathColor = #4E4E4E
deathText = #ABABAB
+mpColor = #c7d3e9
+mpText = #003aa1
borderDarken = 20%
// alert styles
@@ -57,6 +59,11 @@ borderDarken = 20%
border-color: deathColor
color: deathText
+.alert-mp
+ background-color: mpColor
+ border-color: darken(mpColor,borderDarken)
+ color: mpText
+
// alert icons
.icon-gold
diff --git a/public/js/controllers/notificationCtrl.js b/public/js/controllers/notificationCtrl.js
index 6c3d7ede2a..ae227d51f6 100644
--- a/public/js/controllers/notificationCtrl.js
+++ b/public/js/controllers/notificationCtrl.js
@@ -31,6 +31,13 @@ habitrpg.controller('NotificationCtrl',
}
});
+ $rootScope.$watch('user.stats.mp', function(after,before) {
+ if (after == before) return;
+ if (User.user.stats.lvl == 0) return;
+ var mana = after - before;
+ Notification.mp(mana);
+ });
+
$rootScope.$watch('user._tmp.drop', function(after, before){
// won't work when getting the same item twice?
if (after == before || !after) return;
diff --git a/public/js/services/notificationServices.js b/public/js/services/notificationServices.js
index ff60c2e61c..c55acfa90b 100644
--- a/public/js/services/notificationServices.js
+++ b/public/js/services/notificationServices.js
@@ -65,6 +65,9 @@ angular.module("notificationServices", [])
},
error: function(error){
growl(" " + error, "error");
+ },
+ mp: function(val) {
+ growl(" " + sign(val) + " " + round(val) + " MP", 'mp');
}
};
}