diff --git a/common/locales/en/character.json b/common/locales/en/character.json index 21afe00c9b..688131c945 100644 --- a/common/locales/en/character.json +++ b/common/locales/en/character.json @@ -133,5 +133,6 @@ "critBonus": "Critical Hit! Bonus: ", "displayNameDescription1": "This is what appears in messages you post in the Tavern, guilds, and party chat, along with what is displayed on your avatar. Go to", "displayNameDescription2": "Settings->Site", - "displayNameDescription3": "and scroll down to the Registration section to change your login name." + "displayNameDescription3": "and scroll down to the Registration section to change your login name.", + "dequipAll": "Dequip All" } diff --git a/website/public/js/controllers/inventoryCtrl.js b/website/public/js/controllers/inventoryCtrl.js index 219c8618e0..07c64f8750 100644 --- a/website/public/js/controllers/inventoryCtrl.js +++ b/website/public/js/controllers/inventoryCtrl.js @@ -1,4 +1,4 @@ -habitrpg.controller("InventoryCtrl", +habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', 'Shared', '$window', 'User', 'Content', function($rootScope, $scope, Shared, $window, User, Content) { @@ -88,7 +88,7 @@ habitrpg.controller("InventoryCtrl", $rootScope.petCount = Shared.countPets($rootScope.countExists(User.user.items.pets), User.user.items.pets); // Checks if beastmaster has been reached for the first time - if(!User.user.achievements.beastMaster + if(!User.user.achievements.beastMaster && $rootScope.petCount >= 90) { User.user.achievements.beastMaster = true; $rootScope.openModal('achievements/beastMaster'); @@ -143,7 +143,7 @@ habitrpg.controller("InventoryCtrl", $rootScope.mountCount = Shared.countMounts($rootScope.countExists(User.user.items.mounts), User.user.items.mounts); // Checks if mountmaster has been reached for the first time - if(!User.user.achievements.mountMaster + if(!User.user.achievements.mountMaster && $rootScope.mountCount >= 90) { User.user.achievements.mountMaster = true; $rootScope.openModal('achievements/mountMaster'); @@ -215,23 +215,36 @@ habitrpg.controller("InventoryCtrl", $rootScope.selectedQuest = item; $rootScope.openModal('buyQuest', {controller:'InventoryCtrl'}); } - + $scope.getSeasonalShopArray = function(set){ var flatGearArray = _.toArray(Content.gear.flat); - + var filteredArray = _.where(flatGearArray, {index: set}); return filteredArray; }; - + $scope.getSeasonalShopQuests = function(set){ var questArray = _.toArray(Content.quests); - + var filteredArray = _.filter(questArray, function(q){ return q.key == "evilsanta" || q.key == "evilsanta2"; }); return filteredArray; }; + + $scope.dequip = function(){ + + for ( item in user.items.gear.equipped ){ + var itemKey = user.items.gear.equipped[item]; + if ( user.items.gear.owned[itemKey] ) { + user.ops.equip({params: {key: itemKey}}); + } + } + + user.preferences.background = ""; + + } } ]); diff --git a/website/views/options/inventory/inventory.jade b/website/views/options/inventory/inventory.jade index ea94c8828d..e890695c04 100644 --- a/website/views/options/inventory/inventory.jade +++ b/website/views/options/inventory/inventory.jade @@ -3,6 +3,8 @@ script(type='text/ng-template', id='partials/options.inventory.equipment.html') .row .col-md-6.border-right h3.equipment-title.hint(popover-trigger='mouseenter', popover-placement='top', popover-append-to-body='true', popover=env.t('battleGearText'))=env.t('battleGear') + div(ng-click='dequip();') + button {{env.t("dequipAll")}} li.customize-menu.inventory-gear menu.pets-menu(label='{{::label}}', ng-repeat='(klass,label) in {warrior:env.t("warrior"), wizard:env.t("mage"), rogue:env.t("rogue"), healer:env.t("healer"), special:env.t("special"), mystery:env.t("mystery")}', ng-show='gear[klass]') div(ng-repeat='item in gear[klass]') @@ -35,7 +37,7 @@ script(type='text/ng-template', id='partials/options.inventory.seasonalshop.html li.customize-menu.inventory-gear menu.pets-menu(label='{{::label}}', ng-repeat='(set,label) in ::{candycane:env.t("candycaneSet"), ski:env.t("skiSet"), snowflake:env.t("snowflakeSet"), yeti:env.t("yetiSet")}') // The `if true || false` conditional for applying the transparent class is necessary because - // when a user activates the orb of rebirth, the seasonal items are still in their inventory, but + // when a user activates the orb of rebirth, the seasonal items are still in their inventory, but // they have each have a value of false. The item can be purchased for gold in the rewards column, // not the seasonal shop. This makes that more clear. div(ng-repeat='item in ::getSeasonalShopArray(set)' ng-class="{transparent: user.items.gear.owned[item.key] === true ||user.items.gear.owned[item.key] === false}") @@ -248,4 +250,4 @@ script(type='text/ng-template', id='partials/options.inventory.drops.html') button.customize-option(popover='{{::Content.spells.special.valentine.notes()}}', popover-title='{{::Content.spells.special.valentine.text()}}', popover-trigger='mouseenter', popover-placement='right', popover-append-to-body='true', ng-click='castStart(Content.spells.special.valentine)', class='inventory_special_valentine') p | {{Content.spells.special.valentine.value}} - span(class='shop_gold') \ No newline at end of file + span(class='shop_gold')