mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
re-add the dequip option for removing backgrounds with proper bug fix (ref 9199c6c7e2); make whitespace consistent
This commit is contained in:
@@ -136,5 +136,5 @@
|
|||||||
"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.",
|
||||||
"unequipBattleGear": "Unequip Battle Gear",
|
"unequipBattleGear": "Unequip Battle Gear",
|
||||||
"unequipCostume": "Unequip Costume",
|
"unequipCostume": "Unequip Costume",
|
||||||
"unequipPetMountBackground": "Unequip Pet, Mount"
|
"unequipPetMountBackground": "Unequip Pet, Mount, Background"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -235,46 +235,43 @@ habitrpg.controller("InventoryCtrl",
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.dequip = function(itemSet){
|
$scope.dequip = function(itemSet){
|
||||||
|
|
||||||
switch (itemSet) {
|
switch (itemSet) {
|
||||||
case "battleGear":
|
case "battleGear":
|
||||||
for ( item in user.items.gear.equipped ){
|
for (item in user.items.gear.equipped){
|
||||||
var itemKey = user.items.gear.equipped[item];
|
var itemKey = user.items.gear.equipped[item];
|
||||||
if ( user.items.gear.owned[itemKey] ) {
|
if (user.items.gear.owned[itemKey]) {
|
||||||
user.ops.equip({params: {key: itemKey}});
|
user.ops.equip({params: {key: itemKey}});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "costume":
|
case "costume":
|
||||||
for ( item in user.items.gear.costume ){
|
for (item in user.items.gear.costume){
|
||||||
var itemKey = user.items.gear.costume[item];
|
var itemKey = user.items.gear.costume[item];
|
||||||
if ( user.items.gear.owned[itemKey] ) {
|
if (user.items.gear.owned[itemKey]) {
|
||||||
user.ops.equip({params: {type:"costume", key: itemKey}});
|
user.ops.equip({params: {type:"costume", key: itemKey}});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "petMountBackground":
|
case "petMountBackground":
|
||||||
|
|
||||||
var pet = user.items.currentPet;
|
var pet = user.items.currentPet;
|
||||||
if ( pet ) {
|
if (pet) {
|
||||||
user.ops.equip({params:{type: 'pet', key: pet}});
|
user.ops.equip({params:{type: 'pet', key: pet}});
|
||||||
}
|
}
|
||||||
|
|
||||||
var mount = user.items.currentMount;
|
var mount = user.items.currentMount;
|
||||||
if ( mount ) {
|
if (mount) {
|
||||||
user.ops.equip({params:{type: 'mount', key: mount}});
|
user.ops.equip({params:{type: 'mount', key: mount}});
|
||||||
}
|
}
|
||||||
|
|
||||||
// var background = user.preferences.background;
|
var background = user.preferences.background;
|
||||||
// User.user.ops.unlock({query:{path:"background."+background}});
|
if (background) {
|
||||||
// commented out until we fix this bug:
|
User.user.ops.unlock({query:{path:"background."+background}});
|
||||||
// https://github.com/HabitRPG/habitrpg/issues/4857#issuecomment-80722868
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user