mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
[#1394] add drop notifications back in
This commit is contained in:
@@ -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
|
||||
/*_.each(['weapon', 'head', 'chest', 'shield'], function(watched){
|
||||
$rootScope.$watch('user.items.' + watched, function(before, after){
|
||||
|
||||
@@ -712,6 +712,7 @@ api.batchUpdate = function(req, res, next) {
|
||||
}
|
||||
response = user.toJSON();
|
||||
response.wasModified = res.locals.wasModified;
|
||||
if (response._tmp && response._tmp.drop) response.wasModified = true;
|
||||
res.json(200, response);
|
||||
return console.log("Reply sent");
|
||||
});
|
||||
|
||||
@@ -240,6 +240,7 @@ UserSchema.methods.toJSON = function() {
|
||||
//});
|
||||
//delete doc.tasks
|
||||
doc.filters = {};
|
||||
doc._tmp = this._tmp; // be sure to send down drop notifs
|
||||
|
||||
return doc;
|
||||
};
|
||||
|
||||
@@ -7,3 +7,4 @@ include ./why-ads
|
||||
include ./more-gems
|
||||
include ./members
|
||||
include ./settings
|
||||
include ./pets
|
||||
@@ -1,21 +1,21 @@
|
||||
div(modal='modals.pets.dropsEnabled')
|
||||
div(modal='modals.dropsEnabled')
|
||||
.modal-header
|
||||
h3 Drops Enabled!
|
||||
.modal-body
|
||||
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
|
||||
strong {{user.items.eggs.0.text}} egg
|
||||
| ! {{user.items.eggs.0.notes}}
|
||||
.modal-footer
|
||||
button.btn.btn-default.cancel(ng-click='modals.pets.dropsEnabled=false') Close
|
||||
|
||||
div(modal='modals.pets.itemDropped')
|
||||
div(modal='modals.drop')
|
||||
.modal-header
|
||||
h3 An item has dropped!
|
||||
.modal-body
|
||||
p
|
||||
span.item-drop-icon(ng-class='Pet_{{_drop.type}}_{{_drop.name}}')
|
||||
| {{_drop.dialog}}
|
||||
span.item-drop-icon(class='Pet_{{user._tmp.drop.type}}_{{user._tmp.drop.name}}')
|
||||
| {{user._tmp.drop.dialog}}
|
||||
.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
|
||||
Reference in New Issue
Block a user