mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
Fixed trait counting in CharacterCreation. Fixed description layout and labels in CharacterCreation. Fixed drag/drop images from Compendium Browser
This commit is contained in:
parent
cc5bfbe27d
commit
24073e4a16
5 changed files with 38 additions and 8 deletions
|
|
@ -11,7 +11,10 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
|
|||
this.character = character;
|
||||
|
||||
this.setup = {
|
||||
traits: this.character.system.traits,
|
||||
traits: Object.keys(this.character.system.traits).reduce((acc, key) => {
|
||||
acc[key] = { value: null };
|
||||
return acc;
|
||||
}, {}),
|
||||
ancestryName: {
|
||||
primary: '',
|
||||
secondary: ''
|
||||
|
|
@ -377,8 +380,10 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
|
|||
];
|
||||
return Object.values(this.setup.traits).reduce((acc, x) => {
|
||||
const index = traitCompareArray.indexOf(x.value);
|
||||
if (index === -1) return acc;
|
||||
|
||||
traitCompareArray.splice(index, 1);
|
||||
acc += index !== -1;
|
||||
acc += 1;
|
||||
return acc;
|
||||
}, 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue