Downtime can now display both ShortRest and LongRest options depending on character rules

This commit is contained in:
WBHarry 2025-07-17 15:35:27 +02:00
parent ab56f2c23e
commit 475a63f120
8 changed files with 161 additions and 55 deletions

View file

@ -1,24 +0,0 @@
<div>
<div class="downtime-container">
<h2 class="downtime-header">{{localize "DAGGERHEART.APPLICATIONS.Downtime.downtimeHeader" current=nrCurrentChoices max=moveData.nrChoices}}</h2>
{{#each moveData.moves as |move key|}}
<div class="activity-container">
<div class="activity-title">
<div class="activity-image {{#if this.selected}}selected{{/if}}" data-action="selectMove" data-move="{{key}}">
{{#if this.selected}}<div class="activity-select-label">{{move.selected}}</div>{{/if}}
<img src="{{move.img}}" />
</div>
<span class="activity-title-text">{{localize this.name}}</span>
</div>
<div class="activity-body">
{{localize this.description}}
</div>
</div>
{{/each}}
</div>
<footer class="flexrow">
<button type="button" data-action="close">{{localize "DAGGERHEART.Application.Cancel"}}</button>
<button type="button" data-action="takeDowntime" {{#if this.disabledDowntime}}disabled{{/if}}>{{localize "DAGGERHEART.Application.Downtime.TakeDowntime"}}</button>
</footer>
</div>

View file

@ -0,0 +1,19 @@
<fieldset class="one-column">
<legend>{{localize (concat "DAGGERHEART.APPLICATIONS.Downtime." category ".moves") max=nrChoices.max current=nrChoices.current}}</legend>
{{#each moves as |move key|}}
<div class="activity-container">
<div class="activity-title">
<div class="activity-image {{#if move.selected}}selected{{/if}}" data-action="selectMove" data-category="{{../category}}" data-move="{{key}}">
{{#if move.selected}}<div class="activity-select-label">{{move.selected}}</div>{{/if}}
<img src="{{move.img}}" />
</div>
<span class="activity-title-text">{{localize move.name}}</span>
</div>
<div class="activity-body">
{{localize move.description}}
</div>
</div>
{{/each}}
</fieldset>

View file

@ -0,0 +1,10 @@
<div>
<div class="downtime-container">
{{#if shortRestMoves.moves}}{{> "systems/daggerheart/templates/dialogs/downtime/activities.hbs" moves=shortRestMoves.moves category='shortRest' nrChoices=nrChoices.shortRest}}{{/if}}
{{#if longRestMoves.moves}}{{> "systems/daggerheart/templates/dialogs/downtime/activities.hbs" moves=longRestMoves.moves category='longRest' nrChoices=nrChoices.longRest}}{{/if}}
</div>
<footer class="flexrow">
<button type="button" data-action="close">{{localize "Cancel"}}</button>
<button type="button" data-action="takeDowntime" {{#if disabledDowntime}}disabled{{/if}}>{{localize "DAGGERHEART.APPLICATIONS.Downtime.takeDowntime"}}</button>
</footer>
</div>