mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-27 05:29:59 +00:00
Moved the beastMaster modal alert from notifications to inside the hatching function
This commit is contained in:
parent
e1494b3860
commit
9b82da064f
2 changed files with 7 additions and 11 deletions
|
|
@ -85,6 +85,13 @@ habitrpg.controller("InventoryCtrl",
|
|||
user.ops.hatch({params:{egg:egg.key, hatchingPotion:potion.key}});
|
||||
$scope.selectedEgg = null;
|
||||
$scope.selectedPotion = null;
|
||||
|
||||
// Checks if beastmaster has been reached for the first time
|
||||
if(!User.user.achievements.beastMaster
|
||||
&& Shared.countPets(null, User.user.items.pets) >= 90) {
|
||||
User.user.achievements.beastMaster = true;
|
||||
$rootScope.openModal('achievements/beastMaster');
|
||||
}
|
||||
}
|
||||
|
||||
$scope.purchase = function(type, item){
|
||||
|
|
|
|||
|
|
@ -104,17 +104,6 @@ habitrpg.controller('NotificationCtrl',
|
|||
$rootScope.openModal('achievements/ultimateGear');
|
||||
});
|
||||
|
||||
// Watches number of pets and displays beastMaster modal when 90 are found
|
||||
$rootScope.$watch('user.items.pets', function(after, before){
|
||||
if(_.size(after) === _.size(before) ||
|
||||
Shared.countPets(null, after) < 90) return;
|
||||
if (User.user.achievements.beastMaster == undefined) {
|
||||
User.user.achievements.beastMaster = true;
|
||||
$rootScope.openModal('achievements/beastMaster');
|
||||
}
|
||||
}, true);
|
||||
|
||||
|
||||
// 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) ||
|
||||
|
|
|
|||
Loading…
Reference in a new issue