mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-22 07:23:37 +02:00
Run lint fix on action areas PR (#1820)
This commit is contained in:
parent
f348b64aae
commit
c57266e596
14 changed files with 72 additions and 66 deletions
|
|
@ -28,10 +28,8 @@ export default class DHActionConfig extends DHActionBaseConfig {
|
|||
game.system.api.data.activeEffects.BaseEffect.getDefaultObject({ transfer: false })
|
||||
]);
|
||||
|
||||
if (areaIndex !== undefined)
|
||||
data.area[areaIndex].effects.push(created[0]._id);
|
||||
else
|
||||
data.effects.push({ _id: created[0]._id });
|
||||
if (areaIndex !== undefined) data.area[areaIndex].effects.push(created[0]._id);
|
||||
else data.effects.push({ _id: created[0]._id });
|
||||
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
|
||||
this.action.item.effects.get(created[0]._id).sheet.render(true);
|
||||
}
|
||||
|
|
@ -57,14 +55,14 @@ export default class DHActionConfig extends DHActionBaseConfig {
|
|||
static removeEffect(event, button) {
|
||||
if (!this.action.effects) return;
|
||||
|
||||
const { areaIndex, index } = button.dataset;
|
||||
let effectId = null;
|
||||
const { areaIndex, index } = button.dataset;
|
||||
let effectId = null;
|
||||
if (areaIndex !== undefined) {
|
||||
effectId = this.action.area[areaIndex].effects[index];
|
||||
const data = this.action.toObject();
|
||||
data.area[areaIndex].effects.splice(index, 1);
|
||||
this.constructor.updateForm.call(this, null, null, { object: foundry.utils.flattenObject(data) });
|
||||
} else {
|
||||
} else {
|
||||
effectId = this.action.effects[index]._id;
|
||||
this.constructor.removeElement.call(this, event, button);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,10 +40,8 @@ export default class DHActionSettingsConfig extends DHActionBaseConfig {
|
|||
this.sheetUpdate(data, effectData);
|
||||
this.effects = [...this.effects, effectData];
|
||||
|
||||
if(areaIndex !== undefined)
|
||||
data.area[areaIndex].effects.push(effectData.id);
|
||||
else
|
||||
data.effects.push({ _id: effectData.id });
|
||||
if (areaIndex !== undefined) data.area[areaIndex].effects.push(effectData.id);
|
||||
else data.effects.push({ _id: effectData.id });
|
||||
|
||||
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
|
||||
}
|
||||
|
|
@ -62,7 +60,6 @@ export default class DHActionSettingsConfig extends DHActionBaseConfig {
|
|||
this.constructor.removeElement.call(this, event, button);
|
||||
}
|
||||
|
||||
|
||||
this.sheetUpdate(
|
||||
this.action.toObject(),
|
||||
this.effects.find(x => x.id === effectId),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue