Fix #2072 (add Mana delta alerts)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -65,6 +65,9 @@ angular.module("notificationServices", [])
|
||||
},
|
||||
error: function(error){
|
||||
growl("<i class='icon-exclamation-sign'></i> " + error, "error");
|
||||
},
|
||||
mp: function(val) {
|
||||
growl("<i class='icon-fire'></i> " + sign(val) + " " + round(val) + " MP", 'mp');
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user