[Feature] Downtime Improvements (#411)

* Initial

* Fixed dialog again

* Fix healing targeted resource in setting

* Removed unused templates

---------

Co-authored-by: Dapoolp <elcatnet@gmail.com>
This commit is contained in:
WBHarry 2025-07-25 21:31:05 +02:00 committed by GitHub
parent 3f95740b7a
commit 62b9a8fbee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 538 additions and 457 deletions

View file

@ -64,8 +64,8 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
context.selectedActivity = this.selectedActivity;
context.moveData = this.moveData;
const shortRestMovesSelected = this.#nrSelectedMoves('shortRest');
const longRestMovesSelected = this.#nrSelectedMoves('longRest');
const shortRestMovesSelected = this.nrSelectedMoves('shortRest');
const longRestMovesSelected = this.nrSelectedMoves('longRest');
context.nrChoices = {
...this.nrChoices,
shortRest: {
@ -89,7 +89,7 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
static selectMove(_, target) {
const { category, move } = target.dataset;
const nrSelected = this.#nrSelectedMoves(category);
const nrSelected = this.nrSelectedMoves(category);
if (nrSelected + this.nrChoices[category].taken >= this.nrChoices[category].max) {
ui.notifications.error(game.i18n.localize('DAGGERHEART.UI.Notifications.noMoreMoves'));
@ -176,7 +176,7 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
this.render();
}
#nrSelectedMoves(category) {
nrSelectedMoves(category) {
return Object.values(this.moveData[category].moves).reduce((acc, x) => acc + (x.selected ?? 0), 0);
}
}