Added icons to Notification for the item that is dropped.

This commit is contained in:
kholliday
2015-03-24 16:28:24 -05:00
parent 98220ed0e5
commit a7873a41a1
2 changed files with 21 additions and 5 deletions

View File

@@ -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);

View File

@@ -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);
}
};
}]);