From fa356bd7f849840382430326026e8561229f0579 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sun, 8 Jan 2023 20:33:52 +0100 Subject: [PATCH 1/7] Fix calcul des heures de chance --- module/rdd-calendrier.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/rdd-calendrier.js b/module/rdd-calendrier.js index 32bb13ea..c77c4324 100644 --- a/module/rdd-calendrier.js +++ b/module/rdd-calendrier.js @@ -355,7 +355,7 @@ export class RdDCalendrier extends Application { } getHeureChance(heure) { - return heure + (this.getCurrentNombreAstral() ?? 1) - 1; + return heure + (this.getCurrentNombreAstral() ?? 0); } /* -------------------------------------------- */ -- 2.35.3 From 1cd3bdef25df5d6120ae3ef25595119732fee291 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sun, 8 Jan 2023 20:41:50 +0100 Subject: [PATCH 2/7] =?UTF-8?q?Am=C3=A9lioration=20titre=20du=20calendrier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/rdd-calendrier.js | 4 ++-- styles/simple.css | 14 ++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/module/rdd-calendrier.js b/module/rdd-calendrier.js index c77c4324..40cb16c3 100644 --- a/module/rdd-calendrier.js +++ b/module/rdd-calendrier.js @@ -428,9 +428,9 @@ export class RdDCalendrier extends Application { updateDisplay() { let calendrier = this.fillCalendrierData(); // Rebuild text du calendrier - let dateHTML = `${calendrier.jourDuMois} ${calendrier.mois.label} ${calendrier.annee} (${calendrier.mois.saison})` + let dateHTML = `${calendrier.jourDuMois} ${calendrier.mois.label} (${calendrier.mois.saison}) de l'année ${calendrier.annee}` if (game.user.isGM) { - dateHTML = dateHTML + " - NA: " + (this.getCurrentNombreAstral() ?? "?"); + dateHTML = dateHTML + "
Nombre Astral: " + (this.getCurrentNombreAstral() ?? "?"); } for (let handle of document.getElementsByClassName("calendar-date-rdd")) { handle.innerHTML = dateHTML; diff --git a/styles/simple.css b/styles/simple.css index f22bda8a..cc7f9a5c 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -1518,7 +1518,7 @@ div.competence-column div.categorie-competence{ grid-row: 1; grid-column: 1; width: fit-content; - height: 84px; + height: 6rem; margin: 0; padding: 0; border: 1px solid #000; @@ -1530,9 +1530,9 @@ div.competence-column div.categorie-competence{ .calendar-hdr{ display: grid; font-size: 1rem; - margin: 3px; - padding: 4px; - height: 25px; + margin: 0.1rem; + padding: 0.2rem; + height: fit-content; width: fit-content; min-width: 200px; border-bottom: 1px solid #111; @@ -1544,7 +1544,6 @@ div.competence-column div.categorie-competence{ color: #CCC; opacity: 90; font-size: 0.9rem; - line-height: 1px; text-align: center; padding: 0; margin: 0; @@ -1692,17 +1691,16 @@ div.competence-column div.categorie-competence{ margin: auto; color: #CCC; } -.calendar-weekday{ +.calendar-weekday { grid-column: 1; grid-row: 1; text-align: center; + font-size: 1.1rem; margin: auto; - border-bottom: 1px solid #111; } .calendar-time{ grid-column: 1; grid-row: 2; - font-size: 1.1rem; text-align: center; margin: auto; cursor: pointer; -- 2.35.3 From 9eaeceafc4e74f89b9cca256e0185baeaba46929 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sun, 8 Jan 2023 20:42:23 +0100 Subject: [PATCH 3/7] Autofocus sur le texte pour la chronologie --- templates/dialog-chronologie.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/dialog-chronologie.html b/templates/dialog-chronologie.html index 90bfa366..b50e105d 100644 --- a/templates/dialog-chronologie.html +++ b/templates/dialog-chronologie.html @@ -4,15 +4,11 @@ -
- - -
{{>"systems/foundryvtt-reve-de-dragon/templates/common/timestamp.hbs" (timestamp-extract timestamp) - path='chronologie' - label='Date en jeu' + path='chronologie' + label='Date en jeu' disabled='' }}
@@ -39,5 +35,9 @@ {{/select}} +
+ + +
\ No newline at end of file -- 2.35.3 From 404539a004e4da7f65fcd60a8f0614ccf5a8da67 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sun, 8 Jan 2023 23:20:54 +0100 Subject: [PATCH 4/7] Fix: ajout d'heure ajoute des minutes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lors du passage à Lyre, on ajoutait 6 minutes --- module/rdd-calendrier.js | 8 ++++++-- module/rdd-timestamp.js | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/module/rdd-calendrier.js b/module/rdd-calendrier.js index 40cb16c3..23aa64d0 100644 --- a/module/rdd-calendrier.js +++ b/module/rdd-calendrier.js @@ -285,8 +285,12 @@ export class RdDCalendrier extends Application { } /* -------------------------------------------- */ - async positionnerHeure(indexHeure) { - await this.setNewTimestamp(new RdDTimestamp({ indexDate: this.timestamp.indexDate + (this.timestamp.heure < indexHeure ? 0 : 1) }).addHeures(indexHeure)) + async positionnerHeure(heure) { + const indexDate = this.timestamp.indexDate; + const addDay = this.timestamp.heure < heure ? 0 : 1; + await this.setNewTimestamp(new RdDTimestamp({ + indexDate: indexDate + addDay, indexHeure: 0 }) + .addHeures(heure)) } /* -------------------------------------------- */ diff --git a/module/rdd-timestamp.js b/module/rdd-timestamp.js index d9ca9b80..831e48e1 100644 --- a/module/rdd-timestamp.js +++ b/module/rdd-timestamp.js @@ -250,7 +250,7 @@ export class RdDTimestamp { const heure = this.heure + heures; return new RdDTimestamp({ indexDate: this.indexDate + Math.floor(heure / RDD_HEURES_PAR_JOUR), - indexMinute: (this.indexMinute + (heure % RDD_HEURES_PAR_JOUR)) % (RDD_MINUTES_PAR_JOUR) + indexMinute: this.indexMinute + (heure % RDD_HEURES_PAR_JOUR) * RDD_MINUTES_PAR_HEURES }) } -- 2.35.3 From 9349e815802ed449b5d58efa282776ee86bfbd95 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sun, 8 Jan 2023 23:21:14 +0100 Subject: [PATCH 5/7] Reformatage du calendrier --- styles/simple.css | 79 ++++++++++++++++---------------- templates/calendar-template.html | 24 ++++++---- 2 files changed, 54 insertions(+), 49 deletions(-) diff --git a/styles/simple.css b/styles/simple.css index cc7f9a5c..d3f97b21 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -1596,7 +1596,7 @@ div.competence-column div.categorie-competence{ padding-bottom: 20px; } .calendar-btn-container-left{ - width: 20%; + width: 25%; display: grid; float: left; margin: 2px; @@ -1604,7 +1604,7 @@ div.competence-column div.categorie-competence{ color: rgba(0, 0, 0, 0.5); } .calendar-btn-container-right{ - width: 20%; + width: 15%; display: grid; float: right; margin: 2px; @@ -1627,54 +1627,55 @@ div.competence-column div.categorie-competence{ } .calendar-1min{ - grid-row: 1; + grid-row: 1; grid-column: 1; + margin-left: 0.2rem; } .calendar-5min{ - grid-row: 1; + grid-row: 1; grid-column: 2; } -.calendar-10min{ - grid-row: 2; - grid-column: 1; - margin-left: 10px; -} - -.calendar-20min{ - grid-row: 2; - grid-column: 2; - margin-left: 10px; -} - -.calendar-lyre{ - grid-row: 1; - grid-column: 1; - height: fit-content; - text-align: center; - vertical-align: center; -} - -.calendar-vaisseau{ - grid-row: 1; - grid-column: 2; - height: fit-content; - text-align: center; - vertical-align: center; +.calendar-15min{ + grid-row: 1; + grid-column: 3; + margin-right: 0.2rem; } .calendar-30min{ - grid-row: 2; + grid-row: 2; grid-column: 1; - height: fit-content; - text-align: center; - vertical-align: center; + margin-left: 0.2rem; +} + +.calendar-60min{ + grid-row: 2; + grid-column: 2; } .calendar-1heure{ - grid-row: 2; - grid-column: 2; - height: fit-content; - text-align: center; - vertical-align: center; + grid-row: 2; + grid-column: 3; + margin-right: 0.2rem; +} + +.calendar-lyre{ + grid-row: 1; + grid-column: 1; + margin-left: 0.2rem; + margin-right: 0.2rem; +} + +.calendar-vaisseau{ + grid-row: 2; + grid-column: 1; + margin-left: 0.2rem; + margin-right: 0.2rem; +} +.img-calendar-forward{ + color: rgba(255, 255, 255, 0.5); + vertical-align: bottom; + max-width: 1.2em; + max-height: 1.2em; + border-width: 0; } .calendar-btn-container-left:hover{ diff --git a/templates/calendar-template.html b/templates/calendar-template.html index 8a72183f..00c21972 100644 --- a/templates/calendar-template.html +++ b/templates/calendar-template.html @@ -1,8 +1,8 @@
{{#if isGM}} - - + + {{/if}}

{{jourDuMois}} {{mois.label}} ({{mois.saison}})

@@ -10,10 +10,12 @@
{{#if isGM}}
- - - - + +1 + +5 + +15 + +30 + +60 + +1h
{{else}}
@@ -30,10 +32,12 @@
{{#if isGM}}
- - - - + + Avancer à Lyre + + + Avancer au Vaisseau +
{{/if}}
-- 2.35.3 From 62914c343f94ef7d3df2acad7a80d35a5056db1c Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sun, 8 Jan 2023 23:27:08 +0100 Subject: [PATCH 6/7] =?UTF-8?q?Fix:=20=C3=A0=20l'heure=20de=20=3D>=20heure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/common/timestamp.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/common/timestamp.hbs b/templates/common/timestamp.hbs index 2aa19b6a..3295e4c3 100644 --- a/templates/common/timestamp.hbs +++ b/templates/common/timestamp.hbs @@ -15,7 +15,7 @@
- +