mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
enhance death roll dialog style (#440)
This commit is contained in:
parent
6d7401c874
commit
0a944eb3d4
11 changed files with 120 additions and 19 deletions
|
|
@ -13,8 +13,9 @@ export default class DhpDeathMove extends HandlebarsApplicationMixin(Application
|
|||
}
|
||||
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ['daggerheart', 'views', 'death-move'],
|
||||
position: { width: 800, height: 'auto' },
|
||||
classes: ['daggerheart', 'dh-style', 'dialog', 'views', 'death-move'],
|
||||
position: { width: 'auto', height: 'auto' },
|
||||
window: { icon: 'fa-solid fa-skull' },
|
||||
actions: {
|
||||
selectMove: this.selectMove,
|
||||
takeMove: this.takeMove
|
||||
|
|
@ -32,6 +33,7 @@ export default class DhpDeathMove extends HandlebarsApplicationMixin(Application
|
|||
const context = await super._prepareContext(_options);
|
||||
context.selectedMove = this.selectedMove;
|
||||
context.options = CONFIG.DH.GENERAL.deathMoves;
|
||||
context.title = game.i18n.localize('DAGGERHEART.APPLICATIONS.DeathMove.takeMove');
|
||||
|
||||
return context;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -322,18 +322,21 @@ export const deathMoves = {
|
|||
id: 'avoidDeath',
|
||||
name: 'DAGGERHEART.CONFIG.DeathMoves.avoidDeath.name',
|
||||
img: 'icons/magic/time/hourglass-yellow-green.webp',
|
||||
icon: 'fa-person-running',
|
||||
description: 'DAGGERHEART.CONFIG.DeathMoves.avoidDeath.description'
|
||||
},
|
||||
riskItAll: {
|
||||
id: 'riskItAll',
|
||||
name: 'DAGGERHEART.CONFIG.DeathMoves.riskItAll.name',
|
||||
img: 'icons/sundries/gaming/dice-pair-white-green.webp',
|
||||
icon: 'fa-dice',
|
||||
description: 'DAGGERHEART.CONFIG.DeathMoves.riskItAll.description'
|
||||
},
|
||||
blazeOfGlory: {
|
||||
id: 'blazeOfGlory',
|
||||
name: 'DAGGERHEART.CONFIG.DeathMoves.blazeOfGlory.name',
|
||||
img: 'icons/magic/life/heart-cross-strong-flame-purple-orange.webp',
|
||||
icon: 'fa-burst',
|
||||
description: 'DAGGERHEART.CONFIG.DeathMoves.blazeOfGlory.description'
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -87,6 +87,26 @@ export default class DhTooltipManager extends foundry.helpers.interaction.Toolti
|
|||
this.tooltip.innerHTML = html;
|
||||
}
|
||||
}
|
||||
|
||||
const deathMove = element.dataset.tooltip?.startsWith('#deathMove#');
|
||||
if (deathMove) {
|
||||
const name = element.dataset.deathName;
|
||||
const img = element.dataset.deathImg;
|
||||
const description = element.dataset.deathDescription;
|
||||
|
||||
html = await foundry.applications.handlebars.renderTemplate(
|
||||
`systems/daggerheart/templates/ui/tooltip/death-move.hbs`,
|
||||
{
|
||||
move: { name: name, img: img, description: description }
|
||||
}
|
||||
);
|
||||
|
||||
this.tooltip.innerHTML = html;
|
||||
options.direction = this._determineItemTooltipDirection(
|
||||
element,
|
||||
this.constructor.TOOLTIP_DIRECTIONS.RIGHT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
super.activate(element, { ...options, html: html });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue