mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
costumes: add costume support in inventory
This commit is contained in:
@@ -162,5 +162,10 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', 'User', 'API_URL',
|
|||||||
User.set('items.currentMount', (user.items.currentMount == mount) ? '' : mount);
|
User.set('items.currentMount', (user.items.currentMount == mount) ? '' : mount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.equip = function(user, item, costume) {
|
||||||
|
var equipTo = costume ? 'costume' : 'equipped';
|
||||||
|
User.set('items.gear.' + equipTo + '.' + item.type, item.key);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
@@ -114,12 +114,18 @@ var UserSchema = new Schema({
|
|||||||
m[v.key]['default'] = true;
|
m[v.key]['default'] = true;
|
||||||
}),
|
}),
|
||||||
|
|
||||||
current: {
|
equipped: {
|
||||||
weapon: {type: String, 'default': 'weapon_warrior_0'},
|
weapon: {type: String, 'default': 'weapon_warrior_0'},
|
||||||
armor: {type: String, 'default': 'armor_warrior_0'},
|
armor: {type: String, 'default': 'armor_warrior_0'},
|
||||||
head: {type: String, 'default': 'head_warrior_0'},
|
head: {type: String, 'default': 'head_warrior_0'},
|
||||||
shield: {type: String, 'default': 'shield_warrior_0'}
|
shield: {type: String, 'default': 'shield_warrior_0'}
|
||||||
}
|
},
|
||||||
|
costume: {
|
||||||
|
weapon: {type: String, 'default': 'weapon_warrior_0'},
|
||||||
|
armor: {type: String, 'default': 'armor_warrior_0'},
|
||||||
|
head: {type: String, 'default': 'head_warrior_0'},
|
||||||
|
shield: {type: String, 'default': 'shield_warrior_0'}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// -------------- Animals -------------------
|
// -------------- Animals -------------------
|
||||||
@@ -209,7 +215,8 @@ var UserSchema = new Schema({
|
|||||||
skin: {type:String, 'default':'white'},
|
skin: {type:String, 'default':'white'},
|
||||||
timezoneOffset: Number,
|
timezoneOffset: Number,
|
||||||
language: String,
|
language: String,
|
||||||
automaticAllocation: Boolean
|
automaticAllocation: Boolean,
|
||||||
|
useCostume: Boolean
|
||||||
},
|
},
|
||||||
profile: {
|
profile: {
|
||||||
blurb: String,
|
blurb: String,
|
||||||
|
|||||||
@@ -7,8 +7,16 @@ script(type='text/ng-template', id='partials/options.inventory.inventory.html')
|
|||||||
|
|
||||||
li.customize-menu
|
li.customize-menu
|
||||||
menu.pets-menu(label='Gear')
|
menu.pets-menu(label='Gear')
|
||||||
div(ng-repeat='(k,v) in user.items.gear.owned')
|
div(ng-repeat='(k,v) in user.items.gear.owned', ng-init='item = Items.gear.flat[k]')
|
||||||
button.customize-option(popover='{{Items.gear.flat[k].notes}}', popover-title='{{Items.gear.flat[k].text}}', popover-trigger='mouseenter', popover-placement='right', ng-click='equip(v)', class='shop_{{v.key}}')
|
button.customize-option(popover='{{item.notes}}', popover-title='{{item.text}}', popover-trigger='mouseenter', popover-placement='right', ng-click='equip(user,item)', class='shop_{{item.key}}')
|
||||||
|
label.checkbox.inline
|
||||||
|
input(type="checkbox", ng-model="user.preferences.costume")
|
||||||
|
| Use Custume
|
||||||
|
i.icon-question-sign(popover="Show something different on your avatar than the gear you have equipped for battle", popover-trigger='mouseenter', popover-placement='right')
|
||||||
|
li.customize-menu(ng-if='user.preferences.costume')
|
||||||
|
menu.pets-menu(label='Gear')
|
||||||
|
div(ng-repeat='(k,v) in user.items.gear.owned', ng-init='item = Items.gear.flat[k]')
|
||||||
|
button.customize-option(popover='{{item.notes}}', popover-title='{{item.text}}', popover-trigger='mouseenter', popover-placement='right', ng-click='equip(user,item,true)', class='shop_{{item.key}}')
|
||||||
|
|
||||||
li.customize-menu
|
li.customize-menu
|
||||||
menu.pets-menu(label='Eggs ({{eggCount}})')
|
menu.pets-menu(label='Eggs ({{eggCount}})')
|
||||||
|
|||||||
@@ -8,14 +8,25 @@ figure.herobox(ng-click='spell ? castEnd(profile, "user", $event) : clickMember(
|
|||||||
// Mount Body
|
// Mount Body
|
||||||
span(ng-if='profile.items.currentMount', class='Mount_Body_{{profile.items.currentMount}}')
|
span(ng-if='profile.items.currentMount', class='Mount_Body_{{profile.items.currentMount}}')
|
||||||
|
|
||||||
|
// Avatar
|
||||||
span(class='skin_{{profile.preferences.skin}}')
|
span(class='skin_{{profile.preferences.skin}}')
|
||||||
span(class='{{profile.preferences.size}}_{{profile.items.gear.current.armor}}', ng-show='profile.preferences.showArmor')
|
|
||||||
|
span(class='{{profile.preferences.size}}_{{profile.items.gear.equipped.armor}}', ng-if='!profile.preferences.costume')
|
||||||
|
span(class='{{profile.preferences.size}}_{{profile.items.gear.costume.armor}}', ng-if='profile.preferences.costume')
|
||||||
|
|
||||||
span(class='head_warrior_0')
|
span(class='head_warrior_0')
|
||||||
span(class='hair_base_{{profile.preferences.hair.base}}_{{profile.preferences.hair.color}}')
|
span(class='hair_base_{{profile.preferences.hair.base}}_{{profile.preferences.hair.color}}')
|
||||||
span(class='hair_bangs_{{profile.preferences.hair.bangs}}_{{profile.preferences.hair.color}}')
|
span(class='hair_bangs_{{profile.preferences.hair.bangs}}_{{profile.preferences.hair.color}}')
|
||||||
span(class='{{profile.items.gear.current.head}}', ng-show='profile.preferences.showHelm')
|
|
||||||
span(class='{{profile.items.gear.current.shield}}', ng-show='profile.preferences.showShield')
|
span(class='{{profile.items.gear.equipped.head}}', ng-if='!profile.preferences.costume')
|
||||||
span(class='{{profile.items.gear.current.weapon}}', ng-show='profile.preferences.showWeapon')
|
span(class='{{profile.items.gear.costume.head}}', ng-if='profile.preferences.costume')
|
||||||
|
|
||||||
|
span(class='{{profile.items.gear.equipped.shield}}', ng-if='!profile.preferences.costume')
|
||||||
|
span(class='{{profile.items.gear.costume.shield}}', ng-if='profile.preferences.costume')
|
||||||
|
|
||||||
|
span(class='{{profile.items.gear.equipped.weapon}}', ng-if='!profile.preferences.costume')
|
||||||
|
span(class='{{profile.items.gear.costume.weapon}}', ng-if='profile.preferences.costume')
|
||||||
|
|
||||||
|
|
||||||
// Mount Head
|
// Mount Head
|
||||||
span(ng-if='profile.items.currentMount', class='Mount_Head_{{profile.items.currentMount}}')
|
span(ng-if='profile.items.currentMount', class='Mount_Head_{{profile.items.currentMount}}')
|
||||||
|
|||||||
Reference in New Issue
Block a user