Fixed so you can select a newly gained experience to increase

This commit is contained in:
WBHarry 2025-12-23 00:27:12 +01:00
parent 51eadc499f
commit 15ebbacfbc
4 changed files with 20 additions and 12 deletions

View file

@ -357,11 +357,17 @@ export default class DhlevelUp extends HandlebarsApplicationMixin(ApplicationV2)
const experienceIncreaseTagify = htmlElement.querySelector('.levelup-experience-increases');
if (experienceIncreaseTagify) {
const allExperiences = {
...this.actor.system.experiences,
...this.levelup.levels[this.levelup.currentLevel].achievements.experiences
};
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;
}, []),