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

View file

@ -1339,6 +1339,8 @@
"quantity": "Quantity", "quantity": "Quantity",
"range": "Range", "range": "Range",
"recovery": "Recovery", "recovery": "Recovery",
"reroll": "Reroll",
"rerollThing": "Reroll {thing}",
"resource": "Resource", "resource": "Resource",
"roll": "Roll", "roll": "Roll",
"rollAll": "Roll All", "rollAll": "Roll All",
@ -1615,6 +1617,10 @@
"title": "Heal - {healing}", "title": "Heal - {healing}",
"heal": "Heal" "heal": "Heal"
}, },
"reroll": {
"confirmTitle": "Reroll Dice",
"confirmText": "Are you sure you want to reroll?"
},
"resourceRoll": { "resourceRoll": {
"playerMessage": "{user} rerolled their {name}" "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 => html.querySelectorAll('.target-indicator').forEach(element =>
element.addEventListener('click', this.onToggleTargets) 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 => 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 => 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) { async getActor(id) {
// return game.actors.get(id);
return await fromUuid(id); return await fromUuid(id);
} }
@ -85,7 +81,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
return action; return action;
} }
onRollDamage = async (event, message) => { async onRollDamage(event, message) {
event.stopPropagation(); event.stopPropagation();
const actor = await this.getActor(message.system.source.actor); const actor = await this.getActor(message.system.source.actor);
if (game.user.character?.id !== actor.id && !game.user.isGM) return true; 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; if (!action || !action?.rollDamage) return;
await action.rollDamage(event, message); await action.rollDamage(event, message);
} }
}; }
onRollHealing = async (event, message) => { async onRollHealing(event, message) {
event.stopPropagation(); event.stopPropagation();
const actor = await this.getActor(message.system.source.actor); const actor = await this.getActor(message.system.source.actor);
if (!actor || !game.user.isGM) return true; 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; if (!action || !action?.rollHealing) return;
await action.rollHealing(event, message); await action.rollHealing(event, message);
} }
}; }
onRollSave = async (event, message) => { async onRollSave(event, message) {
event.stopPropagation(); event.stopPropagation();
const actor = await this.getActor(message.system.source.actor), const actor = await this.getActor(message.system.source.actor),
tokenId = event.target.closest('[data-token]')?.dataset.token, 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; if (!action || !action?.hasSave) return;
action.rollSave(token, event, message); action.rollSave(token, event, message);
} }
}; }
onRollAllSave = async (event, message) => { onRollAllSave(event, _message) {
event.stopPropagation(); event.stopPropagation();
const targets = event.target.parentElement.querySelectorAll( const targets = event.target.parentElement.querySelectorAll(
'.target-section > [data-token] .target-save-container' '.target-section > [data-token] .target-save-container'
@ -128,9 +124,9 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
targets.forEach(el => { targets.forEach(el => {
el.dispatchEvent(new PointerEvent('click', { shiftKey: true })); el.dispatchEvent(new PointerEvent('click', { shiftKey: true }));
}); });
}; }
onApplyEffect = async (event, message) => { async onApplyEffect(event, message) {
event.stopPropagation(); event.stopPropagation();
const actor = await this.getActor(message.system.source.actor); const actor = await this.getActor(message.system.source.actor);
if (!actor || !game.user.isGM) return true; 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')); ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelected'));
await action.applyEffects(event, message, targets); await action.applyEffects(event, message, targets);
} }
}; }
onTargetSelection = async (event, message) => { onTargetSelection(event, message) {
event.stopPropagation(); event.stopPropagation();
const targetSelection = Boolean(event.target.dataset.targetHit), const targetSelection = Boolean(event.target.dataset.targetHit),
msg = ui.chat.collection.get(message._id); 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.targetSelection = targetSelection;
msg.system.prepareDerivedData(); msg.system.prepareDerivedData();
ui.chat.updateMessage(msg); ui.chat.updateMessage(msg);
}; }
getTargetList = (event, message) => { getTargetList(event, message) {
const targetSelection = event.target const targetSelection = event.target
.closest('.message-content') .closest('.message-content')
.querySelector('.button-target-selection.target-selected'), .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)) ? message.system.targets.filter(t => t.hit === true).map(target => game.canvas.tokens.get(target.id))
: Array.from(game.user.targets) : Array.from(game.user.targets)
}; };
}; }
hoverTarget = event => { hoverTarget(event) {
event.stopPropagation(); event.stopPropagation();
const token = canvas.tokens.get(event.currentTarget.dataset.token); const token = canvas.tokens.get(event.currentTarget.dataset.token);
if (!token?.controlled) token._onHoverIn(event, { hoverOutOthers: true }); if (!token?.controlled) token._onHoverIn(event, { hoverOutOthers: true });
}; }
unhoverTarget = event => { unhoverTarget(event) {
const token = canvas.tokens.get(event.currentTarget.dataset.token); const token = canvas.tokens.get(event.currentTarget.dataset.token);
if (!token?.controlled) token._onHoverOut(event); if (!token?.controlled) token._onHoverOut(event);
}; }
clickTarget = event => { clickTarget(event) {
event.stopPropagation(); event.stopPropagation();
const token = canvas.tokens.get(event.currentTarget.dataset.token); const token = canvas.tokens.get(event.currentTarget.dataset.token);
if (!token) { if (!token) {
@ -188,9 +184,9 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
return; return;
} }
game.canvas.pan(token); game.canvas.pan(token);
}; }
onDamage = async (event, message) => { async onDamage(event, message) {
event.stopPropagation(); event.stopPropagation();
const { isHit, targets } = this.getTargetList(event, message); 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); target.actor.takeDamage(damages);
} }
}; }
onHealing = async (event, message) => { async onHealing(event, message) {
event.stopPropagation(); event.stopPropagation();
const targets = Array.from(game.user.targets); 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) { for (var target of targets) {
target.actor.takeHealing(message.system.roll); target.actor.takeHealing(message.system.roll);
} }
}; }
/** /**
* Toggle visibility of target containers. * 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')); .forEach(el => el.classList.toggle('hidden'));
} }
/** async abilityUseButton(event, message) {
* 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) => {
event.stopPropagation(); event.stopPropagation();
const action = message.system.actions[Number.parseInt(event.currentTarget.dataset.index)]; const action = message.system.actions[Number.parseInt(event.currentTarget.dataset.index)];
const actor = game.actors.get(message.system.source.actor); const actor = game.actors.get(message.system.source.actor);
await actor.useAction(action); await actor.useAction(action);
}; }
actionUseButton = async (event, message) => { async actionUseButton(event, message) {
const { moveIndex, actionIndex } = event.currentTarget.dataset; const { moveIndex, actionIndex } = event.currentTarget.dataset;
const parent = await foundry.utils.fromUuid(message.system.actor); const parent = await foundry.utils.fromUuid(message.system.actor);
const actionType = message.system.moves[moveIndex].actions[actionIndex]; 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); 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() { static defineSchema() {
return { return {
title: new fields.StringField(), title: new fields.StringField(),
roll: new fields.DataField(), roll: new fields.ObjectField(),
targets: new fields.ArrayField( targets: new fields.ArrayField(
new fields.SchemaField({ new fields.SchemaField({
id: new fields.StringField({}), id: new fields.StringField({}),

View file

@ -26,10 +26,7 @@ const stressDamageReductionRule = localizationPath =>
const bonusField = label => const bonusField = label =>
new fields.SchemaField({ new fields.SchemaField({
bonus: new fields.NumberField({ integer: true, initial: 0, label: `${game.i18n.localize(label)} Value` }), bonus: new fields.NumberField({ integer: true, initial: 0, label: `${game.i18n.localize(label)} Value` }),
dice: new fields.ArrayField( dice: new fields.ArrayField(new fields.StringField(), { label: `${game.i18n.localize(label)} Dice` })
new fields.StringField(),
{ label: `${game.i18n.localize(label)} Dice` }
)
}); });
export { attributeField, resourceField, stressDamageReductionRule, bonusField }; 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; const difficulty = config.roll.difficulty ?? target.difficulty ?? target.evasion;
target.hit = this.isCritical || roll.total >= difficulty; 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 = { data.advantage = {
type: config.roll.advantage, type: config.roll.advantage,
dice: roll.dAdvantage?.denomination, dice: roll.dAdvantage?.denomination,
@ -169,4 +172,22 @@ export default class D20Roll extends DHRoll {
resetFormula() { resetFormula() {
return (this._formula = this.constructor.getFormula(this.terms)); 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 D20RollDialog from '../applications/dialogs/d20RollDialog.mjs';
import D20Roll from './d20Roll.mjs'; import D20Roll from './d20Roll.mjs';
import { setDiceSoNiceForDualityRoll } from '../helpers/utils.mjs'; import { setDiceSoNiceForDualityRoll } from '../helpers/utils.mjs';
import { getDiceSoNicePresets } from '../config/generalConfig.mjs';
export default class DualityRoll extends D20Roll { export default class DualityRoll extends D20Roll {
_advantageFaces = 6; _advantageFaces = 6;
@ -110,6 +111,13 @@ export default class DualityRoll extends D20Roll {
return [...(hooks ?? []), 'Duality']; 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() { createBaseDice() {
if ( if (
this.dice[0] instanceof CONFIG.Dice.daggerheart.DualityDie && this.dice[0] instanceof CONFIG.Dice.daggerheart.DualityDie &&
@ -186,4 +194,44 @@ export default class DualityRoll extends D20Roll {
return data; 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> <i class="fa-solid fa-circle-half-stroke"></i>
${label} ${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> </button>
`; `;

View file

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

View file

@ -44,7 +44,35 @@
&.duality { &.duality {
display: flex; display: flex;
gap: 0.25rem; 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; // margin: 0;
> .roll { > .roll {
display: flex; display: flex;
@ -52,6 +80,7 @@
justify-content: center; justify-content: center;
gap: 4px; gap: 4px;
margin-bottom: 4px; margin-bottom: 4px;
.dice-container { .dice-container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View file

@ -12,16 +12,13 @@
<span class="part-total">{{total}}</span> <span class="part-total">{{total}}</span>
</header> </header>
<div class="flexrow"> <div class="flexrow">
<ol class="dice-rolls"> <ol class="dice-rolls rerollable">
{{#each results}} <button type="checkbox" class="reroll-button" data-die-index="0" data-tooltip="{{localize "DAGGERHEART.GENERAL.reroll"}}">
<li class="roll die {{../dice}}{{#if discarded}} discarded{{/if}} min">{{result}}</li> {{#each results as |result index|}}
{{/each}} <li class="roll die {{../dice}}{{#if discarded}} discarded{{/if}} min">{{result.result}}</li>
{{/each}}
</button>
</ol> </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> </div>
{{/each}} {{/each}}
</div> </div>

View file

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