mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
Added icons to Notification for the item that is dropped.
This commit is contained in:
@@ -73,15 +73,15 @@ habitrpg.controller('NotificationCtrl',
|
||||
if(after.type === 'HatchingPotion'){
|
||||
var text = Content.hatchingPotions[after.key].text();
|
||||
var notes = Content.hatchingPotions[after.key].notes();
|
||||
Notification.drop(env.t('messageDropPotion', {dropText: text, dropNotes: notes}));
|
||||
Notification.drop(env.t('messageDropPotion', {dropText: text, dropNotes: notes}), after);
|
||||
}else if(after.type === 'Egg'){
|
||||
var text = Content.eggs[after.key].text();
|
||||
var notes = Content.eggs[after.key].notes();
|
||||
Notification.drop(env.t('messageDropEgg', {dropText: text, dropNotes: notes}));
|
||||
Notification.drop(env.t('messageDropEgg', {dropText: text, dropNotes: notes}), after);
|
||||
}else if(after.type === 'Food'){
|
||||
var text = Content.food[after.key].text();
|
||||
var notes = Content.food[after.key].notes();
|
||||
Notification.drop(env.t('messageDropFood', {dropArticle: after.article, dropText: text, dropNotes: notes}));
|
||||
Notification.drop(env.t('messageDropFood', {dropArticle: after.article, dropText: text, dropNotes: notes}), after);
|
||||
}else{
|
||||
// Keep support for another type of drops that might be added
|
||||
Notification.drop(User.user._tmp.drop.dialog);
|
||||
|
||||
@@ -77,8 +77,24 @@ angular.module("habitrpg").factory("Notification",
|
||||
streak: function(val) {
|
||||
notify(window.env.t('streakName') + ': ' + val, 'streak', 'glyphicon glyphicon-repeat');
|
||||
},
|
||||
drop: function(val) {
|
||||
notify(val, 'drop', 'glyphicon glyphicon-gift');
|
||||
drop: function(val, item) {
|
||||
if ( item !== undefined ) {
|
||||
var dropClass = "";
|
||||
switch ( item.type ) {
|
||||
case "Egg":
|
||||
dropClass = 'Pet_Egg_' + item.key;
|
||||
break;
|
||||
case "HatchingPotion":
|
||||
dropClass = 'Pet_Hatching' + item.key;
|
||||
break;
|
||||
case "Food":
|
||||
dropClass = 'Pet_Food_' + item.key;
|
||||
break;
|
||||
default:
|
||||
dropClass = 'glyphicon glyphicon-gift';
|
||||
}
|
||||
}
|
||||
notify(val, 'drop', dropClass);
|
||||
}
|
||||
};
|
||||
}]);
|
||||
|
||||
Reference in New Issue
Block a user