Added section for fighting styles to new character sheet

This commit is contained in:
TJ 2020-12-05 17:05:36 -06:00
parent f9e1bf3ab2
commit aa38f26d2e

View file

@ -81,7 +81,7 @@ export default class ActorSheet5eCharacterNew extends ActorSheet5e {
};
// Partition items by category
let [items, powers, feats, classes, species, archetypes, classfeatures, backgrounds, lightsaberforms] = data.items.reduce((arr, item) => {
let [items, powers, feats, classes, species, archetypes, classfeatures, backgrounds, lightsaberforms, fightingstyles] = data.items.reduce((arr, item) => {
// Item details
item.img = item.img || DEFAULT_TOKEN;
@ -105,9 +105,10 @@ export default class ActorSheet5eCharacterNew extends ActorSheet5e {
else if ( item.type === "classfeature" ) arr[6].push(item);
else if ( item.type === "background" ) arr[7].push(item);
else if ( item.type === "lightsaberform" ) arr[8].push(item);
else if (item.type === "fightingstyle") arr[9].push(item);
else if ( Object.keys(inventory).includes(item.type ) ) arr[0].push(item);
return arr;
}, [[], [], [], [], [], [], [], [], []]);
}, [[], [], [], [], [], [], [], [], [], []]);
// Apply active item filters
items = this._filterItems(items, this._filters.inventory);
@ -136,6 +137,7 @@ export default class ActorSheet5eCharacterNew extends ActorSheet5e {
species: { label: "SW5E.ItemTypeSpecies", items: [], hasActions: false, dataset: {type: "species"}, isSpecies: true },
background: { label: "SW5E.ItemTypeBackground", items: [], hasActions: false, dataset: {type: "background"}, isBackground: true },
lightsaberform: { label: "SW5E.ItemTypeLightsaberForm", items: [], hasActions: false, dataset: {type: "lightsaberform"}, isLightsaberform: true },
fightingstyles: { label: "SW5E.ItemTypeFightingStyle", items: [], hasActions: false, dataset: {type: "fightingstyle"}, isFightingstyles: true },
active: { label: "SW5E.FeatureActive", items: [], hasActions: true, dataset: {type: "feat", "activation.type": "action"} },
passive: { label: "SW5E.FeaturePassive", items: [], hasActions: false, dataset: {type: "feat"} }
};
@ -150,6 +152,7 @@ export default class ActorSheet5eCharacterNew extends ActorSheet5e {
features.species.items = species;
features.background.items = backgrounds;
features.lightsaberform.items = lightsaberforms;
features.fightingstyles.items = fightingstyles;
// Assign and return
data.inventory = Object.values(inventory);