mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-22 02:19:54 +02:00
Restored the data model, config and settings html
This commit is contained in:
parent
25642b80b1
commit
1017437480
5 changed files with 75 additions and 4 deletions
|
|
@ -165,9 +165,14 @@
|
||||||
},
|
},
|
||||||
"ACTIVEEFFECT": {
|
"ACTIVEEFFECT": {
|
||||||
"Config": {
|
"Config": {
|
||||||
|
"rangeDependence": { "title": "Range Dependence" },
|
||||||
"stacking": { "title": "Stacking" },
|
"stacking": { "title": "Stacking" },
|
||||||
"targetDispositions": "Affected Dispositions"
|
"targetDispositions": "Affected Dispositions"
|
||||||
},
|
},
|
||||||
|
"RangeDependance": {
|
||||||
|
"hint": "Settings for an optional distance at which this effect should activate",
|
||||||
|
"title": "Range Dependant"
|
||||||
|
},
|
||||||
"immuneStatusText": "Immunity: {status}"
|
"immuneStatusText": "Immunity: {status}"
|
||||||
},
|
},
|
||||||
"ACTORS": {
|
"ACTORS": {
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,10 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac
|
||||||
.querySelector('.stacking-change-checkbox')
|
.querySelector('.stacking-change-checkbox')
|
||||||
?.addEventListener('change', this.stackingChangeToggle.bind(this));
|
?.addEventListener('change', this.stackingChangeToggle.bind(this));
|
||||||
|
|
||||||
|
htmlElement
|
||||||
|
.querySelector('.range-dependence-change-checkbox')
|
||||||
|
?.addEventListener('change', this.rangeDependenceChangeToggle.bind(this));
|
||||||
|
|
||||||
htmlElement
|
htmlElement
|
||||||
.querySelector('.armor-change-checkbox')
|
.querySelector('.armor-change-checkbox')
|
||||||
?.addEventListener('change', this.armorChangeToggle.bind(this));
|
?.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 } });
|
return this.submit({ updateData: { system: systemData } });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rangeDependenceChangeToggle(event) {
|
||||||
|
const rangeFields = this.document.system.schema.fields.rangeDependence.fields;
|
||||||
|
const systemData = {
|
||||||
|
rangeDependence: event.target.checked
|
||||||
|
? {
|
||||||
|
type: rangeFields.type.initial,
|
||||||
|
target: rangeFields.target.initial,
|
||||||
|
range: rangeFields.range.initial
|
||||||
|
}
|
||||||
|
: null
|
||||||
|
};
|
||||||
|
return this.submit({ updateData: { system: systemData } });
|
||||||
|
}
|
||||||
|
|
||||||
armorChangeToggle(event) {
|
armorChangeToggle(event) {
|
||||||
if (event.target.checked) {
|
if (event.target.checked) {
|
||||||
this.addArmorChange();
|
this.addArmorChange();
|
||||||
|
|
|
||||||
|
|
@ -106,11 +106,18 @@ export const templateTypes = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const targetTypes = {
|
export const rangeInclusion = {
|
||||||
self: {
|
withinRange: {
|
||||||
id: 'self',
|
id: 'withinRange',
|
||||||
label: 'DAGGERHEART.CONFIG.TargetTypes.self'
|
label: 'DAGGERHEART.CONFIG.RangeInclusion.withinRange'
|
||||||
},
|
},
|
||||||
|
outsideRange: {
|
||||||
|
id: 'outsideRange',
|
||||||
|
label: 'DAGGERHEART.CONFIG.RangeInclusion.outsideRange'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const otherTargetTypes = {
|
||||||
friendly: {
|
friendly: {
|
||||||
id: 'friendly',
|
id: 'friendly',
|
||||||
label: 'DAGGERHEART.CONFIG.TargetTypes.friendly'
|
label: 'DAGGERHEART.CONFIG.TargetTypes.friendly'
|
||||||
|
|
@ -123,6 +130,14 @@ export const targetTypes = {
|
||||||
id: 'any',
|
id: 'any',
|
||||||
label: 'DAGGERHEART.CONFIG.TargetTypes.any'
|
label: 'DAGGERHEART.CONFIG.TargetTypes.any'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const targetTypes = {
|
||||||
|
self: {
|
||||||
|
id: 'self',
|
||||||
|
label: 'DAGGERHEART.CONFIG.TargetTypes.self'
|
||||||
|
},
|
||||||
|
...otherTargetTypes
|
||||||
};
|
};
|
||||||
|
|
||||||
export const burden = {
|
export const burden = {
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,26 @@ export default class BaseEffect extends foundry.data.ActiveEffectTypeDataModel {
|
||||||
}),
|
}),
|
||||||
description: new fields.HTMLField({ label: 'DAGGERHEART.GENERAL.description' })
|
description: new fields.HTMLField({ label: 'DAGGERHEART.GENERAL.description' })
|
||||||
}),
|
}),
|
||||||
|
rangeDependence: new fields.SchemaField({
|
||||||
|
type: new fields.StringField({
|
||||||
|
required: true,
|
||||||
|
choices: CONFIG.DH.GENERAL.rangeInclusion,
|
||||||
|
initial: CONFIG.DH.GENERAL.rangeInclusion.withinRange.id,
|
||||||
|
label: 'DAGGERHEART.GENERAL.type'
|
||||||
|
}),
|
||||||
|
target: new fields.StringField({
|
||||||
|
required: true,
|
||||||
|
choices: CONFIG.DH.GENERAL.otherTargetTypes,
|
||||||
|
initial: CONFIG.DH.GENERAL.otherTargetTypes.hostile.id,
|
||||||
|
label: 'DAGGERHEART.GENERAL.Target.single'
|
||||||
|
}),
|
||||||
|
range: new fields.StringField({
|
||||||
|
required: true,
|
||||||
|
choices: CONFIG.DH.GENERAL.range,
|
||||||
|
initial: CONFIG.DH.GENERAL.range.melee.id,
|
||||||
|
label: 'DAGGERHEART.GENERAL.range'
|
||||||
|
})
|
||||||
|
}, { nullable: true, initial: null }),
|
||||||
stacking: new fields.SchemaField(
|
stacking: new fields.SchemaField(
|
||||||
{
|
{
|
||||||
value: new fields.NumberField({
|
value: new fields.NumberField({
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,19 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset class="one-column optional">
|
||||||
|
<legend>
|
||||||
|
{{localize "DAGGERHEART.ACTIVEEFFECT.Config.rangeDependence.title"}}
|
||||||
|
<input type="checkbox" class="range-dependence-change-checkbox" {{checked source.system.rangeDependence}} />
|
||||||
|
</legend>
|
||||||
|
|
||||||
|
{{#if source.system.rangeDependence}}
|
||||||
|
{{formGroup systemFields.rangeDependence.fields.type value=source.system.rangeDependence.type localize=true }}
|
||||||
|
{{formGroup systemFields.rangeDependence.fields.target value=source.system.rangeDependence.target localize=true }}
|
||||||
|
{{formGroup systemFields.rangeDependence.fields.range value=source.system.rangeDependence.range localize=true }}
|
||||||
|
{{/if}}
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
<fieldset class="one-column">
|
<fieldset class="one-column">
|
||||||
<legend>{{localize "EFFECT.DURATION.Label"}}</legend>
|
<legend>{{localize "EFFECT.DURATION.Label"}}</legend>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue