[Feature] Allow Dice Reroll in ChatMessage (#395)

* Troubleshooting

Created test button in 'duality-roll.hbs' and functionality in chatLog.mjs

* Updated functionality

dialog recheck.

* Update duality-roll.hbs

testing toggle on specific areas so only tooltip is triggered.

Rest of CSS functionality not affected.

* Redoing Dice Reroll functionality

Attempting something new

* The rise of NaNs

Resolved Dice Parsing Errors, now dealing with parsing errors from system values.

* Forcing string evaluation for testing

* Fixed rerolling of duality dice

* Fixed message.rolls not being updated

* Added support for d20 rolls

* PR fixes

---------

Co-authored-by: Nikhil Nagarajan <potter.nikhil@gmail.com>
This commit is contained in:
WBHarry 2025-07-23 01:01:21 +02:00 committed by GitHub
parent 2721dfe417
commit 6301e575e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 593 additions and 490 deletions

View file

@ -2,14 +2,14 @@ import { SYSTEM } from './module/config/system.mjs';
import * as applications from './module/applications/_module.mjs';
import * as models from './module/data/_module.mjs';
import * as documents from './module/documents/_module.mjs';
import * as dice from './module/dice/_module.mjs';
import RegisterHandlebarsHelpers from './module/helpers/handlebarsHelper.mjs';
import { enricherConfig, enricherRenderSetup } from './module/enrichers/_module.mjs';
import { getCommandTarget, rollCommandToJSON } from './module/helpers/utils.mjs';
import { NarrativeCountdowns } from './module/applications/ui/countdowns.mjs';
import { DualityRollColor } from './module/data/settings/Appearance.mjs';
import { DHRoll, DualityRoll, D20Roll, DamageRoll, DualityDie } from './module/dice/_module.mjs';
import { enrichedDualityRoll, renderDualityButton } from './module/enrichers/DualityRollEnricher.mjs';
import { renderMeasuredTemplate } from './module/enrichers/TemplateEnricher.mjs';
import { enrichedDualityRoll } from './module/enrichers/DualityRollEnricher.mjs';
import { registerCountdownHooks } from './module/data/countdowns.mjs';
import {
handlebarsRegistration,
@ -20,14 +20,14 @@ import { placeables } from './module/canvas/_module.mjs';
import { registerRollDiceHooks } from './module/dice/dhRoll.mjs';
import { registerDHActorHooks } from './module/documents/actor.mjs';
import './node_modules/@yaireo/tagify/dist/tagify.css';
import { renderDamageButton } from './module/enrichers/DamageEnricher.mjs';
Hooks.once('init', () => {
CONFIG.DH = SYSTEM;
game.system.api = {
applications,
models,
documents
documents,
dice
};
CONFIG.TextEditor.enrichers.push(...enricherConfig);
@ -49,7 +49,12 @@ Hooks.once('init', () => {
DamageRoll: DamageRoll
};
CONFIG.Dice.rolls = [...CONFIG.Dice.rolls, ...[DHRoll, DualityRoll, D20Roll, DamageRoll]];
CONFIG.Dice.terms = {
...CONFIG.Dice.terms,
DualityDie
};
CONFIG.Dice.rolls = [...CONFIG.Dice.rolls, DHRoll, DualityRoll, D20Roll, DamageRoll];
CONFIG.MeasuredTemplate.objectClass = placeables.DhMeasuredTemplate;
const { DocumentSheetConfig } = foundry.applications.apps;

View file

@ -1339,6 +1339,8 @@
"quantity": "Quantity",
"range": "Range",
"recovery": "Recovery",
"reroll": "Reroll",
"rerollThing": "Reroll {thing}",
"resource": "Resource",
"roll": "Roll",
"rollAll": "Roll All",
@ -1615,6 +1617,10 @@
"title": "Heal - {healing}",
"heal": "Heal"
},
"reroll": {
"confirmTitle": "Reroll Dice",
"confirmText": "Are you sure you want to reroll?"
},
"resourceRoll": {
"playerMessage": "{user} rerolled their {name}"
}

View file

@ -46,17 +46,14 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
html.querySelectorAll('.target-indicator').forEach(element =>
element.addEventListener('click', this.onToggleTargets)
);
html.querySelectorAll('.advantage').forEach(element =>
element.addEventListener('mouseenter', this.hoverAdvantage)
);
html.querySelectorAll('.advantage').forEach(element =>
element.addEventListener('click', event => this.selectAdvantage.call(this, event, data.message))
);
html.querySelectorAll('.ability-use-button').forEach(element =>
element.addEventListener('click', event => this.abilityUseButton.call(this, event, data.message))
element.addEventListener('click', event => this.abilityUseButton(this, event, data.message))
);
html.querySelectorAll('.action-use-button').forEach(element =>
element.addEventListener('click', event => this.actionUseButton.call(this, event, data.message))
element.addEventListener('click', event => this.actionUseButton(this, event, data.message))
);
html.querySelectorAll('.reroll-button').forEach(element =>
element.addEventListener('click', event => this.rerollEvent(this, event, data.message))
);
};
@ -70,7 +67,6 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
}
async getActor(id) {
// return game.actors.get(id);
return await fromUuid(id);
}
@ -85,7 +81,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
return action;
}
onRollDamage = async (event, message) => {
async onRollDamage(event, message) {
event.stopPropagation();
const actor = await this.getActor(message.system.source.actor);
if (game.user.character?.id !== actor.id && !game.user.isGM) return true;
@ -94,9 +90,9 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
if (!action || !action?.rollDamage) return;
await action.rollDamage(event, message);
}
};
}
onRollHealing = async (event, message) => {
async onRollHealing(event, message) {
event.stopPropagation();
const actor = await this.getActor(message.system.source.actor);
if (!actor || !game.user.isGM) return true;
@ -105,9 +101,9 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
if (!action || !action?.rollHealing) return;
await action.rollHealing(event, message);
}
};
}
onRollSave = async (event, message) => {
async onRollSave(event, message) {
event.stopPropagation();
const actor = await this.getActor(message.system.source.actor),
tokenId = event.target.closest('[data-token]')?.dataset.token,
@ -118,9 +114,9 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
if (!action || !action?.hasSave) return;
action.rollSave(token, event, message);
}
};
}
onRollAllSave = async (event, message) => {
onRollAllSave(event, _message) {
event.stopPropagation();
const targets = event.target.parentElement.querySelectorAll(
'.target-section > [data-token] .target-save-container'
@ -128,9 +124,9 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
targets.forEach(el => {
el.dispatchEvent(new PointerEvent('click', { shiftKey: true }));
});
};
}
onApplyEffect = async (event, message) => {
async onApplyEffect(event, message) {
event.stopPropagation();
const actor = await this.getActor(message.system.source.actor);
if (!actor || !game.user.isGM) return true;
@ -142,9 +138,9 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelected'));
await action.applyEffects(event, message, targets);
}
};
}
onTargetSelection = async (event, message) => {
onTargetSelection(event, message) {
event.stopPropagation();
const targetSelection = Boolean(event.target.dataset.targetHit),
msg = ui.chat.collection.get(message._id);
@ -154,9 +150,9 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
msg.system.targetSelection = targetSelection;
msg.system.prepareDerivedData();
ui.chat.updateMessage(msg);
};
}
getTargetList = (event, message) => {
getTargetList(event, message) {
const targetSelection = event.target
.closest('.message-content')
.querySelector('.button-target-selection.target-selected'),
@ -167,20 +163,20 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
? message.system.targets.filter(t => t.hit === true).map(target => game.canvas.tokens.get(target.id))
: Array.from(game.user.targets)
};
};
}
hoverTarget = event => {
hoverTarget(event) {
event.stopPropagation();
const token = canvas.tokens.get(event.currentTarget.dataset.token);
if (!token?.controlled) token._onHoverIn(event, { hoverOutOthers: true });
};
}
unhoverTarget = event => {
unhoverTarget(event) {
const token = canvas.tokens.get(event.currentTarget.dataset.token);
if (!token?.controlled) token._onHoverOut(event);
};
}
clickTarget = event => {
clickTarget(event) {
event.stopPropagation();
const token = canvas.tokens.get(event.currentTarget.dataset.token);
if (!token) {
@ -188,9 +184,9 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
return;
}
game.canvas.pan(token);
};
}
onDamage = async (event, message) => {
async onDamage(event, message) {
event.stopPropagation();
const { isHit, targets } = this.getTargetList(event, message);
@ -228,9 +224,9 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
target.actor.takeDamage(damages);
}
};
}
onHealing = async (event, message) => {
async onHealing(event, message) {
event.stopPropagation();
const targets = Array.from(game.user.targets);
@ -240,7 +236,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
for (var target of targets) {
target.actor.takeHealing(message.system.roll);
}
};
}
/**
* Toggle visibility of target containers.
@ -253,51 +249,15 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
.forEach(el => el.classList.toggle('hidden'));
}
/**
* Highlight advantage icons on hover.
* @param {MouseEvent} event
*/
hoverAdvantage(event) {
const parent = event.currentTarget.parentElement;
if (!parent) return;
parent.querySelectorAll('.advantage').forEach(el => {
if (el !== event.currentTarget) {
el.classList.toggle('unused');
}
});
}
/**
* Handle selecting an advantage and disable further selection.
* @param {MouseEvent} event
* @param {object} message
*/
async selectAdvantage(event, message) {
event.stopPropagation();
const updateMessage = game.messages.get(message._id);
await updateMessage?.update({
system: { advantageSelected: event.currentTarget.id === 'hope' ? 1 : 2 }
});
const parent = event.currentTarget.parentElement;
if (!parent) return;
parent.querySelectorAll('.advantage').forEach(el => {
el.replaceWith(el.cloneNode(true));
});
}
abilityUseButton = async (event, message) => {
async abilityUseButton(event, message) {
event.stopPropagation();
const action = message.system.actions[Number.parseInt(event.currentTarget.dataset.index)];
const actor = game.actors.get(message.system.source.actor);
await actor.useAction(action);
};
}
actionUseButton = async (event, message) => {
async actionUseButton(event, message) {
const { moveIndex, actionIndex } = event.currentTarget.dataset;
const parent = await foundry.utils.fromUuid(message.system.actor);
const actionType = message.system.moves[moveIndex].actions[actionIndex];
@ -308,5 +268,30 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
);
action.use(event);
};
}
async rerollEvent(event, message) {
if (!event.shiftKey) {
const confirmed = await foundry.applications.api.DialogV2.confirm({
window: {
title: game.i18n.localize('DAGGERHEART.UI.Chat.reroll.confirmTitle')
},
content: game.i18n.localize('DAGGERHEART.UI.Chat.reroll.confirmText')
});
if (!confirmed) return;
}
const target = event.target.closest('button[data-die-index]');
let originalRoll_parsed = message.rolls.map(roll => JSON.parse(roll))[0];
const rollClass =
game.system.api.dice[
message.type === 'dualityRoll' ? 'DualityRoll' : target.dataset.type === 'damage' ? 'DHRoll' : 'D20Roll'
];
const { newRoll, parsedRoll } = await rollClass.reroll(originalRoll_parsed, target, message);
await game.messages.get(message._id).update({
'system.roll': newRoll,
'rolls': [parsedRoll]
});
}
}

View file

@ -6,7 +6,7 @@ export default class DHAdversaryRoll extends foundry.abstract.TypeDataModel {
static defineSchema() {
return {
title: new fields.StringField(),
roll: new fields.DataField(),
roll: new fields.ObjectField(),
targets: new fields.ArrayField(
new fields.SchemaField({
id: new fields.StringField({}),

View file

@ -26,10 +26,7 @@ const stressDamageReductionRule = localizationPath =>
const bonusField = label =>
new fields.SchemaField({
bonus: new fields.NumberField({ integer: true, initial: 0, label: `${game.i18n.localize(label)} Value` }),
dice: new fields.ArrayField(
new fields.StringField(),
{ label: `${game.i18n.localize(label)} Dice` }
)
dice: new fields.ArrayField(new fields.StringField(), { label: `${game.i18n.localize(label)} Dice` })
});
export { attributeField, resourceField, stressDamageReductionRule, bonusField };

View file

@ -147,7 +147,10 @@ export default class D20Roll extends DHRoll {
const difficulty = config.roll.difficulty ?? target.difficulty ?? target.evasion;
target.hit = this.isCritical || roll.total >= difficulty;
});
} else if (config.roll.difficulty) data.success = roll.isCritical || roll.total >= config.roll.difficulty;
} else if (config.roll.difficulty) {
data.difficulty = config.roll.difficulty;
data.success = roll.isCritical || roll.total >= config.roll.difficulty;
}
data.advantage = {
type: config.roll.advantage,
dice: roll.dAdvantage?.denomination,
@ -169,4 +172,22 @@ export default class D20Roll extends DHRoll {
resetFormula() {
return (this._formula = this.constructor.getFormula(this.terms));
}
static async reroll(rollString, _target, message) {
let parsedRoll = game.system.api.dice.D20Roll.fromData(rollString);
parsedRoll = await parsedRoll.reroll();
const newRoll = game.system.api.dice.D20Roll.postEvaluate(parsedRoll, {
targets: message.system.targets,
roll: {
advantage: message.system.roll.advantage?.type,
difficulty: message.system.roll.difficulty ? Number(message.system.roll.difficulty) : null
}
});
if (game.modules.get('dice-so-nice')?.active) {
await game.dice3d.showForRoll(parsedRoll, game.user, true);
}
return { newRoll, parsedRoll };
}
}

View file

@ -1,6 +1,7 @@
import D20RollDialog from '../applications/dialogs/d20RollDialog.mjs';
import D20Roll from './d20Roll.mjs';
import { setDiceSoNiceForDualityRoll } from '../helpers/utils.mjs';
import { getDiceSoNicePresets } from '../config/generalConfig.mjs';
export default class DualityRoll extends D20Roll {
_advantageFaces = 6;
@ -110,6 +111,13 @@ export default class DualityRoll extends D20Roll {
return [...(hooks ?? []), 'Duality'];
}
/** @inheritDoc */
static fromData(data) {
data.terms[0].class = game.system.api.dice.DualityDie.name;
data.terms[2].class = game.system.api.dice.DualityDie.name;
return super.fromData(data);
}
createBaseDice() {
if (
this.dice[0] instanceof CONFIG.Dice.daggerheart.DualityDie &&
@ -186,4 +194,44 @@ export default class DualityRoll extends D20Roll {
return data;
}
static async reroll(rollString, target, message) {
let parsedRoll = game.system.api.dice.DualityRoll.fromData({ ...rollString, evaluated: false });
const term = parsedRoll.terms[target.dataset.dieIndex];
await term.reroll(`/r1=${term.total}`);
if (game.modules.get('dice-so-nice')?.active) {
const diceSoNiceRoll = {
_evaluated: true,
dice: [
new foundry.dice.terms.Die({
...term,
faces: term._faces,
results: term.results.filter(x => !x.rerolled)
})
],
options: { appearance: {} }
};
const diceSoNicePresets = getDiceSoNicePresets();
const type = target.dataset.type;
if (diceSoNicePresets[type]) {
diceSoNiceRoll.dice[0].options = { appearance: diceSoNicePresets[type] };
}
await game.dice3d.showForRoll(diceSoNiceRoll, game.user, true);
}
await parsedRoll.evaluate();
const newRoll = game.system.api.dice.DualityRoll.postEvaluate(parsedRoll, {
targets: message.system.targets,
roll: {
advantage: message.system.roll.advantage?.type,
difficulty: message.system.roll.difficulty ? Number(message.system.roll.difficulty) : null
}
});
newRoll.extra = newRoll.extra.slice(2);
return { newRoll, parsedRoll };
}
}

View file

@ -48,7 +48,7 @@ function getDualityMessage(roll) {
>
<i class="fa-solid fa-circle-half-stroke"></i>
${label}
${roll.difficulty || advantageLabel ? `(${[roll.difficulty, game.i18n.localize(`DAGGERHEART.GENERAL.${advantageLabel}.short`)].filter(x => x).join(' ')})` : ''}
${roll.difficulty || advantageLabel ? `(${[roll.difficulty, advantageLabel ? game.i18n.localize(`DAGGERHEART.GENERAL.${advantageLabel}.short`) : null].filter(x => x).join(' ')})` : ''}
</button>
`;

View file

@ -1,19 +1,19 @@
@import '../../utils/fonts.less';
.application.daggerheart.dh-style {
.actions-list {
display: flex;
flex-direction: column;
gap: 10px;
.action-item {
display: flex;
align-items: center;
gap: 5px;
.label {
font-family: @font-body;
}
}
}
}
@import '../../utils/fonts.less';
.application.daggerheart.dh-style {
.actions-list {
display: flex;
flex-direction: column;
gap: 10px;
.action-item {
display: flex;
align-items: center;
gap: 5px;
.label {
font-family: @font-body;
}
}
}
}

View file

@ -1,104 +1,105 @@
@keyframes glow {
0% {
box-shadow: 0 0 1px 1px #f3c267;
}
100% {
box-shadow: 0 0 2px 2px #f3c267;
}
0% {
box-shadow: 0 0 1px 1px #f3c267;
}
100% {
box-shadow: 0 0 2px 2px #f3c267;
}
}
@keyframes glow-dark {
0% {
box-shadow: 0 0 1px 1px #18162e;
}
100% {
box-shadow: 0 0 2px 2px #18162e;
}
0% {
box-shadow: 0 0 1px 1px #18162e;
}
100% {
box-shadow: 0 0 2px 2px #18162e;
}
}
@font-face {
font-family: 'Cinzel';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(https://fonts.gstatic.com/s/cinzel/v25/8vIU7ww63mVu7gtR-kwKxNvkNOjw-tbnTYo.ttf) format('truetype');
font-family: 'Cinzel';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(https://fonts.gstatic.com/s/cinzel/v25/8vIU7ww63mVu7gtR-kwKxNvkNOjw-tbnTYo.ttf) format('truetype');
}
@font-face {
font-family: 'Cinzel';
font-style: normal;
font-weight: 700;
font-display: swap;
src: url(https://fonts.gstatic.com/s/cinzel/v25/8vIU7ww63mVu7gtR-kwKxNvkNOjw-jHgTYo.ttf) format('truetype');
font-family: 'Cinzel';
font-style: normal;
font-weight: 700;
font-display: swap;
src: url(https://fonts.gstatic.com/s/cinzel/v25/8vIU7ww63mVu7gtR-kwKxNvkNOjw-jHgTYo.ttf) format('truetype');
}
@font-face {
font-family: 'Cinzel Decorative';
font-style: normal;
font-weight: 700;
font-display: swap;
src: url(https://fonts.gstatic.com/s/cinzeldecorative/v18/daaHSScvJGqLYhG8nNt8KPPswUAPniZoaelD.ttf) format('truetype');
font-family: 'Cinzel Decorative';
font-style: normal;
font-weight: 700;
font-display: swap;
src: url(https://fonts.gstatic.com/s/cinzeldecorative/v18/daaHSScvJGqLYhG8nNt8KPPswUAPniZoaelD.ttf)
format('truetype');
}
@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(https://fonts.gstatic.com/s/montserrat/v30/JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCtr6Ew-.ttf) format('truetype');
font-family: 'Montserrat';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(https://fonts.gstatic.com/s/montserrat/v30/JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCtr6Ew-.ttf) format('truetype');
}
@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 600;
font-display: swap;
src: url(https://fonts.gstatic.com/s/montserrat/v30/JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCu170w-.ttf) format('truetype');
font-family: 'Montserrat';
font-style: normal;
font-weight: 600;
font-display: swap;
src: url(https://fonts.gstatic.com/s/montserrat/v30/JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCu170w-.ttf) format('truetype');
}
.application.sheet.daggerheart.dh-style h1 {
font-family: 'Cinzel Decorative', serif;
margin: 0;
border: none;
font-weight: normal;
font-family: 'Cinzel Decorative', serif;
margin: 0;
border: none;
font-weight: normal;
}
.application.sheet.daggerheart.dh-style h2,
.application.sheet.daggerheart.dh-style h3 {
font-family: 'Cinzel', serif;
margin: 0;
border: none;
font-weight: normal;
font-family: 'Cinzel', serif;
margin: 0;
border: none;
font-weight: normal;
}
.application.sheet.daggerheart.dh-style h4 {
font-family: 'Montserrat', sans-serif;
font-size: 14px;
border: none;
font-weight: 700;
margin: 0;
text-shadow: none;
color: #f3c267;
font-weight: normal;
font-family: 'Montserrat', sans-serif;
font-size: 14px;
border: none;
font-weight: 700;
margin: 0;
text-shadow: none;
color: #f3c267;
font-weight: normal;
}
.application.sheet.daggerheart.dh-style h5 {
font-size: 14px;
color: #f3c267;
margin: 0;
font-weight: normal;
font-size: 14px;
color: #f3c267;
margin: 0;
font-weight: normal;
}
.application.sheet.daggerheart.dh-style p,
.application.sheet.daggerheart.dh-style span {
font-family: 'Montserrat', sans-serif;
font-family: 'Montserrat', sans-serif;
}
.application.sheet.daggerheart.dh-style small {
font-family: 'Montserrat', sans-serif;
opacity: 0.8;
font-family: 'Montserrat', sans-serif;
opacity: 0.8;
}
.application.dh-style {
border: 1px solid light-dark(#18162e, #f3c267);
border: 1px solid light-dark(#18162e, #f3c267);
}
.application.dh-style input[type='text'],
.application.dh-style input[type='number'] {
background: light-dark(transparent, transparent);
border-radius: 6px;
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
backdrop-filter: blur(9.5px);
-webkit-backdrop-filter: blur(9.5px);
outline: none;
color: light-dark(#18162e, #f3c267);
border: 1px solid light-dark(#222, #efe6d8);
background: light-dark(transparent, transparent);
border-radius: 6px;
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
backdrop-filter: blur(9.5px);
-webkit-backdrop-filter: blur(9.5px);
outline: none;
color: light-dark(#18162e, #f3c267);
border: 1px solid light-dark(#222, #efe6d8);
}
.application.dh-style input[type='text']:hover[type='text'],
.application.dh-style input[type='number']:hover[type='text'],
@ -108,500 +109,510 @@
.application.dh-style input[type='number']:focus[type='text'],
.application.dh-style input[type='text']:focus[type='number'],
.application.dh-style input[type='number']:focus[type='number'] {
background: light-dark(rgba(0, 0, 0, 0.05), rgba(24, 22, 46, 0.33));
box-shadow: none;
outline: 2px solid light-dark(#222, #efe6d8);
background: light-dark(rgba(0, 0, 0, 0.05), rgba(24, 22, 46, 0.33));
box-shadow: none;
outline: 2px solid light-dark(#222, #efe6d8);
}
.application.dh-style input[type='text']:disabled[type='text'],
.application.dh-style input[type='number']:disabled[type='text'],
.application.dh-style input[type='text']:disabled[type='number'],
.application.dh-style input[type='number']:disabled[type='number'] {
outline: 2px solid transparent;
cursor: not-allowed;
outline: 2px solid transparent;
cursor: not-allowed;
}
.application.dh-style input[type='text']:disabled[type='text']:hover,
.application.dh-style input[type='number']:disabled[type='text']:hover,
.application.dh-style input[type='text']:disabled[type='number']:hover,
.application.dh-style input[type='number']:disabled[type='number']:hover {
background: transparent;
background: transparent;
}
.application.dh-style input[type='checkbox']:checked::after,
.application.dh-style input[type='radio']:checked::after {
color: light-dark(#222, #f3c267);
color: light-dark(#222, #f3c267);
}
.application.dh-style input[type='checkbox']:checked::before,
.application.dh-style input[type='radio']:checked::before {
color: light-dark(#22222240, #f3c26740);
color: light-dark(#22222240, #f3c26740);
}
.application.dh-style input[type='checkbox']::before,
.application.dh-style input[type='radio']::before {
color: light-dark(#22222240, #f3c26740);
color: light-dark(#22222240, #f3c26740);
}
.application.dh-style button {
background: light-dark(transparent, #f3c267);
border: 1px solid light-dark(#18162e, #18162e);
color: light-dark(#18162e, #18162e);
outline: none;
box-shadow: none;
background: light-dark(transparent, #f3c267);
border: 1px solid light-dark(#18162e, #18162e);
color: light-dark(#18162e, #18162e);
outline: none;
box-shadow: none;
}
.application.dh-style button:hover {
background: light-dark(rgba(0, 0, 0, 0.3), #18162e);
color: light-dark(#18162e, #f3c267);
background: light-dark(rgba(0, 0, 0, 0.3), #18162e);
color: light-dark(#18162e, #f3c267);
}
.application.dh-style button.glow {
animation: glow 0.75s infinite alternate;
animation: glow 0.75s infinite alternate;
}
.application.dh-style button:disabled {
background: light-dark(transparent, #f3c267);
color: light-dark(#18162e, #18162e);
opacity: 0.6;
cursor: not-allowed;
background: light-dark(transparent, #f3c267);
color: light-dark(#18162e, #18162e);
opacity: 0.6;
cursor: not-allowed;
}
.application.dh-style button:disabled:hover {
background: light-dark(transparent, #f3c267);
color: light-dark(#18162e, #18162e);
background: light-dark(transparent, #f3c267);
color: light-dark(#18162e, #18162e);
}
.application.dh-style select {
background: light-dark(transparent, transparent);
color: light-dark(#222, #efe6d8);
font-family: 'Montserrat', sans-serif;
outline: 2px solid transparent;
border: 1px solid light-dark(#222, #efe6d8);
background: light-dark(transparent, transparent);
color: light-dark(#222, #efe6d8);
font-family: 'Montserrat', sans-serif;
outline: 2px solid transparent;
border: 1px solid light-dark(#222, #efe6d8);
}
.application.dh-style select:focus,
.application.dh-style select:hover {
outline: 2px solid light-dark(#222, #efe6d8);
box-shadow: none;
outline: 2px solid light-dark(#222, #efe6d8);
box-shadow: none;
}
.application.dh-style select option,
.application.dh-style select optgroup {
color: #efe6d8;
background-color: #18162e;
border-radius: 6px;
color: #efe6d8;
background-color: #18162e;
border-radius: 6px;
}
.application.dh-style select:disabled {
opacity: 0.6;
outline: 2px solid transparent;
cursor: not-allowed;
opacity: 0.6;
outline: 2px solid transparent;
cursor: not-allowed;
}
.application.dh-style multi-select {
position: relative;
height: 34px;
position: relative;
height: 34px;
}
.application.dh-style multi-select .tags {
justify-content: flex-start;
margin: 4px;
height: inherit;
justify-content: flex-start;
margin: 4px;
height: inherit;
}
.application.dh-style multi-select .tags .tag {
padding: 0.3rem 0.5rem;
color: light-dark(#18162e, #f3c267);
background-color: light-dark(#18162e10, #f3c26740);
font-family: 'Montserrat', sans-serif;
border-radius: 3px;
transition: 0.13s ease-out;
gap: 0.5rem;
z-index: 1;
padding: 0.3rem 0.5rem;
color: light-dark(#18162e, #f3c267);
background-color: light-dark(#18162e10, #f3c26740);
font-family: 'Montserrat', sans-serif;
border-radius: 3px;
transition: 0.13s ease-out;
gap: 0.5rem;
z-index: 1;
}
.application.dh-style multi-select .tags .tag .remove {
font-size: 10px;
font-size: 10px;
}
.application.dh-style multi-select select {
position: absolute;
height: inherit;
outline: initial;
position: absolute;
height: inherit;
outline: initial;
}
.application.dh-style p {
margin: 0;
margin: 0;
}
.application.dh-style ul {
margin: 0;
padding: 0;
list-style: none;
margin: 0;
padding: 0;
list-style: none;
}
.application.dh-style li {
margin: 0;
margin: 0;
}
.application.dh-style a:hover,
.application.dh-style a.active {
font-weight: bold;
text-shadow: 0 0 8px light-dark(#18162e, #f3c267);
font-weight: bold;
text-shadow: 0 0 8px light-dark(#18162e, #f3c267);
}
.application.dh-style fieldset {
align-items: center;
margin-top: 5px;
border-radius: 6px;
border-color: light-dark(#18162e, #f3c267);
align-items: center;
margin-top: 5px;
border-radius: 6px;
border-color: light-dark(#18162e, #f3c267);
}
.application.dh-style fieldset.glassy {
background-color: light-dark(#18162e10, #f3c26710);
border-color: transparent;
background-color: light-dark(#18162e10, #f3c26710);
border-color: transparent;
}
.application.dh-style fieldset.glassy legend {
padding: 2px 12px;
border-radius: 3px;
background-color: light-dark(#18162e, #f3c267);
color: light-dark(#efe6d8, #18162e);
padding: 2px 12px;
border-radius: 3px;
background-color: light-dark(#18162e, #f3c267);
color: light-dark(#efe6d8, #18162e);
}
.application.dh-style fieldset.fit-height {
height: 95%;
height: 95%;
}
.application.dh-style fieldset.flex {
display: flex;
gap: 20px;
display: flex;
gap: 20px;
}
.application.dh-style fieldset.flex.wrap {
flex-wrap: wrap;
gap: 10px 20px;
flex-wrap: wrap;
gap: 10px 20px;
}
.application.dh-style fieldset.flex .inline-child {
flex: 1;
flex: 1;
}
.application.dh-style fieldset .list-w-img {
padding: 5px;
padding: 5px;
}
.application.dh-style fieldset .list-w-img label {
flex: 1;
flex: 1;
}
.application.dh-style fieldset .list-w-img img {
width: 2rem;
height: 2rem;
width: 2rem;
height: 2rem;
}
.application.dh-style fieldset.one-column {
display: flex;
flex-direction: column;
align-items: start;
gap: 10px;
min-height: 64px;
flex: 1;
display: flex;
flex-direction: column;
align-items: start;
gap: 10px;
min-height: 64px;
flex: 1;
}
.application.dh-style fieldset.one-column > .one-column {
width: 100%;
width: 100%;
}
.application.dh-style fieldset.two-columns {
display: grid;
grid-template-columns: 1fr 2fr;
gap: 10px;
display: grid;
grid-template-columns: 1fr 2fr;
gap: 10px;
}
.application.dh-style fieldset.two-columns.even {
grid-template-columns: 1fr 1fr;
grid-template-columns: 1fr 1fr;
}
.application.dh-style fieldset.two-columns .full-width {
grid-column: span 2;
grid-column: span 2;
}
.application.dh-style fieldset legend {
font-family: 'Montserrat', sans-serif;
font-weight: bold;
color: light-dark(#18162e, #f3c267);
font-family: 'Montserrat', sans-serif;
font-weight: bold;
color: light-dark(#18162e, #f3c267);
}
.application.dh-style fieldset input[type='text'],
.application.dh-style fieldset input[type='number'] {
color: light-dark(#222, #efe6d8);
font-family: 'Montserrat', sans-serif;
transition: all 0.3s ease;
outline: 2px solid transparent;
color: light-dark(#222, #efe6d8);
font-family: 'Montserrat', sans-serif;
transition: all 0.3s ease;
outline: 2px solid transparent;
}
.application.dh-style fieldset input[type='text']:focus,
.application.dh-style fieldset input[type='number']:focus,
.application.dh-style fieldset input[type='text']:hover,
.application.dh-style fieldset input[type='number']:hover {
outline: 2px solid light-dark(#222, #efe6d8);
outline: 2px solid light-dark(#222, #efe6d8);
}
.application.dh-style fieldset[disabled],
.application.dh-style fieldset.child-disabled .form-group,
.application.dh-style fieldset select[disabled],
.application.dh-style fieldset input[disabled] {
opacity: 0.5;
opacity: 0.5;
}
.application.dh-style fieldset.child-disabled .form-group {
pointer-events: none;
pointer-events: none;
}
.application.dh-style fieldset .nest-inputs {
display: flex;
align-items: center;
width: 100%;
gap: 5px;
display: flex;
align-items: center;
width: 100%;
gap: 5px;
}
.application.dh-style fieldset .nest-inputs .btn {
padding-top: 15px;
padding-top: 15px;
}
.application.dh-style fieldset .nest-inputs .image {
height: 40px;
width: 40px;
object-fit: cover;
border-radius: 6px;
border: none;
height: 40px;
width: 40px;
object-fit: cover;
border-radius: 6px;
border: none;
}
.application.dh-style fieldset .nest-inputs > .checkbox {
align-self: end;
align-self: end;
}
.application.dh-style fieldset .form-group {
width: 100%;
width: 100%;
}
.application.dh-style fieldset .form-group label {
font-family: 'Montserrat', sans-serif;
font-weight: bold;
font-size: smaller;
font-family: 'Montserrat', sans-serif;
font-weight: bold;
font-size: smaller;
}
.application.dh-style fieldset .form-group.checkbox {
width: fit-content;
display: flex;
align-items: center;
width: fit-content;
display: flex;
align-items: center;
}
.application.dh-style fieldset .form-group.checkbox .form-fields {
height: 32px;
align-content: center;
height: 32px;
align-content: center;
}
.application.dh-style fieldset:has(.list-w-img) {
gap: 0;
gap: 0;
}
.application.dh-style .two-columns {
display: grid;
grid-template-columns: 1fr 2fr;
gap: 10px;
display: grid;
grid-template-columns: 1fr 2fr;
gap: 10px;
}
.application.dh-style .two-columns.even {
grid-template-columns: 1fr 1fr;
grid-template-columns: 1fr 1fr;
}
.application.dh-style line-div {
display: block;
height: 1px;
width: 100%;
border-bottom: 1px solid light-dark(#18162e, #f3c267);
mask-image: linear-gradient(270deg, transparent 0%, black 50%, transparent 100%);
display: block;
height: 1px;
width: 100%;
border-bottom: 1px solid light-dark(#18162e, #f3c267);
mask-image: linear-gradient(270deg, transparent 0%, black 50%, transparent 100%);
}
.application.dh-style side-line-div {
display: block;
height: 1px;
width: 100%;
border-bottom: 1px solid light-dark(#18162e, #f3c267);
mask-image: linear-gradient(270deg, transparent 0%, black 100%);
display: block;
height: 1px;
width: 100%;
border-bottom: 1px solid light-dark(#18162e, #f3c267);
mask-image: linear-gradient(270deg, transparent 0%, black 100%);
}
.application.dh-style side-line-div.invert {
mask-image: linear-gradient(270deg, black 0%, transparent 100%);
mask-image: linear-gradient(270deg, black 0%, transparent 100%);
}
.application.dh-style .item-description {
opacity: 1;
transform: translateY(0);
grid-column: 1/-1;
transition: opacity 0.3s ease-out, transform 0.3s ease-out;
opacity: 1;
transform: translateY(0);
grid-column: 1/-1;
transition:
opacity 0.3s ease-out,
transform 0.3s ease-out;
}
.application.dh-style .item-description.invisible {
height: 0;
opacity: 0;
overflow: hidden;
transform: translateY(-20px);
transform-origin: top;
height: 0;
opacity: 0;
overflow: hidden;
transform: translateY(-20px);
transform-origin: top;
}
.application.dh-style .item-buttons {
grid-column: span 3;
display: flex;
gap: 8px;
flex-wrap: wrap;
grid-column: span 3;
display: flex;
gap: 8px;
flex-wrap: wrap;
}
.application.dh-style .item-buttons button {
white-space: nowrap;
white-space: nowrap;
}
.application.setting.dh-style fieldset h2,
.application.setting.dh-style fieldset h3,
.application.setting.dh-style fieldset h4 {
margin: 8px 0 4px;
text-align: center;
margin: 8px 0 4px;
text-align: center;
}
.application.setting.dh-style fieldset .title-hint {
font-size: 12px;
font-variant: small-caps;
text-align: center;
font-size: 12px;
font-variant: small-caps;
text-align: center;
}
.application.setting.dh-style fieldset .field-section .split-section {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}
.application.setting.dh-style fieldset .label-container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}
.application.setting.dh-style fieldset .label-container label {
align-self: center;
text-align: center;
align-self: center;
text-align: center;
}
.application.setting.dh-style footer {
margin-top: 8px;
display: flex;
gap: 8px;
margin-top: 8px;
display: flex;
gap: 8px;
}
.application.setting.dh-style footer button {
flex: 1;
flex: 1;
}
.application.setting.dh-style .form-group {
display: flex;
justify-content: space-between;
align-items: center;
display: flex;
justify-content: space-between;
align-items: center;
}
.application.setting.dh-style .form-group label {
font-size: 16px;
font-family: 'Montserrat', sans-serif;
font-size: 16px;
font-family: 'Montserrat', sans-serif;
}
.application.setting.dh-style .form-group .form-fields {
display: flex;
gap: 4px;
align-items: center;
display: flex;
gap: 4px;
align-items: center;
}
.system-daggerheart .tagify {
background: light-dark(transparent, transparent);
border: 1px solid light-dark(#222, #efe6d8);
height: 34px;
--tags-disabled-bg: none;
--tags-border-color: none;
--tags-hover-border-color: none;
--tags-focus-border-color: none;
--tag-border-radius: 3px;
--tag-bg: light-dark(#18162e, #f3c267);
--tag-remove-btn-color: light-dark(#18162e, #f3c267);
--tag-hover: light-dark(#18162e, #f3c267);
--tag-text-color: light-dark(#efe6d8, #222);
--tag-text-color--edit: light-dark(#efe6d8, #222);
--tag-pad: 0.3em 0.5em;
--tag-inset-shadow-size: 1.2em;
--tag-invalid-color: #d39494;
--tag-invalid-bg: rgba(211, 148, 148, 0.5);
--tag--min-width: 1ch;
--tag--max-width: 100%;
--tag-hide-transition: 0.3s;
--tag-remove-bg: light-dark(#18162e40, #f3c26740);
--tag-remove-btn-color: light-dark(#efe6d8, #222);
--tag-remove-btn-bg: none;
--tag-remove-btn-bg--hover: light-dark(#efe6d8, #222);
--input-color: inherit;
--placeholder-color: light-dark(#efe6d815, #22222215);
--placeholder-color-focus: light-dark(#efe6d815, #22222215);
--loader-size: 0.8em;
--readonly-striped: 1;
border-radius: 3px;
margin-right: 1px;
background: light-dark(transparent, transparent);
border: 1px solid light-dark(#222, #efe6d8);
height: 34px;
--tags-disabled-bg: none;
--tags-border-color: none;
--tags-hover-border-color: none;
--tags-focus-border-color: none;
--tag-border-radius: 3px;
--tag-bg: light-dark(#18162e, #f3c267);
--tag-remove-btn-color: light-dark(#18162e, #f3c267);
--tag-hover: light-dark(#18162e, #f3c267);
--tag-text-color: light-dark(#efe6d8, #222);
--tag-text-color--edit: light-dark(#efe6d8, #222);
--tag-pad: 0.3em 0.5em;
--tag-inset-shadow-size: 1.2em;
--tag-invalid-color: #d39494;
--tag-invalid-bg: rgba(211, 148, 148, 0.5);
--tag--min-width: 1ch;
--tag--max-width: 100%;
--tag-hide-transition: 0.3s;
--tag-remove-bg: light-dark(#18162e40, #f3c26740);
--tag-remove-btn-color: light-dark(#efe6d8, #222);
--tag-remove-btn-bg: none;
--tag-remove-btn-bg--hover: light-dark(#efe6d8, #222);
--input-color: inherit;
--placeholder-color: light-dark(#efe6d815, #22222215);
--placeholder-color-focus: light-dark(#efe6d815, #22222215);
--loader-size: 0.8em;
--readonly-striped: 1;
border-radius: 3px;
margin-right: 1px;
}
.system-daggerheart .tagify tag div {
display: flex;
justify-content: space-between;
align-items: center;
height: 22px;
display: flex;
justify-content: space-between;
align-items: center;
height: 22px;
}
.system-daggerheart .tagify tag div span {
font-weight: 400;
font-weight: 400;
}
.system-daggerheart .tagify tag div img {
margin-left: 8px;
height: 20px;
width: 20px;
margin-left: 8px;
height: 20px;
width: 20px;
}
.system-daggerheart .tagify__dropdown {
border: 1px solid light-dark(#222, #efe6d8) !important;
font-family: 'Montserrat', sans-serif;
color: light-dark(#222, #efe6d8);
border: 1px solid light-dark(#222, #efe6d8) !important;
font-family: 'Montserrat', sans-serif;
color: light-dark(#222, #efe6d8);
}
.system-daggerheart .tagify__dropdown .tagify__dropdown__wrapper {
background-image: url(../assets/parchments/dh-parchment-dark.png);
background-color: transparent;
border: 0;
color: light-dark(#222, #efe6d8);
background-image: url(../assets/parchments/dh-parchment-dark.png);
background-color: transparent;
border: 0;
color: light-dark(#222, #efe6d8);
}
.system-daggerheart .tagify__dropdown .tagify__dropdown__wrapper .tagify__dropdown__item--active {
background-color: light-dark(#222, #efe6d8);
color: light-dark(#efe6d8, #222);
background-color: light-dark(#222, #efe6d8);
color: light-dark(#efe6d8, #222);
}
.system-daggerheart.theme-light .tagify__dropdown .tagify__dropdown__wrapper {
background-image: url(../assets/parchments/dh-parchment-light.png);
background-image: url(../assets/parchments/dh-parchment-light.png);
}
.theme-light .application.sheet.dh-style button.glow {
animation: glow-dark 0.75s infinite alternate;
animation: glow-dark 0.75s infinite alternate;
}
.theme-light .application .component.dh-style.card-preview-container {
background-image: url('../assets/parchments/dh-parchment-light.png');
background-image: url('../assets/parchments/dh-parchment-light.png');
}
.theme-light .application .component.dh-style.card-preview-container .preview-text-container {
background-image: url(../assets/parchments/dh-parchment-dark.png);
background-image: url(../assets/parchments/dh-parchment-dark.png);
}
.theme-light .application .component.dh-style.card-preview-container .preview-selected-icon-container {
background-image: url(../assets/parchments/dh-parchment-dark.png);
color: var(--color-light-5);
background-image: url(../assets/parchments/dh-parchment-dark.png);
color: var(--color-light-5);
}
.application .component.dh-style.card-preview-container {
position: relative;
border-radius: 6px;
border: 2px solid var(--color-tabs-border);
display: flex;
flex-direction: column;
aspect-ratio: 0.75;
background-image: url('../assets/parchments/dh-parchment-dark.png');
position: relative;
border-radius: 6px;
border: 2px solid var(--color-tabs-border);
display: flex;
flex-direction: column;
aspect-ratio: 0.75;
background-image: url('../assets/parchments/dh-parchment-dark.png');
}
.application .component.dh-style.card-preview-container.selectable {
cursor: pointer;
cursor: pointer;
}
.application .component.dh-style.card-preview-container.disabled {
pointer-events: none;
opacity: 0.4;
pointer-events: none;
opacity: 0.4;
}
.application .component.dh-style.card-preview-container .preview-image-outer-container {
position: relative;
display: flex;
align-items: center;
justify-content: center;
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
.application .component.dh-style.card-preview-container .preview-image-container {
flex: 1;
border-radius: 4px 4px 0 0;
flex: 1;
border-radius: 4px 4px 0 0;
}
.application .component.dh-style.card-preview-container .preview-text-container {
flex: 1;
border-radius: 0 0 4px 4px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 18px;
text-align: center;
color: var(--color-text-selection-bg);
background-image: url(../assets/parchments/dh-parchment-light.png);
flex: 1;
border-radius: 0 0 4px 4px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 18px;
text-align: center;
color: var(--color-text-selection-bg);
background-image: url(../assets/parchments/dh-parchment-light.png);
}
.application .component.dh-style.card-preview-container .preview-empty-container {
pointer-events: none;
position: relative;
display: flex;
align-items: center;
justify-content: center;
flex: 1;
pointer-events: none;
position: relative;
display: flex;
align-items: center;
justify-content: center;
flex: 1;
}
.application .component.dh-style.card-preview-container .preview-empty-container .preview-empty-inner-container {
width: 100%;
display: flex;
justify-content: center;
width: 100%;
display: flex;
justify-content: center;
}
.application .component.dh-style.card-preview-container .preview-empty-container .preview-empty-inner-container .preview-add-icon {
font-size: 48px;
.application
.component.dh-style.card-preview-container
.preview-empty-container
.preview-empty-inner-container
.preview-add-icon {
font-size: 48px;
}
.application .component.dh-style.card-preview-container .preview-empty-container .preview-empty-inner-container .preview-empty-subtext {
position: absolute;
top: 10%;
font-size: 18px;
font-variant: small-caps;
text-align: center;
.application
.component.dh-style.card-preview-container
.preview-empty-container
.preview-empty-inner-container
.preview-empty-subtext {
position: absolute;
top: 10%;
font-size: 18px;
font-variant: small-caps;
text-align: center;
}
.application .component.dh-style.card-preview-container .preview-selected-icon-container {
position: absolute;
height: 54px;
width: 54px;
border-radius: 50%;
border: 2px solid;
font-size: 48px;
display: flex;
align-items: center;
justify-content: center;
background-image: url(../assets/parchments/dh-parchment-light.png);
color: var(--color-dark-5);
position: absolute;
height: 54px;
width: 54px;
border-radius: 50%;
border: 2px solid;
font-size: 48px;
display: flex;
align-items: center;
justify-content: center;
background-image: url(../assets/parchments/dh-parchment-light.png);
color: var(--color-dark-5);
}
.application .component.dh-style.card-preview-container .preview-selected-icon-container i {
position: relative;
right: 2px;
position: relative;
right: 2px;
}

View file

@ -44,7 +44,35 @@
&.duality {
display: flex;
gap: 0.25rem;
> .roll {
background-image: none;
.reroll-button {
border: none;
background: initial;
width: 42px;
&:hover {
background: var(--button-background-color);
border: 1px solid var(--button-border-color);
}
}
}
}
&.rerollable {
.reroll-button {
border: none;
background: initial;
&:hover {
background: var(--button-background-color);
border: 1px solid var(--button-border-color);
}
}
}
// margin: 0;
> .roll {
display: flex;
@ -52,6 +80,7 @@
justify-content: center;
gap: 4px;
margin-bottom: 4px;
.dice-container {
display: flex;
flex-direction: column;

View file

@ -12,16 +12,13 @@
<span class="part-total">{{total}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls">
{{#each results}}
<li class="roll die {{../dice}}{{#if discarded}} discarded{{/if}} min">{{result}}</li>
{{/each}}
<ol class="dice-rolls rerollable">
<button type="checkbox" class="reroll-button" data-die-index="0" data-tooltip="{{localize "DAGGERHEART.GENERAL.reroll"}}">
{{#each results as |result index|}}
<li class="roll die {{../dice}}{{#if discarded}} discarded{{/if}} min">{{result.result}}</li>
{{/each}}
</button>
</ol>
{{#if (eq index 0)}}
<div class="attack-roll-advantage-container">
{{#if (eq ../roll.advantage.type 1)}}{{localize "DAGGERHEART.GENERAL.Advantage.full"}}{{/if}}{{#if (eq ../roll.advantage.type -1)}}{{localize "DAGGERHEART.GENERAL.Disadvantage.full"}}{{/if}}
</div>
{{/if}}
</div>
{{/each}}
</div>

View file

@ -1,6 +1,6 @@
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
<div class="dice-flavor">{{title}}</div>
<div class="duality-modifiers">
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
<div class="dice-flavor" data-action="expandRoll">{{title}}</div>
<div class="duality-modifiers" data-action="expandRoll">
{{#each roll.modifiers}}
<div class="duality-modifier">
{{localize label}} {{#if (gte value 0)}}+{{/if}}{{value}}
@ -22,12 +22,12 @@
</div>
{{/if}}
</div>
<div class="dice-result">
<div class="dice-formula">{{roll.formula}}</div>
<div class="dice-result">
<div class="dice-formula" data-action="expandRoll">{{roll.formula}}</div>
<div class="dice-tooltip">
<div class="wrapper">
<section class="tooltip-part">
<div class="dice">
<div class="dice" data-action="expandRoll">
<header class="part-header flexrow">
<span class="part-formula">
<span>1{{roll.hope.dice}}</span>
@ -38,25 +38,29 @@
</header>
<div class="flexrow">
<ol class="dice-rolls duality">
<li class="roll die {{roll.hope.dice}}" title="{{localize "DAGGERHEART.GENERAL.hope"}}">
<li class="roll die {{roll.hope.dice}}">
<div class="dice-container">
<div class="dice-title">{{localize "DAGGERHEART.GENERAL.hope"}}</div>
<div class="dice-inner-container hope" title="{{localize "DAGGERHEART.GENERAL.hope"}}">
<div class="dice-wrapper">
<img class="dice" src="../icons/svg/{{roll.hope.dice}}-grey.svg"/>
</div>
<div class="dice-value">{{roll.hope.value}}</div>
<div class="dice-inner-container hope" data-tooltip="{{localize "DAGGERHEART.GENERAL.rerollThing" thing=(localize "DAGGERHEART.GENERAL.hope")}}">
<button type="checkbox" class="reroll-button" data-die-index="0" data-type="hope">
<div class="dice-wrapper">
<img class="dice" src="../icons/svg/{{roll.hope.dice}}-grey.svg"/>
</div>
<div class="dice-value">{{roll.hope.value}}</div>
</button>
</div>
</div>
</li>
<li class="roll die {{roll.fear.dice}}" title="{{localize "DAGGERHEART.GENERAL.fear"}}">
<li class="roll die {{roll.fear.dice}}">
<div class="dice-container">
<div class="dice-title">{{localize "DAGGERHEART.GENERAL.fear"}}</div>
<div class="dice-inner-container fear" title="{{localize "DAGGERHEART.GENERAL.fear"}}">
<div class="dice-wrapper">
<img class="dice" src="../icons/svg/{{roll.fear.dice}}-grey.svg"/>
</div>
<div class="dice-value">{{roll.fear.value}}</div>
<div class="dice-inner-container fear" data-tooltip="{{localize "DAGGERHEART.GENERAL.rerollThing" thing=(localize "DAGGERHEART.GENERAL.fear")}}">
<button type="checkbox" class="reroll-button" data-die-index="2" data-type="fear">
<div class="dice-wrapper">
<img class="dice" src="../icons/svg/{{roll.fear.dice}}-grey.svg"/>
</div>
<div class="dice-value">{{roll.fear.value}}</div>
</button>
</div>
</div>
</li>
@ -64,7 +68,7 @@
</div>
</div>
{{#if roll.advantage.type}}
<div class="dice">
<div class="dice" data-action="expandRoll">
<header class="part-header flexrow">
<span class="part-formula">
<span>1{{roll.advantage.dice}}</span>
@ -112,7 +116,7 @@
</div>
{{/if}}
{{#each roll.extra as | extra | }}
<div class="dice">
<div class="dice" data-action="expandRoll">
<header class="part-header flexrow">
<span class="part-formula">
<span>1{{extra.dice}}</span>
@ -200,4 +204,4 @@
</div>
</div>
</div>
</div>
</div>