Added downtime buttons

This commit is contained in:
WBHarry 2025-07-17 21:07:48 +02:00
parent e605f7ecbc
commit 92bfede022
8 changed files with 64 additions and 20 deletions

View file

@ -249,10 +249,9 @@
"title": "{actor} - Death Move"
},
"Downtime": {
"downtimeHeader": "Downtime Activities",
"longRest": {
"title": "Long Rest",
"moves": "Long Rest ({current}/{max})",
"moves": "Long Rest Moves ({current}/{max})",
"clearStress": {
"description": "Describe how you blow off steam or pull yourself together, and clear all marked Stress.",
"name": "Clear Stress"
@ -276,7 +275,7 @@
},
"shortRest": {
"title": "Short Rest",
"moves": "Short Rest ({current}/{max})",
"moves": "Short Rest Moves ({current}/{max})",
"tendToWounds": {
"name": "Tend to Wounds",
"description": "Describe how you hastily patch yourself up, then clear a number of Hit Points equal to 1d4 + your tier. You can do this to an ally instead."

View file

@ -51,6 +51,9 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
async _prepareContext(_options) {
const context = await super._prepareContext(_options);
context.title = game.i18n.localize(
`DAGGERHEART.APPLICATIONS.Downtime.${this.shortrest ? 'shortRest' : 'longRest'}.title`
);
context.selectedActivity = this.selectedActivity;
context.moveData = this.moveData;
context.nrCurrentChoices = Object.values(this.moveData).reduce((acc, category) => {

View file

@ -28,7 +28,8 @@ export default class CharacterSheet extends DHBaseActorSheet {
useAction: this.useAction,
toggleResourceDice: this.toggleResourceDice,
handleResourceDice: this.handleResourceDice,
toChat: this.toChat
toChat: this.toChat,
useDowntime: this.useDowntime
},
window: {
resizable: true
@ -752,6 +753,12 @@ export default class CharacterSheet extends DHBaseActorSheet {
}
}
static useDowntime(_, button) {
new game.system.api.applications.dialogs.Downtime(this.document, button.dataset.type === 'shortRest').render(
true
);
}
async _onDragStart(event) {
const item = this.getItem(event);

View file

@ -7,6 +7,14 @@
height: 40px;
width: 100%;
.navigation-container {
display: flex;
align-items: center;
gap: 8px;
.navigation-inner-container {
flex: 1;
.feature-tab {
border: none;
@ -16,4 +24,6 @@
}
}
}
}
}
}

View file

@ -193,5 +193,14 @@
}
}
}
.character-downtime-container {
display: flex;
gap: 2px;
button {
flex: 1;
}
}
}
}

View file

@ -1,6 +1,6 @@
<div>
<header class="dialog-header">
<h1>{{localize "DAGGERHEART.APPLICATIONS.Downtime.downtimeHeader"}}</h1>
<h1>{{title}}</h1>
</header>
<div class="downtime-container {{#if (and shortRestMoves.moves longRestMoves.moves)}}two-columns even{{else}}one-column{{/if}}">

View file

@ -116,5 +116,14 @@
{{/each}}
</div>
{{> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
{{#> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
<div class="character-downtime-container">
<a><i class="fa-solid fa-chair"></i></a>
<a><i class="fa-solid fa-bed"></i></a>
</div>
{{/'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
</header>

View file

@ -1,4 +1,6 @@
<section class='tab-navigation'>
<div class='navigation-container'>
<div class="navigation-inner-container">
<line-div></line-div>
<nav class='feature-tab sheet-tabs tabs' data-group='primary'>
{{#each tabs as |tab|}}
@ -8,4 +10,9 @@
{{/each}}
</nav>
<line-div></line-div>
</div>
{{#if @partial-block}}
{{> @partial-block }}
{{/if}}
</div>
</section>