mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-15 21:21:08 +01:00
[Fix] Levelup New Experience Increase (#1461)
* Fixed so you can select a newly gained experience to increase * . * Exchanged forEach with for..of. The future is now
This commit is contained in:
parent
f184db1f93
commit
0806c2d1ac
4 changed files with 32 additions and 12 deletions
|
|
@ -357,11 +357,23 @@ export default class DhlevelUp extends HandlebarsApplicationMixin(ApplicationV2)
|
|||
|
||||
const experienceIncreaseTagify = htmlElement.querySelector('.levelup-experience-increases');
|
||||
if (experienceIncreaseTagify) {
|
||||
const allExperiences = {
|
||||
...this.actor.system.experiences,
|
||||
...Object.values(this.levelup.levels).reduce((acc, level) => {
|
||||
for (const key of Object.keys(level.achievements.experiences)) {
|
||||
acc[key] = level.achievements.experiences[key];
|
||||
}
|
||||
|
||||
return acc;
|
||||
}, {})
|
||||
};
|
||||
tagifyElement(
|
||||
experienceIncreaseTagify,
|
||||
Object.keys(this.actor.system.experiences).reduce((acc, id) => {
|
||||
const experience = this.actor.system.experiences[id];
|
||||
acc.push({ id: id, label: experience.name });
|
||||
Object.keys(allExperiences).reduce((acc, id) => {
|
||||
const experience = allExperiences[id];
|
||||
if (experience.name) {
|
||||
acc.push({ id: id, label: experience.name });
|
||||
}
|
||||
|
||||
return acc;
|
||||
}, []),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue