mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-22 02:19:54 +02:00
Fixed so that only attack actions use the reload functionality on an item
This commit is contained in:
parent
3817469e35
commit
6d3337ab61
2 changed files with 18 additions and 11 deletions
|
|
@ -125,7 +125,10 @@ export default class DHRoll extends Roll {
|
||||||
|
|
||||||
const reloadSetting =
|
const reloadSetting =
|
||||||
game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).reload;
|
game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).reload;
|
||||||
const useReload = item?.system.hasReload && reloadSetting === CONFIG.DH.SETTINGS.reloadChoices.auto.id;
|
const useReload =
|
||||||
|
item?.system.hasReload &&
|
||||||
|
action?.type === 'attack' &&
|
||||||
|
reloadSetting === CONFIG.DH.SETTINGS.reloadChoices.auto.id;
|
||||||
const needReload = useReload ? await action?.handleReload?.() : false;
|
const needReload = useReload ? await action?.handleReload?.() : false;
|
||||||
|
|
||||||
const cls = getDocumentClass('ChatMessage'),
|
const cls = getDocumentClass('ChatMessage'),
|
||||||
|
|
@ -162,6 +165,7 @@ export default class DHRoll extends Roll {
|
||||||
return foundry.applications.handlebars.renderTemplate(template, {
|
return foundry.applications.handlebars.renderTemplate(template, {
|
||||||
roll: this,
|
roll: this,
|
||||||
...chatData,
|
...chatData,
|
||||||
|
action: chatData.action,
|
||||||
parent: chatData.parent,
|
parent: chatData.parent,
|
||||||
targetMode: chatData.targetMode,
|
targetMode: chatData.targetMode,
|
||||||
areas: chatData.action?.areas,
|
areas: chatData.action?.areas,
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,18 @@
|
||||||
<div class="chat-roll">
|
<div class="chat-roll">
|
||||||
<div class="roll-part-title"><span>{{title}}</span></div>
|
<div class="roll-part-title"><span>{{title}}</span></div>
|
||||||
{{#if (and needReload (eq automationSettings.reload 'auto'))}}
|
|
||||||
<p class="roll-reload-container">{{localize "DAGGERHEART.ACTIONS.Reload.reloadRequired"}}</p>
|
{{#if (eq action.type 'attack')}}
|
||||||
{{/if}}
|
{{#if (and needReload (eq automationSettings.reload 'auto'))}}
|
||||||
{{#if (eq automationSettings.reload 'button')}}
|
<p class="roll-reload-container">{{localize "DAGGERHEART.ACTIONS.Reload.reloadRequired"}}</p>
|
||||||
<div class="roll-reload-container">
|
{{/if}}
|
||||||
{{#if needReload}}
|
{{#if (eq automationSettings.reload 'button')}}
|
||||||
<p class=>{{localize "DAGGERHEART.ACTIONS.Reload.reloadRequired"}}</p>
|
<div class="roll-reload-container">
|
||||||
{{/if}}
|
{{#if needReload}}
|
||||||
<button class="roll-reload-check" {{#if needReload}}disabled{{/if}}>{{localize "DAGGERHEART.ACTIONS.Reload.checkReload"}}</button>
|
<p class=>{{localize "DAGGERHEART.ACTIONS.Reload.reloadRequired"}}</p>
|
||||||
</div>
|
{{/if}}
|
||||||
|
<button class="roll-reload-check" {{#if needReload}}disabled{{/if}}>{{localize "DAGGERHEART.ACTIONS.Reload.checkReload"}}</button>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if actionDescription}}{{> 'systems/daggerheart/templates/ui/chat/parts/description-part.hbs'}}{{/if}}
|
{{#if actionDescription}}{{> 'systems/daggerheart/templates/ui/chat/parts/description-part.hbs'}}{{/if}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue