mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
classes: proper handling of items on class-switch, un-equipping items,
etc. Paves way for item-loss on death. See habitrpg-shared#acae9c3
This commit is contained in:
@@ -20,16 +20,10 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', 'User', 'API_URL',
|
||||
|
||||
$scope.$watch('user.items.gear', function(gear){
|
||||
$scope.gear = {
|
||||
base: [
|
||||
Items.items.gear.flat['head_warrior_0'],
|
||||
Items.items.gear.flat['armor_warrior_0'],
|
||||
//Items.items.gear.flat['weapon_warrior_0'],
|
||||
Items.items.gear.flat['shield_warrior_0']
|
||||
]
|
||||
base: _.where(Items.items.gear.flat, {klass: 'base'})
|
||||
};
|
||||
_.each(gear.owned, function(bool,key){
|
||||
var item = Items.items.gear.flat[key];
|
||||
debugger;
|
||||
if (!$scope.gear[item.klass]) $scope.gear[item.klass] = [];
|
||||
$scope.gear[item.klass].push(item);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user