Compare commits

...

7 commits

Author SHA1 Message Date
WBHarry
5dbcd94480 Raised version
Some checks failed
Project CI / build (24.x) (push) Has been cancelled
2026-06-01 22:22:50 +02:00
WBHarry
d98a7c951e
[Fix] Tooltip Color Scope (#1964)
* Added DH style to tooltips

* Setting dh-style for ResourceManagementTooltip and ArmorManagementTooltip
2026-06-01 22:20:06 +02:00
WBHarry
3c36c5747d
[Fix] Base Attack Context Menu (#1961)
* Fixed Adversary standard attack context menu

* Fixed Character base attack context menu

* Fixed Companion base attack context menu
2026-06-01 22:02:42 +02:00
WBHarry
bcf274f1d0
[Fix] ChatMessage Saves Pending Confirmation (#1963) 2026-06-01 15:59:44 -04:00
WBHarry
df4a2c5d57
Fixed Countdown.migrationData assuming an array when it's actually an object (#1962) 2026-06-01 15:53:28 -04:00
WBHarry
646ebc8bdf
Added a temp fix for status effect rows (#1965) 2026-06-01 15:52:27 -04:00
WBHarry
6448666579 Updated combat contextmenu 2026-06-01 19:47:06 +02:00
13 changed files with 147 additions and 20 deletions

View file

@ -711,9 +711,9 @@
}, },
"PendingReactionsDialog": { "PendingReactionsDialog": {
"title": "Pending Reaction Rolls Found", "title": "Pending Reaction Rolls Found",
"unfinishedRolls": "Some Tokens still need to roll their Reaction Roll.", "unfinishedRolls": "Some Tokens have not finished their Reaction Rolls.",
"confirmation": "Are you sure you want to continue ?", "warning": "Unfinished reaction rolls will be considered as failed.",
"warning": "Undone reaction rolls will be considered as failed" "confirmation": "Are you sure you want to continue?"
}, },
"ReactionRoll": { "ReactionRoll": {
"title": "Reaction Roll: {trait}" "title": "Reaction Roll: {trait}"

View file

@ -31,6 +31,16 @@ export default class AdversarySheet extends DHBaseActorSheet {
dragSelector: '[data-item-id][draggable="true"], [data-item-id] [draggable="true"]', dragSelector: '[data-item-id][draggable="true"], [data-item-id] [draggable="true"]',
dropSelector: null dropSelector: null
} }
],
contextMenus: [
{
handler: DHBaseActorSheet.getBaseAttackContextOptions,
selector: '[data-item-uuid][data-type="attack"]',
options: {
parentClassHooks: false,
fixed: true
}
}
] ]
}; };

View file

@ -65,6 +65,14 @@ export default class CharacterSheet extends DHBaseActorSheet {
fixed: true fixed: true
} }
}, },
{
handler: DHBaseActorSheet.getBaseAttackContextOptions,
selector: '[data-item-uuid][data-type="attack"]',
options: {
parentClassHooks: false,
fixed: true
}
},
{ {
handler: CharacterSheet.#getDomainCardContextOptions, handler: CharacterSheet.#getDomainCardContextOptions,
selector: '[data-item-uuid][data-type="domainCard"]', selector: '[data-item-uuid][data-type="domainCard"]',
@ -1045,7 +1053,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
game.tooltip.activate(target, { game.tooltip.activate(target, {
html, html,
locked: true, locked: true,
cssClass: 'bordered-tooltip', cssClass: 'bordered-tooltip dh-style',
direction: 'DOWN' direction: 'DOWN'
}); });
@ -1141,7 +1149,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
game.tooltip.activate(target, { game.tooltip.activate(target, {
html, html,
locked: true, locked: true,
cssClass: 'bordered-tooltip', cssClass: 'bordered-tooltip dh-style',
direction: 'DOWN', direction: 'DOWN',
noOffset: true noOffset: true
}); });

View file

@ -11,7 +11,17 @@ export default class DhCompanionSheet extends DHBaseActorSheet {
toggleStress: DhCompanionSheet.#toggleStress, toggleStress: DhCompanionSheet.#toggleStress,
actionRoll: DhCompanionSheet.#actionRoll, actionRoll: DhCompanionSheet.#actionRoll,
levelManagement: DhCompanionSheet.#levelManagement levelManagement: DhCompanionSheet.#levelManagement
} },
contextMenus: [
{
handler: DHBaseActorSheet.getBaseAttackContextOptions,
selector: '[data-item-uuid][data-type="attack"]',
options: {
parentClassHooks: false,
fixed: true
}
}
]
}; };
static PARTS = { static PARTS = {

View file

@ -189,6 +189,43 @@ export default class DHBaseActorSheet extends DHApplicationMixin(ActorSheetV2) {
return this._getContextMenuCommonOptions.call(this, { usable: true, toChat: true }); return this._getContextMenuCommonOptions.call(this, { usable: true, toChat: true });
} }
/**
* Get the set of ContextMenu options for the base attack.
* @returns {import('@client/applications/ux/context-menu.mjs').ContextMenuEntry[]} - The Array of context options passed to the ContextMenu instance
* @this {CharacterSheet}
* @protected
*/
static getBaseAttackContextOptions() {
/**@type {import('@client/applications/ux/context-menu.mjs').ContextMenuEntry[]} */
return [
{
label: 'DAGGERHEART.CONFIG.RollTypes.attack.name',
icon: 'fa-solid fa-burst',
onClick: async (event, target) => (await getDocFromElement(target)).use(event)
},
{
label: 'DAGGERHEART.GENERAL.damage',
icon: 'fa-solid fa-explosion',
onClick: async (event, target) => {
const doc = await getDocFromElement(target),
action = doc?.system?.attack ?? doc;
const config = action.prepareConfig(event);
config.effects = await game.system.api.data.actions.actionsTypes.base.getEffects(
this.document,
doc
);
config.hasRoll = false;
return action && action.workflow.get('damage').execute(config, null, true);
}
},
{
label: 'DAGGERHEART.APPLICATIONS.ContextMenu.sendToChat',
icon: 'fa-solid fa-message',
onClick: async (_, target) => (await getDocFromElement(target)).toChat(this.document.uuid)
}
];
}
/* -------------------------------------------- */ /* -------------------------------------------- */
/* Application Listener Actions */ /* Application Listener Actions */
/* -------------------------------------------- */ /* -------------------------------------------- */

View file

@ -84,19 +84,49 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
}); });
} }
/**
* Open the dialog used to edit the name of the currently viewed Combat encounter.
* @this {CombatTracker}
* @returns {Promise<void>}
*/
static async #onEditName() {
const combat = this.viewed;
if (!combat || !game.user.isGM) return null;
const field = combat.schema.fields.name;
const inputHTML = field.toFormGroup({}, { name: 'name', value: combat.name, autofocus: true }).outerHTML;
const formData = await foundry.applications.api.DialogV2.input({
window: { icon: 'fa-solid fa-tag', title: 'COMBAT.ACTIONS.EditNameTitle' },
position: { width: 480 },
content: inputHTML
});
await combat.update({ name: formData.name || '' });
}
_getCombatContextOptions() { _getCombatContextOptions() {
return [ return [
{ {
label: 'COMBAT.ClearMovementHistories', label: 'COMBAT.ACTIONS.EditName',
icon: '<i class="fa-solid fa-shoe-prints"></i>', icon: 'fa-solid fa-tag',
visible: () => game.user.isGM && this.viewed?.combatants.size > 0, visible: () => game.user.isGM && !!this.viewed,
callback: () => this.viewed.clearMovementHistories() onClick: () => DhCombatTracker.#onEditName.call(this)
}, },
{ {
label: 'COMBAT.Delete', label: 'COMBAT.ACTIONS.LinkToScene',
icon: '<i class="fa-solid fa-trash"></i>', icon: '<i class="fa-solid fa-link"></i>',
visible: () => game.user.isGM && !this.scene,
onClick: () => this.viewed.toggleSceneLink()
},
{
label: 'COMBAT.ACTIONS.UnlinkFromScene',
icon: '<i class="fa-solid fa-unlink"></i>',
visible: () => game.user.isGM && !!this.scene,
onClick: () => this.viewed.toggleSceneLink()
},
{
label: 'COMBAT.End',
icon: 'fa-solid fa-xmark',
visible: () => game.user.isGM && !!this.viewed, visible: () => game.user.isGM && !!this.viewed,
callback: () => this.viewed.endCombat() onClick: () => this.viewed.endCombat()
} }
]; ];
} }

View file

