mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
Added an AppearanceSetting that decided if players should get to see information about hit/miss in chat messages
This commit is contained in:
parent
f1f5102af1
commit
f75468c9e0
6 changed files with 17 additions and 3 deletions
|
|
@ -25,6 +25,7 @@ export default class DhAppearance extends foundry.abstract.DataModel {
|
||||||
choices: CONFIG.DH.GENERAL.fearDisplay,
|
choices: CONFIG.DH.GENERAL.fearDisplay,
|
||||||
initial: CONFIG.DH.GENERAL.fearDisplay.token.value
|
initial: CONFIG.DH.GENERAL.fearDisplay.token.value
|
||||||
}),
|
}),
|
||||||
|
hideHitMissForPlayers: new BooleanField({ initial: false }),
|
||||||
displayCountdownUI: new BooleanField({ initial: true }),
|
displayCountdownUI: new BooleanField({ initial: true }),
|
||||||
diceSoNice: new SchemaField({
|
diceSoNice: new SchemaField({
|
||||||
hope: diceStyle({ fg: '#ffffff', bg: '#ffe760', outline: '#000000', edge: '#ffffff' }),
|
hope: diceStyle({ fg: '#ffffff', bg: '#ffe760', outline: '#000000', edge: '#ffffff' }),
|
||||||
|
|
|
||||||
|
|
@ -140,8 +140,10 @@ export default class DHRoll extends Roll {
|
||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
async render({ flavor, template = this.constructor.CHAT_TEMPLATE, isPrivate = false, ...options } = {}) {
|
async render({ flavor, template = this.constructor.CHAT_TEMPLATE, isPrivate = false, ...options } = {}) {
|
||||||
if (!this._evaluated) return;
|
if (!this._evaluated) return;
|
||||||
|
|
||||||
|
const appearanceSettings = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance);
|
||||||
const chatData = await this._prepareChatRenderContext({ flavor, isPrivate, ...options });
|
const chatData = await this._prepareChatRenderContext({ flavor, isPrivate, ...options });
|
||||||
return foundry.applications.handlebars.renderTemplate(template, chatData);
|
return foundry.applications.handlebars.renderTemplate(template, { ...chatData, appearanceSettings });
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
|
|
|
||||||
|
|
@ -68,8 +68,11 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
||||||
document = fromUuidSync(uuid);
|
document = fromUuidSync(uuid);
|
||||||
if (!document) return;
|
if (!document) return;
|
||||||
|
|
||||||
e.setAttribute('data-view-perm', document.testUserPermission(game.user, 'OBSERVER'));
|
|
||||||
e.setAttribute('data-use-perm', document.testUserPermission(game.user, 'OWNER'));
|
e.setAttribute('data-use-perm', document.testUserPermission(game.user, 'OWNER'));
|
||||||
|
|
||||||
|
const settings = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance);
|
||||||
|
if (settings.hideHitMissForPlayers)
|
||||||
|
e.setAttribute('data-view-perm', document.testUserPermission(game.user, 'OBSERVER'));
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.isContentVisible) {
|
if (this.isContentVisible) {
|
||||||
|
|
|
||||||
|
|
@ -450,6 +450,10 @@
|
||||||
|
|
||||||
.target-data {
|
.target-data {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
||||||
|
.target-name {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.target-save {
|
.target-save {
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,10 @@
|
||||||
value=setting.displayFear
|
value=setting.displayFear
|
||||||
localize=true}}
|
localize=true}}
|
||||||
{{formGroup
|
{{formGroup
|
||||||
|
fields.hideHitMissForPlayers
|
||||||
|
value=setting.hideHitMissForPlayers
|
||||||
|
localize=true}}
|
||||||
|
{{formGroup
|
||||||
fields.displayCountdownUI
|
fields.displayCountdownUI
|
||||||
value=setting.displayCountdownUI
|
value=setting.displayCountdownUI
|
||||||
localize=true}}
|
localize=true}}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<div class="roll-part target-section dice-roll" data-action="expandRoll">
|
<div class="roll-part target-section dice-roll" data-action="expandRoll">
|
||||||
<div class="roll-part-header"><div><span>{{pluralize currentTargets.length "DAGGERHEART.GENERAL.Target"}}</span></div></div>
|
<div class="roll-part-header"><div><span>{{pluralize currentTargets.length "DAGGERHEART.GENERAL.Target"}}</span></div></div>
|
||||||
{{#if isGM}}
|
{{#if (or isGM (not appearanceSettings.hideHitMissForPlayers))}}
|
||||||
<div class="roll-part-extra on-reduced">
|
<div class="roll-part-extra on-reduced">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
{{#if (or (gt targetShort.hit 0) (gt targetShort.miss 0))}}
|
{{#if (or (gt targetShort.hit 0) (gt targetShort.miss 0))}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue