mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-03 04:29:40 +00:00
Moved mountMaster watch to feeding function
This commit is contained in:
parent
9b82da064f
commit
6441888d3f
2 changed files with 7 additions and 10 deletions
|
|
@ -132,6 +132,13 @@ habitrpg.controller("InventoryCtrl",
|
|||
User.user.ops.feed({params:{pet: pet, food: food.key}});
|
||||
$scope.selectedFood = null;
|
||||
|
||||
// Checks if mountmaster has been reached for the first time
|
||||
if(!User.user.achievements.mountMaster
|
||||
&& Shared.countMounts(null, User.user.items.mounts) >= 90) {
|
||||
User.user.achievements.mountMaster = true;
|
||||
$rootScope.openModal('achievements/mountMaster');
|
||||
}
|
||||
|
||||
// Selecting Pet
|
||||
} else {
|
||||
User.user.ops.equip({params:{type: 'pet', key: pet}});
|
||||
|
|
|
|||
|
|
@ -104,16 +104,6 @@ habitrpg.controller('NotificationCtrl',
|
|||
$rootScope.openModal('achievements/ultimateGear');
|
||||
});
|
||||
|
||||
// Watches number of mounts and displays mountMaster modal when 90 are raised
|
||||
$rootScope.$watch('user.items.mounts', function(after, before){
|
||||
if(_.size(after) === _.size(before) ||
|
||||
Shared.countMounts(null, after) < 90) return;
|
||||
if (User.user.achievements.mountMaster == undefined) {
|
||||
User.user.achievements.mountMaster = true;
|
||||
$rootScope.openModal('achievements/mountMaster');
|
||||
}
|
||||
}, true);
|
||||
|
||||
$rootScope.$watch('user.achievements.rebirths', function(after, before){
|
||||
if(after === before) return;
|
||||
$rootScope.openModal('achievements/rebirth');
|
||||
|
|
|
|||
Loading…
Reference in a new issue