mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-22 02:19:54 +02:00
[Fix] Cleanup RangeDependant (#2039)
* Made the RangeDependent setting for ActiveEffects Nullable * Removed all RangeDependent data from SRD where enabled was false before * Fixed random flickerfly SRD
This commit is contained in:
parent
2782b62793
commit
b2eeed7bb7
280 changed files with 1692 additions and 3605 deletions
|
|
@ -155,6 +155,10 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac
|
|||
.querySelector('.stacking-change-checkbox')
|
||||
?.addEventListener('change', this.stackingChangeToggle.bind(this));
|
||||
|
||||
htmlElement
|
||||
.querySelector('.range-dependence-change-checkbox')
|
||||
?.addEventListener('change', this.rangeDependenceChangeToggle.bind(this));
|
||||
|
||||
htmlElement
|
||||
.querySelector('.armor-change-checkbox')
|
||||
?.addEventListener('change', this.armorChangeToggle.bind(this));
|
||||
|
|
@ -224,6 +228,20 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac
|
|||
return this.submit({ updateData: { system: systemData } });
|
||||
}
|
||||
|
||||
rangeDependenceChangeToggle(event) {
|
||||
const rangeFields = this.document.system.schema.fields.rangeDependence.fields;
|
||||
const systemData = {
|
||||
rangeDependence: event.target.checked
|
||||
? _replace({
|
||||
type: rangeFields.type.initial,
|
||||
target: rangeFields.target.initial,
|
||||
range: rangeFields.range.initial
|
||||
})
|
||||
: null
|
||||
};
|
||||
return this.submit({ updateData: { system: systemData } });
|
||||
}
|
||||
|
||||
armorChangeToggle(event) {
|
||||
if (event.target.checked) {
|
||||
this.addArmorChange();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue