mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 15:39:02 +01:00
.
This commit is contained in:
parent
aed7942fc4
commit
8b864ba388
11 changed files with 50 additions and 4 deletions
|
|
@ -2281,6 +2281,9 @@
|
||||||
"label": "Apply Effects",
|
"label": "Apply Effects",
|
||||||
"hint": "Automatically apply effects. Targets must be selected before the action is made and Reaction Roll Automation must be different than Never. Bypass users permissions."
|
"hint": "Automatically apply effects. Targets must be selected before the action is made and Reaction Roll Automation must be different than Never. Bypass users permissions."
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"summaryMessages": {
|
||||||
|
"label": "Summary Messages"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defeated": {
|
"defeated": {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
import DHAbilityUse from './abilityUse.mjs';
|
import DHAbilityUse from './abilityUse.mjs';
|
||||||
import DHActorRoll from './actorRoll.mjs';
|
import DHActorRoll from './actorRoll.mjs';
|
||||||
|
import DHSystemMessage from './systemMessage.mjs';
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
abilityUse: DHAbilityUse,
|
abilityUse: DHAbilityUse,
|
||||||
adversaryRoll: DHActorRoll,
|
adversaryRoll: DHActorRoll,
|
||||||
damageRoll: DHActorRoll,
|
damageRoll: DHActorRoll,
|
||||||
dualityRoll: DHActorRoll
|
dualityRoll: DHActorRoll,
|
||||||
|
systemMessage: DHSystemMessage
|
||||||
};
|
};
|
||||||
|
|
|
||||||
9
module/data/chat-message/systemMessage.mjs
Normal file
9
module/data/chat-message/systemMessage.mjs
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
export default class DHSystemMessage extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
|
||||||
|
return {
|
||||||
|
useTitle: new fields.BooleanField({ initial: true })
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -111,8 +111,15 @@ export default class DamageField extends fields.SchemaField {
|
||||||
}
|
}
|
||||||
|
|
||||||
Promise.all(damagePromises).then(async _ => {
|
Promise.all(damagePromises).then(async _ => {
|
||||||
|
const summaryMessageSettings = game.settings.get(
|
||||||
|
CONFIG.DH.id,
|
||||||
|
CONFIG.DH.SETTINGS.gameSettings.Automation
|
||||||
|
).summaryMessages;
|
||||||
|
if (!summaryMessageSettings.damage) return;
|
||||||
|
|
||||||
const cls = getDocumentClass('ChatMessage');
|
const cls = getDocumentClass('ChatMessage');
|
||||||
const msg = {
|
const msg = {
|
||||||
|
type: 'systemMessage',
|
||||||
user: game.user.id,
|
user: game.user.id,
|
||||||
speaker: cls.getSpeaker(),
|
speaker: cls.getSpeaker(),
|
||||||
title: game.i18n.localize(
|
title: game.i18n.localize(
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,16 @@ export default class EffectsField extends fields.ArrayField {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (messageTargets.length === 0) return;
|
if (messageTargets.length === 0) return;
|
||||||
|
|
||||||
|
const summaryMessageSettings = game.settings.get(
|
||||||
|
CONFIG.DH.id,
|
||||||
|
CONFIG.DH.SETTINGS.gameSettings.Automation
|
||||||
|
).summaryMessages;
|
||||||
|
if (!summaryMessageSettings.effects) return;
|
||||||
|
|
||||||
const cls = getDocumentClass('ChatMessage');
|
const cls = getDocumentClass('ChatMessage');
|
||||||
const msg = {
|
const msg = {
|
||||||
|
type: 'systemMessage',
|
||||||
user: game.user.id,
|
user: game.user.id,
|
||||||
speaker: cls.getSpeaker(),
|
speaker: cls.getSpeaker(),
|
||||||
title: game.i18n.localize('DAGGERHEART.UI.Chat.effectSummary.title'),
|
title: game.i18n.localize('DAGGERHEART.UI.Chat.effectSummary.title'),
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,10 @@ export default class DhAutomation extends foundry.abstract.DataModel {
|
||||||
static defineSchema() {
|
static defineSchema() {
|
||||||
const fields = foundry.data.fields;
|
const fields = foundry.data.fields;
|
||||||
return {
|
return {
|
||||||
|
summaryMessages: new fields.SchemaField({
|
||||||
|
damage: new fields.BooleanField({ initial: true, label: 'DAGGERHEART.GENERAL.damage' }),
|
||||||
|
effects: new fields.BooleanField({ initial: true, label: 'DAGGERHEART.GENERAL.Effect.plural' })
|
||||||
|
}),
|
||||||
hopeFear: new fields.SchemaField({
|
hopeFear: new fields.SchemaField({
|
||||||
gm: new fields.BooleanField({
|
gm: new fields.BooleanField({
|
||||||
required: true,
|
required: true,
|
||||||
|
|
|
||||||
|
|
@ -210,8 +210,15 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
Promise.all(damagePromises).then(async _ => {
|
Promise.all(damagePromises).then(async _ => {
|
||||||
|
const summaryMessageSettings = game.settings.get(
|
||||||
|
CONFIG.DH.id,
|
||||||
|
CONFIG.DH.SETTINGS.gameSettings.Automation
|
||||||
|
).summaryMessages;
|
||||||
|
if (!summaryMessageSettings.damage) return;
|
||||||
|
|
||||||
const cls = getDocumentClass('ChatMessage');
|
const cls = getDocumentClass('ChatMessage');
|
||||||
const msg = {
|
const msg = {
|
||||||
|
type: 'systemMessage',
|
||||||
user: game.user.id,
|
user: game.user.id,
|
||||||
speaker: cls.getSpeaker(),
|
speaker: cls.getSpeaker(),
|
||||||
title: game.i18n.localize(
|
title: game.i18n.localize(
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
@import './chat/chat.less';
|
@import './chat/chat.less';
|
||||||
@import './chat/damage-summary.less';
|
@import './chat/damage-summary.less';
|
||||||
@import './chat/downtime.less';
|
@import './chat/downtime.less';
|
||||||
|
@import './chat/effect-summary.less';
|
||||||
@import './chat/refresh-message.less';
|
@import './chat/refresh-message.less';
|
||||||
@import './chat/sheet.less';
|
@import './chat/sheet.less';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -266,7 +266,8 @@
|
||||||
"dualityRoll": {},
|
"dualityRoll": {},
|
||||||
"adversaryRoll": {},
|
"adversaryRoll": {},
|
||||||
"damageRoll": {},
|
"damageRoll": {},
|
||||||
"abilityUse": {}
|
"abilityUse": {},
|
||||||
|
"systemMessage": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"background": "systems/daggerheart/assets/logos/FoundrybornBackgroundLogo.png",
|
"background": "systems/daggerheart/assets/logos/FoundrybornBackgroundLogo.png",
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,11 @@
|
||||||
<label>{{localize "DAGGERHEART.SETTINGS.Automation.FIELDS.hopeFear.label"}}</label>
|
<label>{{localize "DAGGERHEART.SETTINGS.Automation.FIELDS.hopeFear.label"}}</label>
|
||||||
{{formGroup settingFields.schema.fields.hopeFear.fields.gm value=settingFields._source.hopeFear.gm localize=true}}
|
{{formGroup settingFields.schema.fields.hopeFear.fields.gm value=settingFields._source.hopeFear.gm localize=true}}
|
||||||
{{formGroup settingFields.schema.fields.hopeFear.fields.players value=settingFields._source.hopeFear.players localize=true}}
|
{{formGroup settingFields.schema.fields.hopeFear.fields.players value=settingFields._source.hopeFear.players localize=true}}
|
||||||
|
</div>
|
||||||
|
<div class="form-group setting-two-values">
|
||||||
|
<label>{{localize "DAGGERHEART.SETTINGS.Automation.FIELDS.summaryMessages.label"}}</label>
|
||||||
|
{{formGroup settingFields.schema.fields.summaryMessages.fields.damage value=settingFields._source.summaryMessages.damage localize=true}}
|
||||||
|
{{formGroup settingFields.schema.fields.summaryMessages.fields.effects value=settingFields._source.summaryMessages.effects localize=true}}
|
||||||
</div>
|
</div>
|
||||||
{{formGroup settingFields.schema.fields.actionPoints value=settingFields._source.actionPoints localize=true}}
|
{{formGroup settingFields.schema.fields.actionPoints value=settingFields._source.actionPoints localize=true}}
|
||||||
{{formGroup settingFields.schema.fields.hordeDamage value=settingFields._source.hordeDamage localize=true}}
|
{{formGroup settingFields.schema.fields.hordeDamage value=settingFields._source.hordeDamage localize=true}}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
<ul class="damage-container">
|
<ul class="damage-container">
|
||||||
{{#each this.updates}}
|
{{#each this.updates}}
|
||||||
<li class="damage-row">
|
<li class="damage-row">
|
||||||
{{#if (gte this.value)}}
|
{{#if (gte this.value 0)}}
|
||||||
<span>
|
<span>
|
||||||
{{
|
{{
|
||||||
localize "DAGGERHEART.UI.Chat.markResource"
|
localize "DAGGERHEART.UI.Chat.markResource"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue