From d9661cf089b5f6f8283024d7cb400eec0309e341 Mon Sep 17 00:00:00 2001 From: Alice Harris Date: Thu, 11 Sep 2014 17:59:37 +1000 Subject: [PATCH] hide Plain Egg mounts and remove them from the totalMounts count --- public/js/controllers/inventoryCtrl.js | 2 +- views/options/inventory/stable.jade | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/public/js/controllers/inventoryCtrl.js b/public/js/controllers/inventoryCtrl.js index b8be82e0a4..ce38e504fb 100644 --- a/public/js/controllers/inventoryCtrl.js +++ b/public/js/controllers/inventoryCtrl.js @@ -8,7 +8,7 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', '$window', 'User', $scope.selectedEgg = null; // {index: 1, name: "Tiger", value: 5} $scope.selectedPotion = null; // {index: 5, name: "Red", value: 3} $scope.totalPets = _.size(Content.dropEggs) * _.size(Content.hatchingPotions); - $scope.totalMounts = _.size(Content.eggs) * _.size(Content.hatchingPotions); + $scope.totalMounts = _.size(_.reject(Content.eggs,function(egg){return egg.noMount})) * _.size(Content.hatchingPotions); // count egg, food, hatchingPotion stack totals var countStacks = function(items) { return _.reduce(items,function(m,v){return m+v;},0);} diff --git a/views/options/inventory/stable.jade b/views/options/inventory/stable.jade index d23bd31524..acb974fde4 100644 --- a/views/options/inventory/stable.jade +++ b/views/options/inventory/stable.jade @@ -14,15 +14,17 @@ script(type='text/ng-template', id='partials/options.inventory.mounts.html') .col-md-12 menu.pets(type='list') each egg in env.Content.eggs - li.customize-menu - menu - each potion in env.Content.hatchingPotions - - mount = egg.key+"-"+potion.key - div(popover-trigger='mouseenter', popover=env.t('mountName', {potion: potion.text(env.language.code), mount: egg.mountText(env.language.code)}), popover-placement='bottom') - button(class="pet-button Mount_Head_#{mount}", ng-show='user.items.mounts["#{mount}"]', ng-class='{active: user.items.currentMount == "#{mount}"}', ng-click='chooseMount("#{egg.key}", "#{potion.key}")') - //div(class='Mount_Head_{{mount}}') - button(class="pet-button pet-not-owned", ng-hide='user.items.mounts["#{mount}"]') - .PixelPaw + -if(!egg.noMount) { + li.customize-menu + menu + each potion in env.Content.hatchingPotions + - mount = egg.key+"-"+potion.key + div(popover-trigger='mouseenter', popover=env.t('mountName', {potion: potion.text(env.language.code), mount: egg.mountText(env.language.code)}), popover-placement='bottom') + button(class="pet-button Mount_Head_#{mount}", ng-show='user.items.mounts["#{mount}"]', ng-class='{active: user.items.currentMount == "#{mount}"}', ng-click='chooseMount("#{egg.key}", "#{potion.key}")') + //div(class='Mount_Head_{{mount}}') + button(class="pet-button pet-not-owned", ng-hide='user.items.mounts["#{mount}"]') + .PixelPaw + -} .col-md-12 h4=env.t('rareMounts') menu