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 @@
-
- {{#each resource.diceStates as | state key |}} -
- - -
- {{/each}} +
+
{{localize 'DAGGERHEART.APPLICATIONS.ResourceDice.rerollRecoveryInfo' name=name recovery=recovery }}
+
{{localize 'DAGGERHEART.APPLICATIONS.ResourceDice.rerollConfirmation' name=name }}
+
\ No newline at end of file diff --git a/templates/sheets/global/partials/inventory-item.hbs b/templates/sheets/global/partials/inventory-item.hbs index d6e25b4d..ec579800 100644 --- a/templates/sheets/global/partials/inventory-item.hbs +++ b/templates/sheets/global/partials/inventory-item.hbs @@ -1,45 +1,70 @@
  • -
    - {{#if isCompanion}} - {{item.name}} - {{else}} -
    {{item.name}}
    - {{/if}} - {{#if (eq type 'weapon')}} -
    +
    +
    + {{#if isCompanion}} + {{item.name}} + {{else}} +
    {{item.name}}
    + {{/if}} + {{#if (eq type 'weapon')}} +
    + {{#if isSidebar}} +
    +
    + {{!-- {{localize (concat 'DAGGERHEART.CONFIG.Traits.' item.system.attack.roll.trait '.short')}} --}} + {{localize (concat 'DAGGERHEART.CONFIG.Range.' item.system.attack.range '.short')}} + - + {{item.system.attack.damage.parts.0.value.dice}}{{#if item.system.attack.damage.parts.0.value.bonus}} + {{item.system.attack.damage.parts.0.value.bonus}}{{/if}} + {{!-- ({{localize (concat 'DAGGERHEART.CONFIG.DamageType.' item.system.attack.damage.parts.0.type '.abbreviation')}}) --}} + {{#each item.system.attack.damage.parts.0.type as | type | }} + {{#with (lookup @root.config.GENERAL.damageTypes type)}} + + {{/with}} + {{/each}} +
    +
    + {{else}} +
    + {{localize (concat 'DAGGERHEART.CONFIG.Traits.' item.system.attack.roll.trait '.name')}} +
    +
    + {{localize (concat 'DAGGERHEART.CONFIG.Range.' item.system.attack.range '.name')}} +
    +
    + {{item.system.attack.damage.parts.0.value.dice}}{{#if item.system.attack.damage.parts.0.value.bonus}} + {{item.system.attack.damage.parts.0.value.bonus}}{{/if}} + ( + {{#each item.system.attack.damage.parts.0.type}} + {{localize (concat 'DAGGERHEART.CONFIG.DamageType.' this '.abbreviation')}} + {{/each}} + ) +
    +
    + {{localize (concat 'DAGGERHEART.CONFIG.Burden.' item.system.burden)}} +
    + {{/if}} +
    + {{/if}} + {{#if (eq type 'armor')}} {{#if isSidebar}}
    - {{!-- {{localize (concat 'DAGGERHEART.CONFIG.Traits.' item.system.attack.roll.trait '.short')}} --}} - {{localize (concat 'DAGGERHEART.CONFIG.Range.' item.system.attack.range '.short')}} - - - {{item.system.attack.damage.parts.0.value.dice}}{{#if item.system.attack.damage.parts.0.value.bonus}} + {{item.system.attack.damage.parts.0.value.bonus}}{{/if}} - {{!-- ({{localize (concat 'DAGGERHEART.CONFIG.DamageType.' item.system.attack.damage.parts.0.type '.abbreviation')}}) --}} - {{#each item.system.attack.damage.parts.0.type as | type | }} - {{#with (lookup @root.config.GENERAL.damageTypes type)}} - - {{/with}} - {{/each}} + {{localize "DAGGERHEART.ITEMS.Armor.baseScore"}}: + {{item.system.baseScore}}
    {{else}} -
    - {{localize (concat 'DAGGERHEART.CONFIG.Traits.' item.system.attack.roll.trait '.name')}} -
    -
    - {{localize (concat 'DAGGERHEART.CONFIG.Range.' item.system.attack.range '.name')}} -
    -
    - {{item.system.attack.damage.parts.0.value.dice}}{{#if item.system.attack.damage.parts.0.value.bonus}} + {{item.system.attack.damage.parts.0.value.bonus}}{{/if}} - ( - {{#each item.system.attack.damage.parts.0.type}} - {{localize (concat 'DAGGERHEART.CONFIG.DamageType.' this '.abbreviation')}} - {{/each}} - ) -
    -
    - {{localize (concat 'DAGGERHEART.CONFIG.Burden.' item.system.burden)}} +
    +
    + {{localize "DAGGERHEART.ITEMS.Armor.baseScore"}}: + {{item.system.baseScore}} +
    +
    + {{localize "DAGGERHEART.ITEMS.Armor.baseThresholds.base"}}: + {{item.system.baseThresholds.major}} + / + {{item.system.baseThresholds.severe}} +
    {{/if}} {{/if}} @@ -102,7 +127,7 @@
    {{/if}}
    - {{#if (and (not isSidebar) item.system.resource)}} + {{#if (and (not isSidebar) (eq item.system.resource.type 'simple'))}} {{> "systems/daggerheart/templates/sheets/global/partials/item-resource.hbs"}} {{/if}} {{#if (and (not isSidebar) item.system.quantity)}} @@ -160,7 +185,9 @@ {{/unless}}
    {{#unless isSidebar}}{{{item.system.description}}}{{/unless}}
    - + {{#if (and (not isSidebar) (eq item.system.resource.type 'diceValue'))}} + {{> "systems/daggerheart/templates/sheets/global/partials/item-resource.hbs"}} + {{/if}} {{#if featureType}}
    {{#each item.system.actions as | action |}} diff --git a/templates/sheets/global/partials/item-resource.hbs b/templates/sheets/global/partials/item-resource.hbs index 7e1c702a..5a349e11 100644 --- a/templates/sheets/global/partials/item-resource.hbs +++ b/templates/sheets/global/partials/item-resource.hbs @@ -14,6 +14,6 @@
    {{/each}} - +
    {{/if}} \ No newline at end of file