[#1394] add drop notifications back in

This commit is contained in:
Tyler Renelle
2013-09-17 12:16:16 -04:00
parent 9d633eceaf
commit f26b0a2cf5
5 changed files with 15 additions and 7 deletions

View File

@@ -33,6 +33,11 @@ habitrpg.controller('NotificationCtrl',
} }
}); });
$rootScope.$watch('user._tmp.drop', function(after, before){
if (after == before || !after) return;
$rootScope.modals.drop = true;
});
// FIXME: this isn't working for some reason // FIXME: this isn't working for some reason
/*_.each(['weapon', 'head', 'chest', 'shield'], function(watched){ /*_.each(['weapon', 'head', 'chest', 'shield'], function(watched){
$rootScope.$watch('user.items.' + watched, function(before, after){ $rootScope.$watch('user.items.' + watched, function(before, after){

View File

@@ -712,6 +712,7 @@ api.batchUpdate = function(req, res, next) {
} }
response = user.toJSON(); response = user.toJSON();
response.wasModified = res.locals.wasModified; response.wasModified = res.locals.wasModified;
if (response._tmp && response._tmp.drop) response.wasModified = true;
res.json(200, response); res.json(200, response);
return console.log("Reply sent"); return console.log("Reply sent");
}); });

View File

@@ -240,6 +240,7 @@ UserSchema.methods.toJSON = function() {
//}); //});
//delete doc.tasks //delete doc.tasks
doc.filters = {}; doc.filters = {};
doc._tmp = this._tmp; // be sure to send down drop notifs
return doc; return doc;
}; };

View File

@@ -6,4 +6,5 @@ include ./new-stuff
include ./why-ads include ./why-ads
include ./more-gems include ./more-gems
include ./members include ./members
include ./settings include ./settings
include ./pets

View File

@@ -1,21 +1,21 @@
div(modal='modals.pets.dropsEnabled') div(modal='modals.dropsEnabled')
.modal-header .modal-header
h3 Drops Enabled! h3 Drops Enabled!
.modal-body .modal-body
p p
span.item-drop-icon(ng-class='Pet_Egg_{{user.items.eggs.0.name}}') span.item-drop-icon(class='Pet_Egg_{{user.items.eggs.0.name}}')
| You've unlocked the Drop System! Now when you complete tasks, you have a small chance of finding an item. And guess what, you just found a | You've unlocked the Drop System! Now when you complete tasks, you have a small chance of finding an item. And guess what, you just found a
strong {{user.items.eggs.0.text}} egg strong {{user.items.eggs.0.text}} egg
| ! {{user.items.eggs.0.notes}} | ! {{user.items.eggs.0.notes}}
.modal-footer .modal-footer
button.btn.btn-default.cancel(ng-click='modals.pets.dropsEnabled=false') Close button.btn.btn-default.cancel(ng-click='modals.pets.dropsEnabled=false') Close
div(modal='modals.pets.itemDropped') div(modal='modals.drop')
.modal-header .modal-header
h3 An item has dropped! h3 An item has dropped!
.modal-body .modal-body
p p
span.item-drop-icon(ng-class='Pet_{{_drop.type}}_{{_drop.name}}') span.item-drop-icon(class='Pet_{{user._tmp.drop.type}}_{{user._tmp.drop.name}}')
| {{_drop.dialog}} | {{user._tmp.drop.dialog}}
.modal-footer .modal-footer
button.btn.btn-default.cancel(ng-click='modals.pets.itemDropped=false') Close button.btn.btn-default.cancel(ng-click='modals.drop = false') Close