Added dequip ability per ticket: 3730

This commit is contained in:
kholliday
2015-03-04 21:43:17 -06:00
parent 90fe516562
commit f28bc31a2c
3 changed files with 26 additions and 10 deletions

View File

@@ -133,5 +133,6 @@
"critBonus": "Critical Hit! Bonus: ", "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", "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", "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"
} }

View File

@@ -1,4 +1,4 @@
habitrpg.controller("InventoryCtrl", habitrpg.controller("InventoryCtrl",
['$rootScope', '$scope', 'Shared', '$window', 'User', 'Content', ['$rootScope', '$scope', 'Shared', '$window', 'User', 'Content',
function($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); $rootScope.petCount = Shared.countPets($rootScope.countExists(User.user.items.pets), User.user.items.pets);
// Checks if beastmaster has been reached for the first time // Checks if beastmaster has been reached for the first time
if(!User.user.achievements.beastMaster if(!User.user.achievements.beastMaster
&& $rootScope.petCount >= 90) { && $rootScope.petCount >= 90) {
User.user.achievements.beastMaster = true; User.user.achievements.beastMaster = true;
$rootScope.openModal('achievements/beastMaster'); $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); $rootScope.mountCount = Shared.countMounts($rootScope.countExists(User.user.items.mounts), User.user.items.mounts);
// Checks if mountmaster has been reached for the first time // Checks if mountmaster has been reached for the first time
if(!User.user.achievements.mountMaster if(!User.user.achievements.mountMaster
&& $rootScope.mountCount >= 90) { && $rootScope.mountCount >= 90) {
User.user.achievements.mountMaster = true; User.user.achievements.mountMaster = true;
$rootScope.openModal('achievements/mountMaster'); $rootScope.openModal('achievements/mountMaster');
@@ -215,23 +215,36 @@ habitrpg.controller("InventoryCtrl",
$rootScope.selectedQuest = item; $rootScope.selectedQuest = item;
$rootScope.openModal('buyQuest', {controller:'InventoryCtrl'}); $rootScope.openModal('buyQuest', {controller:'InventoryCtrl'});
} }
$scope.getSeasonalShopArray = function(set){ $scope.getSeasonalShopArray = function(set){
var flatGearArray = _.toArray(Content.gear.flat); var flatGearArray = _.toArray(Content.gear.flat);
var filteredArray = _.where(flatGearArray, {index: set}); var filteredArray = _.where(flatGearArray, {index: set});
return filteredArray; return filteredArray;
}; };
$scope.getSeasonalShopQuests = function(set){ $scope.getSeasonalShopQuests = function(set){
var questArray = _.toArray(Content.quests); var questArray = _.toArray(Content.quests);
var filteredArray = _.filter(questArray, function(q){ var filteredArray = _.filter(questArray, function(q){
return q.key == "evilsanta" || q.key == "evilsanta2"; return q.key == "evilsanta" || q.key == "evilsanta2";
}); });
return filteredArray; 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 = "";
}
} }
]); ]);

View File

@@ -3,6 +3,8 @@ script(type='text/ng-template', id='partials/options.inventory.equipment.html')
.row .row
.col-md-6.border-right .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') 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 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]') 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]') 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 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")}') 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 // 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, // 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. // 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}") 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') 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 p
| {{Content.spells.special.valentine.value}} | {{Content.spells.special.valentine.value}}
span(class='shop_gold') span(class='shop_gold')