put all flags inside dsa41 scope
This commit is contained in:
parent
6497042f97
commit
21ac6bf9fa
48
src/main.mjs
48
src/main.mjs
@ -5,7 +5,9 @@ const { loadTemplates, renderTemplate } = foundry.applicat
|
|||||||
const { ActorSheetV2, ItemSheetV2 } = foundry.applications.sheets;
|
const { ActorSheetV2, ItemSheetV2 } = foundry.applications.sheets;
|
||||||
const { Notifications } = foundry.applications.ui;
|
const { Notifications } = foundry.applications.ui;
|
||||||
const { SchemaField, NumberField, StringField, BooleanField } = foundry.data.fields;
|
const { SchemaField, NumberField, StringField, BooleanField } = foundry.data.fields;
|
||||||
|
const { Roll } = foundry.dice;
|
||||||
const { OperatorTerm, NumericTerm } = foundry.dice.terms;
|
const { OperatorTerm, NumericTerm } = foundry.dice.terms;
|
||||||
|
const { ChatMessage } = foundry.documents;
|
||||||
|
|
||||||
Hooks.once("i18nInit", async function() {
|
Hooks.once("i18nInit", async function() {
|
||||||
const lang = game.i18n.lang;
|
const lang = game.i18n.lang;
|
||||||
@ -151,8 +153,8 @@ class DSA41_ChatMessage extends ChatMessage {
|
|||||||
const sender = html.querySelector(".message-sender");
|
const sender = html.querySelector(".message-sender");
|
||||||
sender?.replaceChildren(header);
|
sender?.replaceChildren(header);
|
||||||
|
|
||||||
if (this.flags.type === "trefferpunkte" && this.flags.targets.length != 0) {
|
if (this.flags.dsa41.type === "trefferpunkte" && this.flags.dsa41.targets.length != 0) {
|
||||||
const targets = this.flags.targets.map(x => fromUuidSync(x, { strict: false })).filter(x => x !== null);
|
const targets = this.flags.dsa41.targets.map(x => fromUuidSync(x, { strict: false })).filter(x => x !== null);
|
||||||
const targets_list = await instantiateTemplate("TrefferpunkteTargets", targets);
|
const targets_list = await instantiateTemplate("TrefferpunkteTargets", targets);
|
||||||
|
|
||||||
html.querySelector(".message-content")?.appendChild(targets_list);
|
html.querySelector(".message-content")?.appendChild(targets_list);
|
||||||
@ -891,8 +893,10 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
|
|||||||
speaker: ChatMessage.getSpeaker({ actor: this.document }),
|
speaker: ChatMessage.getSpeaker({ actor: this.document }),
|
||||||
flavor: flavor,
|
flavor: flavor,
|
||||||
flags: {
|
flags: {
|
||||||
type: roll_type,
|
dsa41: {
|
||||||
targets: get_targeted_actors(),
|
type: roll_type,
|
||||||
|
targets: get_targeted_actors(),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -968,8 +972,10 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
|
|||||||
speaker: ChatMessage.getSpeaker({ actor: this.document }),
|
speaker: ChatMessage.getSpeaker({ actor: this.document }),
|
||||||
flavor: flavor,
|
flavor: flavor,
|
||||||
flags: {
|
flags: {
|
||||||
type: roll_type,
|
dsa41: {
|
||||||
targets: get_targeted_actors(),
|
type: roll_type,
|
||||||
|
targets: get_targeted_actors(),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -995,8 +1001,10 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
|
|||||||
speaker: ChatMessage.getSpeaker({ actor: this.document }),
|
speaker: ChatMessage.getSpeaker({ actor: this.document }),
|
||||||
flavor: flavor,
|
flavor: flavor,
|
||||||
flags: {
|
flags: {
|
||||||
type: roll_type,
|
dsa41: {
|
||||||
targets: get_targeted_actors(),
|
type: roll_type,
|
||||||
|
targets: get_targeted_actors(),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1017,8 +1025,10 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
|
|||||||
speaker: ChatMessage.getSpeaker({ actor: this.document }),
|
speaker: ChatMessage.getSpeaker({ actor: this.document }),
|
||||||
flavor: flavor,
|
flavor: flavor,
|
||||||
flags: {
|
flags: {
|
||||||
type: roll_type,
|
dsa41: {
|
||||||
targets: get_targeted_actors(),
|
type: roll_type,
|
||||||
|
targets: get_targeted_actors(),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1039,8 +1049,10 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
|
|||||||
speaker: ChatMessage.getSpeaker({ actor: this.document }),
|
speaker: ChatMessage.getSpeaker({ actor: this.document }),
|
||||||
flavor: game.i18n.localize("DSA41.roll_types." + roll_type),
|
flavor: game.i18n.localize("DSA41.roll_types." + roll_type),
|
||||||
flags: {
|
flags: {
|
||||||
type: roll_type,
|
dsa41: {
|
||||||
targets: get_targeted_actors(),
|
type: roll_type,
|
||||||
|
targets: get_targeted_actors(),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1061,8 +1073,10 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
|
|||||||
speaker: ChatMessage.getSpeaker({ actor: this.document }),
|
speaker: ChatMessage.getSpeaker({ actor: this.document }),
|
||||||
flavor: game.i18n.localize("DSA41.roll_types." + roll_type),
|
flavor: game.i18n.localize("DSA41.roll_types." + roll_type),
|
||||||
flags: {
|
flags: {
|
||||||
type: roll_type,
|
dsa41: {
|
||||||
targets: get_targeted_actors(),
|
type: roll_type,
|
||||||
|
targets: get_targeted_actors(),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1074,8 +1088,10 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
|
|||||||
speaker: ChatMessage.getSpeaker({ actor: this.document }),
|
speaker: ChatMessage.getSpeaker({ actor: this.document }),
|
||||||
flavor: flavor,
|
flavor: flavor,
|
||||||
flags: {
|
flags: {
|
||||||
type: roll_type,
|
dsa41: {
|
||||||
targets: get_targeted_actors(),
|
type: roll_type,
|
||||||
|
targets: get_targeted_actors(),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user