mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
@@ -357,6 +357,34 @@ habitrpg.controller("InventoryCtrl",
|
|||||||
$scope.timeTravelersCategories = Shared.shops.getTimeTravelersCategories(user);
|
$scope.timeTravelersCategories = Shared.shops.getTimeTravelersCategories(user);
|
||||||
$scope.seasonalShopCategories = Shared.shops.getSeasonalShopCategories(user);
|
$scope.seasonalShopCategories = Shared.shops.getSeasonalShopCategories(user);
|
||||||
|
|
||||||
|
$scope.shouldShowPremiumPetRow = function (potion) {
|
||||||
|
potion = Content.premiumHatchingPotions[potion];
|
||||||
|
|
||||||
|
if (!potion) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (user.items.hatchingPotions[potion.key] > 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (potion.canBuy()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var pets = Object.keys(user.items.pets);
|
||||||
|
var hasAPetOfPotion = pets.find(function (pet) {
|
||||||
|
return pet.indexOf(potion.key) !== -1;
|
||||||
|
});
|
||||||
|
|
||||||
|
return hasAPetOfPotion;
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.shouldShowPremiumPetSection = function () {
|
||||||
|
var potions = Content.premiumHatchingPotions;
|
||||||
|
return Object.keys(potions).find(function (potion) {
|
||||||
|
return $scope.shouldShowPremiumPetRow(potions[potion].key);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
function _updateDropAnimalCount(items) {
|
function _updateDropAnimalCount(items) {
|
||||||
$scope.petCount = Shared.count.beastMasterProgress(items.pets);
|
$scope.petCount = Shared.count.beastMasterProgress(items.pets);
|
||||||
$scope.mountCount = Shared.count.mountMasterProgress(items.mounts);
|
$scope.mountCount = Shared.count.mountMasterProgress(items.mounts);
|
||||||
|
|||||||
@@ -25,11 +25,11 @@ mixin petList(eggSource, potionSource)
|
|||||||
h4 {{:: env.t('stableBeastMasterProgress', { number: beastMasterProgress }) }}
|
h4 {{:: env.t('stableBeastMasterProgress', { number: beastMasterProgress }) }}
|
||||||
.row: .col-md-12
|
.row: .col-md-12
|
||||||
+petList(env.Content.dropEggs,env.Content.dropHatchingPotions)
|
+petList(env.Content.dropEggs,env.Content.dropHatchingPotions)
|
||||||
.row: .col-md-12
|
.row(ng-if="::shouldShowPremiumPetSection()"): .col-md-12
|
||||||
h4=env.t('magicPets')
|
h4=env.t('magicPets')
|
||||||
menu.pets(type='list')
|
menu.pets(type='list')
|
||||||
each potion in env.Content.premiumHatchingPotions
|
each potion in env.Content.premiumHatchingPotions
|
||||||
li.customize-menu
|
li.customize-menu(ng-if="::shouldShowPremiumPetRow('#{potion.key}')")
|
||||||
menu
|
menu
|
||||||
each egg in env.Content.dropEggs
|
each egg in env.Content.dropEggs
|
||||||
- pet = egg.key+"-"+potion.key
|
- pet = egg.key+"-"+potion.key
|
||||||
|
|||||||
Reference in New Issue
Block a user