mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Added ability to remove pet, mount, and background. Also, changed text for all dequip buttons.
This commit is contained in:
@@ -134,5 +134,7 @@
|
|||||||
"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"
|
"unequipBattleGear": "Unequip Battle Gear",
|
||||||
|
"unequipCostume": "Unequip Costume",
|
||||||
|
"unequipPetMountBackground": "Unequip Pet, Mount, Background"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -234,24 +234,43 @@ habitrpg.controller("InventoryCtrl",
|
|||||||
return filteredArray;
|
return filteredArray;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.dequip = function(gearSet){
|
$scope.dequip = function(itemSet){
|
||||||
|
|
||||||
if ( gearSet == "battleGear" ) {
|
switch (itemSet) {
|
||||||
|
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;
|
||||||
|
|
||||||
if ( gearSet == "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;
|
||||||
|
|
||||||
|
case "petMountBackground":
|
||||||
|
|
||||||
|
var pet = user.items.currentPet;
|
||||||
|
if ( pet ) {
|
||||||
|
user.ops.equip({params:{type: 'pet', key: pet}});
|
||||||
|
}
|
||||||
|
|
||||||
|
var mount = user.items.currentMount;
|
||||||
|
if ( mount ) {
|
||||||
|
user.ops.equip({params:{type: 'mount', key: mount}});
|
||||||
|
}
|
||||||
|
|
||||||
|
var background = user.preferences.background;
|
||||||
|
User.user.ops.unlock({query:{path:"background."+background}});
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +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("battleGear");')
|
div
|
||||||
button.btn.btn-default(type="button") {{env.t("dequipAll")}}
|
button.btn.btn-default(type="button", ng-click='dequip("battleGear");') {{env.t("unequipBattleGear")}}
|
||||||
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]')
|
||||||
@@ -16,8 +16,9 @@ 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");')
|
div
|
||||||
button.btn.btn-default(type="button") {{env.t("dequipAll")}}
|
button.btn.btn-default(type="button", ng-click='dequip("costume");') {{env.t("unequipCostume")}}
|
||||||
|
button.btn.btn-default(type="button", ng-click='dequip("petMountBackground");') {{env.t("unequipPetMountBackground")}}
|
||||||
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