mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-14 04:31:07 +01:00
[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:
parent
3f95740b7a
commit
62b9a8fbee
25 changed files with 538 additions and 457 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue