diff --git a/lang/en.json b/lang/en.json index c0dc1c3c..9b69c473 100755 --- a/lang/en.json +++ b/lang/en.json @@ -390,7 +390,9 @@ }, "ResourceDice": { "title": "{name} Resource", - "rerollDice": "Reroll Dice" + "rerollDice": "Reroll Dice", + "rerollRecoveryInfo": "{name} refresh on {recovery}.", + "rerollConfirmation": "Are you sure you want to reroll your {name} dice?" } }, diff --git a/module/applications/dialogs/resourceDiceDialog.mjs b/module/applications/dialogs/resourceDiceDialog.mjs index 0e93852a..89a4e67b 100644 --- a/module/applications/dialogs/resourceDiceDialog.mjs +++ b/module/applications/dialogs/resourceDiceDialog.mjs @@ -1,10 +1,11 @@ const { ApplicationV2, HandlebarsApplicationMixin } = foundry.applications.api; export default class ResourceDiceDialog extends HandlebarsApplicationMixin(ApplicationV2) { - constructor(name, actorName, resource, options = {}) { + constructor(name, recovery, actorName, resource, options = {}) { super(options); this.name = name; + this.recovery = recovery; this.actorName = actorName; this.resource = resource; } @@ -39,7 +40,8 @@ export default class ResourceDiceDialog extends HandlebarsApplicationMixin(Appli async _prepareContext(_options) { const context = await super._prepareContext(_options); - context.resource = this.resource; + context.name = this.name; + context.recovery = game.i18n.localize(CONFIG.DH.GENERAL.refreshTypes[this.recovery].label); return context; } @@ -66,9 +68,9 @@ export default class ResourceDiceDialog extends HandlebarsApplicationMixin(Appli this.close(); } - static async create(name, actorName, resource, options = {}) { + static async create(name, recovery, actorName, resource, options = {}) { return new Promise(resolve => { - const app = new this(name, actorName, resource, options); + const app = new this(name, recovery, actorName, resource, options); app.addEventListener('close', () => resolve(app.rollValues), { once: true }); app.render({ force: true }); }); diff --git a/module/applications/sheets/actors/character.mjs b/module/applications/sheets/actors/character.mjs index 43e48720..a12fbd1f 100644 --- a/module/applications/sheets/actors/character.mjs +++ b/module/applications/sheets/actors/character.mjs @@ -700,6 +700,7 @@ export default class CharacterSheet extends DHBaseActorSheet { const rollValues = await game.system.api.applications.dialogs.ResourceDiceDialog.create( item.name, + item.system.resource.recovery, this.document.name, item.system.resource ); diff --git a/styles/less/dialog/resource-dice/sheet.less b/styles/less/dialog/resource-dice/sheet.less index 6a5a3744..99353fe9 100644 --- a/styles/less/dialog/resource-dice/sheet.less +++ b/styles/less/dialog/resource-dice/sheet.less @@ -1,31 +1,6 @@ .daggerheart.dialog.dh-style.views.resource-dice { - .item-resources { - display: flex; - align-items: center; - justify-content: center; - gap: 8px; - - .item-resource { - width: 38px; - height: 38px; - position: relative; - display: flex; - align-items: center; - justify-content: center; - - label { - position: absolute; - color: light-dark(white, black); - filter: drop-shadow(0 0 1px @golden); - font-size: 24px; - z-index: 2; - } - - img { - filter: brightness(0) saturate(100%) invert(97%) sepia(7%) saturate(580%) hue-rotate(332deg) - brightness(96%) contrast(95%); - } - } + .reroll-confirmation { + margin-bottom: 8px; } footer { diff --git a/templates/dialogs/dice-roll/resourceDice.hbs b/templates/dialogs/dice-roll/resourceDice.hbs index 2d4b231d..a054986b 100644 --- a/templates/dialogs/dice-roll/resourceDice.hbs +++ b/templates/dialogs/dice-roll/resourceDice.hbs @@ -1,13 +1,10 @@