mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-01 11:40:25 +00:00
Merge pull request #2123 from HabitRPG/sabe/tweak3
Fix #2072 (add Mana delta alerts)
This commit is contained in:
commit
13e1792685
3 changed files with 17 additions and 0 deletions
|
|
@ -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');
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue