From 0e79987ecda8c5ef3a64a3d55747fd486f347c96 Mon Sep 17 00:00:00 2001 From: walcutt Date: Thu, 26 Dec 2024 14:56:48 -0500 Subject: [PATCH] Cards sheet first draft --- module/cards/hench-cards.mjs | 2 +- module/sheets/hench-cards-sheet.mjs | 13 +++- styles/hench.css | 22 ++++++- templates/cards/cards.hbs | 97 ++++++++++++++++++++++++++++- 4 files changed, 130 insertions(+), 4 deletions(-) diff --git a/module/cards/hench-cards.mjs b/module/cards/hench-cards.mjs index b448536..532356a 100644 --- a/module/cards/hench-cards.mjs +++ b/module/cards/hench-cards.mjs @@ -136,7 +136,7 @@ export class HenchCards extends Cards { async drawSpread(amount, from = CONST.CARD_DRAW_MODES.TOP) { let cardsToGrab = []; - switch(dest) { + switch(from) { case CONST.CARD_DRAW_MODES.BOTTOM: case CONST.CARD_DRAW_MODES.LAST: cardsToGrab = this.deck.slice(this.deck.length - amount, this.deck.length); diff --git a/module/sheets/hench-cards-sheet.mjs b/module/sheets/hench-cards-sheet.mjs index 164787c..0260f2a 100644 --- a/module/sheets/hench-cards-sheet.mjs +++ b/module/sheets/hench-cards-sheet.mjs @@ -6,11 +6,22 @@ export class HenchCardsSheet extends CardsConfig { /** @override */ getData() { - return super.getData(); + const t = super.getData(); + console.log(t); + return t; } /** @override */ activateListeners(html) { super.activateListeners(html); } + + /** @override */ + static get defaultOptions() { + let opts = super.defaultOptions; + + opts.resizable = true; + + return opts; + } } \ No newline at end of file diff --git a/styles/hench.css b/styles/hench.css index c49a5e5..6b26240 100644 --- a/styles/hench.css +++ b/styles/hench.css @@ -66,6 +66,10 @@ justify-content: center; } +.hench-sheet-container.hench-unbiased > * { + flex-basis: 0; +} + .hench-box { display: flex; flex-direction: column; @@ -87,6 +91,10 @@ flex-basis: auto; } +.hench-box > .hench-row-align-stretch { + align-items: stretch; +} + .hench-flex-fixed { flex-grow: 0; flex-shrink: 0; @@ -133,7 +141,7 @@ /* Specific */ -.hench-row-even{ +.hench-row-even { justify-content: space-evenly; } @@ -158,6 +166,18 @@ width: 10em; } +.hench-image-resize-vertical { + aspect-ratio: initial; +} + +.hench-card-fixed-item { + max-width: 20%; +} + +.hench-card-fixed-item.hench-card-empty { + aspect-ratio: 2 / 3; +} + .hench-harm-fixed-width { width: 8em; text-align: center; diff --git a/templates/cards/cards.hbs b/templates/cards/cards.hbs index ed2e012..d33e4ed 100644 --- a/templates/cards/cards.hbs +++ b/templates/cards/cards.hbs @@ -1,3 +1,98 @@
+ Cards sheet -
\ No newline at end of file + +
+ +
+
+
+
+ +
+
+
+ + Draw + +
+
+ + View deck + +
+
+ + Draw from Bottom + +
+
+
+ +
+
+
+ + Draw + +
+
+ + View deck + +
+
+ + Draw from Bottom + +
+
+
+ +
+
+
+
+ +
+
+
+ {{#each document.spread}} +
+ +
+ {{else}} +
+ {{/each}} +
+
+
+
+ + + \ No newline at end of file