@ -75,7 +75,12 @@ export default class DHAttackAction extends DHDamageAction {
const useAltDamage = this.actor?.effects?.find(x => x.type === 'horde')?.active; const useAltDamage = this.actor?.effects?.find(x => x.type === 'horde')?.active;
for (const { value, valueAlt, type } of damage.parts) { for (const { value, valueAlt, type } of damage.parts) {
const usedValue = useAltDamage ? valueAlt : value; const usedValue = useAltDamage ? valueAlt : value;
const str = Roll.replaceFormulaData(usedValue.getFormula(), this.actor?.getRollData() ?? {}); const damageString = Roll.replaceFormulaData(usedValue.getFormula(), this.actor?.getRollData() ?? {});
const str = damageString
? damageString
: game.i18n.format('DAGGERHEART.GENERAL.missingX', {
x: game.i18n.localize('DAGGERHEART.GENERAL.damage')
});
const icons = Array.from(type) const icons = Array.from(type)
.map(t => CONFIG.DH.GENERAL.damageTypes[t]?.icon) .map(t => CONFIG.DH.GENERAL.damageTypes[t]?.icon)

View file

@ -36,7 +36,7 @@ export default class DhCountdownAction extends DHBaseAction {
/** @inheritDoc */ /** @inheritDoc */
static migrateData(source) { static migrateData(source) {
for (const countdown of source.countdown) { for (const countdown of Object.values(source.countdown)) {
if (countdown.progress.max) { if (countdown.progress.max) {
countdown.progress.startFormula = countdown.progress.max; countdown.progress.startFormula = countdown.progress.max;
countdown.progress.start = 1; countdown.progress.start = 1;

View file

@ -183,7 +183,11 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
if (pendingingSaves.length) { if (pendingingSaves.length) {
const confirm = await foundry.applications.api.DialogV2.confirm({ const confirm = await foundry.applications.api.DialogV2.confirm({
window: { title: game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.title') }, window: { title: game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.title') },
content: `<p>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.unfinishedRolls')}</p><p>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.confirmation')}</p><p><i>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.warning')}</i></p>` content: `
<p>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.unfinishedRolls')}</p>
<p><i>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.warning')}</i></p>
<p>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.confirmation')}</p>
`
}); });
if (!confirm) return; if (!confirm) return;
} }
@ -247,8 +251,24 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
const targets = this.filterPermTargets(this.system.hitTargets), const targets = this.filterPermTargets(this.system.hitTargets),
config = foundry.utils.deepClone(this.system); config = foundry.utils.deepClone(this.system);
config.event = event; config.event = event;
if (targets.length === 0) if (targets.length === 0)
ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelectedOrPerm')); return ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelectedOrPerm'));
else if (config.hasSave) {
const pendingingSaves = targets.filter(t => t.saved.success === null);
if (pendingingSaves.length) {
const confirm = await foundry.applications.api.DialogV2.confirm({
window: { title: game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.title') },
content: `
<p>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.unfinishedRolls')}</p>
<p><i>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.warning')}</i></p>
<p>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.confirmation')}</p>
`
});
if (!confirm) return;
}
}
this.consumeOnSuccess(); this.consumeOnSuccess();
this.system.action?.workflow.get('effects')?.execute(config, targets, true); this.system.action?.workflow.get('effects')?.execute(config, targets, true);
} }

View file

@ -3,7 +3,6 @@ import { AdversaryBPPerEncounter, BaseBPPerEncounter } from '../config/encounter
export default class DhTooltipManager extends foundry.helpers.interaction.TooltipManager { export default class DhTooltipManager extends foundry.helpers.interaction.TooltipManager {
#wide = false; #wide = false;
#bordered = false; #bordered = false;
#active = false;
async activate(element, options = {}) { async activate(element, options = {}) {
const { TextEditor } = foundry.applications.ux; const { TextEditor } = foundry.applications.ux;

View file

@ -38,6 +38,9 @@
} }
.status-effects { .status-effects {
// TODO: Remove when the issue https://github.com/foundryvtt/foundryvtt/issues/14410 is resolved and Foundry handles it cleanly themselves.
grid-template-rows: min-content;
.effect-control-container { .effect-control-container {
position: relative; position: relative;

View file

@ -2,7 +2,7 @@
"id": "daggerheart", "id": "daggerheart",
"title": "Daggerheart", "title": "Daggerheart",
"description": "An unofficial implementation of the Daggerheart system", "description": "An unofficial implementation of the Daggerheart system",
"version": "2.3.0", "version": "2.3.1",
"compatibility": { "compatibility": {
"minimum": "14.361", "minimum": "14.361",
"verified": "14.363", "verified": "14.363",
@ -10,7 +10,7 @@
}, },
"url": "https://github.com/Foundryborne/daggerheart", "url": "https://github.com/Foundryborne/daggerheart",
"manifest": "https://raw.githubusercontent.com/Foundryborne/daggerheart/v14/system.json", "manifest": "https://raw.githubusercontent.com/Foundryborne/daggerheart/v14/system.json",
"download": "https://github.com/Foundryborne/daggerheart/releases/download/2.3.0/system.zip", "download": "https://github.com/Foundryborne/daggerheart/releases/download/2.3.1/system.zip",
"authors": [ "authors": [
{ {
"name": "WBHarry" "name": "WBHarry"

View file

@ -50,6 +50,11 @@
</nav> </nav>
{{/if}} {{/if}}
{{!-- Encounter Name --}}
{{#if combat.name}}
<h2 class="encounter-name">{{ combat.name }}</h2>
{{/if}}
<div class="encounter-controls {{#if hasCombat}}combat{{/if}}"> <div class="encounter-controls {{#if hasCombat}}combat{{/if}}">
{{!-- Combat Status --}} {{!-- Combat Status --}}
<strong class="encounter-title"> <strong class="encounter-title">