mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Add functionality to dequip all Battle Gear or Cosutme.
This commit is contained in:
@@ -234,16 +234,25 @@ habitrpg.controller("InventoryCtrl",
|
|||||||
return filteredArray;
|
return filteredArray;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.dequip = function(){
|
$scope.dequip = function(gearSet){
|
||||||
|
|
||||||
for ( item in user.items.gear.equipped ){
|
if ( gearSet == "battleGear" ) {
|
||||||
var itemKey = user.items.gear.equipped[item];
|
for ( item in user.items.gear.equipped ){
|
||||||
if ( user.items.gear.owned[itemKey] ) {
|
var itemKey = user.items.gear.equipped[item];
|
||||||
user.ops.equip({params: {key: itemKey}});
|
if ( user.items.gear.owned[itemKey] ) {
|
||||||
|
user.ops.equip({params: {key: itemKey}});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
user.preferences.background = "";
|
if ( gearSet == "costume" ) {
|
||||||
|
for ( item in user.items.gear.costume ){
|
||||||
|
var itemKey = user.items.gear.costume[item];
|
||||||
|
if ( user.items.gear.owned[itemKey] ) {
|
||||||
|
user.ops.equip({params: {type:"costume", key: itemKey}});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ 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();')
|
div(ng-click='dequip("battleGear");')
|
||||||
button {{env.t("dequipAll")}}
|
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]')
|
||||||
@@ -16,6 +16,8 @@ script(type='text/ng-template', id='partials/options.inventory.equipment.html')
|
|||||||
input(type="checkbox", ng-model="user.preferences.costume", ng-change='set({"preferences.costume":user.preferences.costume ? true : false})')
|
input(type="checkbox", ng-model="user.preferences.costume", ng-change='set({"preferences.costume":user.preferences.costume ? true : false})')
|
||||||
|
|
|
|
||||||
=env.t('useCostume')
|
=env.t('useCostume')
|
||||||
|
div(ng-click='dequip("costume");')
|
||||||
|
button {{env.t("dequipAll")}}
|
||||||
li.customize-menu(ng-if='user.preferences.costume')
|
li.customize-menu(ng-if='user.preferences.costume')
|
||||||
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]')
|
||||||
|
|||||||
Reference in New Issue
Block a user