mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
Added select and autocomplete
This commit is contained in:
parent
eea1b6e6b8
commit
7943477faa
2 changed files with 35 additions and 1 deletions
|
|
@ -192,6 +192,10 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac
|
|||
...conditional,
|
||||
...game.system.api.data.activeEffects.EffectConditional.getConditionalFieldUseage(conditional.type)
|
||||
}));
|
||||
partContext.statusChoices = Object.values(CONFIG.statusEffects).map(x => ({
|
||||
id: x.id,
|
||||
label: x.name
|
||||
}));
|
||||
break;
|
||||
case 'changes':
|
||||
const fields = this.document.system.schema.fields.changes.element.fields;
|
||||
|
|
@ -267,6 +271,19 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac
|
|||
event.target.name.endsWith('type')
|
||||
) {
|
||||
const container = event.target.closest('.conditional-container');
|
||||
|
||||
const statusSelect = container.querySelector('.form-group.status-select');
|
||||
const attributeAuto = container.querySelector('.form-group.attribute-auto');
|
||||
if (event.target.value === CONFIG.DH.GENERAL.activeEffectConditionalType.status.id) {
|
||||
statusSelect.classList.remove('not-visible');
|
||||
attributeAuto.classList.add('not-visible');
|
||||
} else {
|
||||
statusSelect.classList.add('not-visible');
|
||||
attributeAuto.classList.remove('not-visible');
|
||||
}
|
||||
statusSelect.querySelector('select').selectedIndex = '-1';
|
||||
attributeAuto.querySelector('input').value = '';
|
||||
|
||||
const { usesValue, usesComparator } =
|
||||
game.system.api.data.activeEffects.EffectConditional.getConditionalFieldUseage(event.target.value);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue