mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-22 15:33:37 +02:00
Changed from 'area' to 'areas'
This commit is contained in:
parent
06535b0e91
commit
6d355e342e
14 changed files with 27 additions and 29 deletions
|
|
@ -28,7 +28,7 @@ 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);
|
||||
if (areaIndex !== undefined) data.areas[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);
|
||||
|
|
@ -58,9 +58,9 @@ export default class DHActionConfig extends DHActionBaseConfig {
|
|||
const { areaIndex, index } = button.dataset;
|
||||
let effectId = null;
|
||||
if (areaIndex !== undefined) {
|
||||
effectId = this.action.area[areaIndex].effects[index];
|
||||
effectId = this.action.areas[areaIndex].effects[index];
|
||||
const data = this.action.toObject();
|
||||
data.area[areaIndex].effects.splice(index, 1);
|
||||
data.areas[areaIndex].effects.splice(index, 1);
|
||||
this.constructor.updateForm.call(this, null, null, { object: foundry.utils.flattenObject(data) });
|
||||
} else {
|
||||
effectId = this.action.effects[index]._id;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ 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);
|
||||
if (areaIndex !== undefined) data.areas[areaIndex].effects.push(effectData.id);
|
||||
else data.effects.push({ _id: effectData.id });
|
||||
|
||||
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
|
||||
|
|
@ -51,9 +51,9 @@ export default class DHActionSettingsConfig extends DHActionBaseConfig {
|
|||
const { areaIndex, index } = button.dataset;
|
||||
let effectId = null;
|
||||
if (areaIndex !== undefined) {
|
||||
effectId = this.action.area[areaIndex].effects[index];
|
||||
effectId = this.action.areas[areaIndex].effects[index];
|
||||
const data = this.action.toObject();
|
||||
data.area[areaIndex].effects.splice(index, 1);
|
||||
data.areas[areaIndex].effects.splice(index, 1);
|
||||
this.constructor.updateForm.call(this, null, null, { object: foundry.utils.flattenObject(data) });
|
||||
} else {
|
||||
effectId = this.action.effects[index]._id;
|
||||
|
|
|
|||
|
|
@ -107,17 +107,16 @@ export default class DhRegionLayer extends foundry.canvas.layers.RegionLayer {
|
|||
|
||||
const settings = canvas.scene?.rangeSettings;
|
||||
const rangeNumber = Number(range);
|
||||
const length =
|
||||
(!Number.isNaN(rangeNumber) ? rangeNumber : settings ? settings[range] : 0) * dimensionConstant;
|
||||
const length = (!Number.isNaN(rangeNumber) ? rangeNumber : settings ? settings[range] : 0) * dimensionConstant;
|
||||
/*----*/
|
||||
|
||||
const shapeData = {
|
||||
...canvas.mousePosition,
|
||||
type: type,
|
||||
direction: direction ?? 0,
|
||||
direction: direction ?? 0
|
||||
};
|
||||
|
||||
switch(type) {
|
||||
switch (type) {
|
||||
case rectangle.id:
|
||||
shapeData.width = length;
|
||||
shapeData.height = length;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ const fields = foundry.data.fields;
|
|||
*/
|
||||
|
||||
export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel) {
|
||||
static extraSchemas = ['area', 'cost', 'uses', 'range'];
|
||||
static extraSchemas = ['areas', 'cost', 'uses', 'range'];
|
||||
|
||||
/** @inheritDoc */
|
||||
static defineSchema() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
export { default as AreaField } from './areaField.mjs';
|
||||
export { default as AreasField } from './areasField.mjs';
|
||||
export { default as CostField } from './costField.mjs';
|
||||
export { default as CountdownField } from './countdownField.mjs';
|
||||
export { default as UsesField } from './usesField.mjs';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
const fields = foundry.data.fields;
|
||||
|
||||
export default class AreaField extends fields.ArrayField {
|
||||
export default class AreasField extends fields.ArrayField {
|
||||
/**
|
||||
* Action Workflow order
|
||||
*/
|
||||
|
|
@ -281,7 +281,7 @@ export function ActionMixin(Base) {
|
|||
name: this.name,
|
||||
img: this.baseAction ? this.parent.parent.img : this.img,
|
||||
tags: this.tags ? this.tags : ['Spell', 'Arcana', 'Lv 10'],
|
||||
area: this.area,
|
||||
areas: this.areas,
|
||||
summon: this.summon
|
||||
},
|
||||
source: {
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ export default class DHRoll extends Roll {
|
|||
roll: this,
|
||||
parent: chatData.parent,
|
||||
targetMode: chatData.targetMode,
|
||||
areas: chatData.action?.area,
|
||||
areas: chatData.action?.areas,
|
||||
metagamingSettings
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -282,14 +282,14 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
|||
);
|
||||
};
|
||||
|
||||
if (this.system.action.area.length === 1) createArea(this.system.action.area[0]);
|
||||
else if (this.system.action.area.length > 1) {
|
||||
if (this.system.action.areas.length === 1) createArea(this.system.action.areas[0]);
|
||||
else if (this.system.action.areas.length > 1) {
|
||||
new foundry.applications.ux.ContextMenu.implementation(
|
||||
event.target,
|
||||
'.action-areas',
|
||||
this.system.action.area.map((area, index) => ({
|
||||
this.system.action.areas.map(area => ({
|
||||
label: area.name,
|
||||
onClick: () => createArea(this.system.action.area[index])
|
||||
onClick: () => createArea(area)
|
||||
})),
|
||||
{
|
||||
jQuery: false,
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ export const preloadHandlebarsTemplates = async function () {
|
|||
'systems/daggerheart/templates/actionTypes/uses.hbs',
|
||||
'systems/daggerheart/templates/actionTypes/roll.hbs',
|
||||
'systems/daggerheart/templates/actionTypes/save.hbs',
|
||||
'systems/daggerheart/templates/actionTypes/area.hbs',
|
||||
'systems/daggerheart/templates/actionTypes/areas.hbs',
|
||||
'systems/daggerheart/templates/actionTypes/cost.hbs',
|
||||
'systems/daggerheart/templates/actionTypes/range-target.hbs',
|
||||
'systems/daggerheart/templates/actionTypes/effect.hbs',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue