Merge pull request 'v10.5.2' (#606) from VincentVk/foundryvtt-reve-de-dragon:v10 into v10

Reviewed-on: #606
This commit is contained in:
uberwald 2023-01-08 23:59:34 +01:00
commit 7e75715d88
7 changed files with 79 additions and 72 deletions

View File

@ -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))
}
/* -------------------------------------------- */
@ -355,7 +359,7 @@ export class RdDCalendrier extends Application {
}
getHeureChance(heure) {
return heure + (this.getCurrentNombreAstral() ?? 1) - 1;
return heure + (this.getCurrentNombreAstral() ?? 0);
}
/* -------------------------------------------- */
@ -428,9 +432,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 + "<br>Nombre Astral: " + (this.getCurrentNombreAstral() ?? "?");
}
for (let handle of document.getElementsByClassName("calendar-date-rdd")) {
handle.innerHTML = dateHTML;

View File

@ -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
})
}

View File

@ -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;
@ -1597,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;
@ -1605,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;
@ -1630,52 +1629,53 @@ div.competence-column div.categorie-competence{
.calendar-1min{
grid-row: 1;
grid-column: 1;
margin-left: 0.2rem;
}
.calendar-5min{
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{
.calendar-15min{
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;
grid-column: 3;
margin-right: 0.2rem;
}
.calendar-30min{
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-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{
@ -1696,13 +1696,12 @@ div.competence-column div.categorie-competence{
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;

View File

@ -1,8 +1,8 @@
{
"id": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon",
"version": "10.5.1",
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.5.1.zip",
"version": "10.5.2",
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.5.2.zip",
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json",
"compatibility": {
"minimum": "10",

View File

@ -1,8 +1,8 @@
<div id="calendar-time-container">
<div class="calendar">
{{#if isGM}}
<i class="calendar-btn-edit fas fa-cog" title="Editer"></i>
<i class="astrologie-btn-edit fas fa-cog" title="Astrologie"></i>
<i class="calendar-btn-edit fa-solid fa-calendar-pen" title="Editer"></i>
<i class="astrologie-btn-edit fa-solid fa-moon-over-sun" title="Astrologie"></i>
{{/if}}
<div class="calendar-hdr">
<p id="calendar-move-handle" class="calendar-date-rdd" title="Deplacer">{{jourDuMois}} {{mois.label}} ({{mois.saison}})</p>
@ -10,10 +10,12 @@
<div class="calendar-container">
{{#if isGM}}
<div class="calendar-btn-container-left">
<i class="calendar-btn calendar-1min fas fa-angle-right" data-calendar-avance="1" title="Avancer de 1 minute"></i>
<i class="calendar-btn calendar-5min fas fa-angle-double-right" data-calendar-avance="5" title="Avancer de 5 minutes"></i>
<i class="calendar-btn calendar-10min fas fa-play" data-calendar-avance="10" title="Avancer de 10 minutes"></i>
<i class="calendar-btn calendar-20min fas fa-step-forward" data-calendar-avance="20" title="Avancer de 20 minutes"></i>
<i class="calendar-btn calendar-1min" data-calendar-avance="1" title="Avancer de 1 minute">+1</i>
<i class="calendar-btn calendar-5min" data-calendar-avance="5" title="Avancer de 5 minutes">+5</i>
<i class="calendar-btn calendar-15min" data-calendar-avance="15" title="Avancer de 15 minutes">+15</i>
<i class="calendar-btn calendar-30min" data-calendar-avance="30" title="Avancer de 30 minutes">+30</i>
<i class="calendar-btn calendar-60min" data-calendar-avance="60" title="Avancer de 60 minutes" >+60</i>
<i class="calendar-btn calendar-1heure" data-calendar-avance="120" title="Avancer d'1 heure" >+1h</i>
</div>
{{else}}
<div class="calendar-btn-container-left">
@ -30,10 +32,12 @@
</div>
{{#if isGM}}
<div class="calendar-btn-container-right">
<i class="calendar-btn calendar-30min fas fa-forward" data-calendar-avance="30" title="Avancer de 30 minutes" ></i>
<i class="calendar-btn calendar-1heure fas fa-fast-forward" data-calendar-avance="120" title="Avancer d'1 heure" ></i>
<i class="calendar-btn calendar-vaisseau fas fa-sun" data-calendar-set="0" title="Avancer au Vaisseau"></i>
<i class="calendar-btn calendar-lyre fas fa-moon" data-calendar-set="6" title="Avancer à Lyre"></i>
<i class="calendar-btn calendar-lyre fas fa-forward" data-calendar-set="6" title="Avancer à Lyre">
<img class="img-calendar-forward" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd07.svg" alt="Avancer à Lyre"/>
</i>
<i class="calendar-btn calendar-vaisseau fas fa-forward" data-calendar-set="0" title="Avancer au Vaisseau">
<img class="img-calendar-forward" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd01.svg" alt="Avancer au Vaisseau"/>
</i>
</div>
{{/if}}
</div>

View File

@ -15,7 +15,7 @@
</div>
<div class="flexrow">
<label></label>
<label>à l'heure de</label>
<label>heure</label>
<select {{#if disabled}}{{disabled}}{{/if}} name="{{path}}.heure" class="flex-shrink" data-dtype="String">
{{#select heure.key}}
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-heures.html"}}

View File

@ -4,10 +4,6 @@
<label for="auteur">Auteur</label>
<input type="text" name="auteur" value="{{auteur}}" data-dtype="String" {{#unless isGM}}disabled{{/unless}}/>
</div>
<div class="form-group">
<label for="information">Information</label>
<textarea autocomplete="off" title="Information" name="information">{{information}}</textarea>
</div>
<div class="form-group">
{{>"systems/foundryvtt-reve-de-dragon/templates/common/timestamp.hbs"
(timestamp-extract timestamp)
@ -39,5 +35,9 @@
{{/select}}
</select>
</div>
<div class="form-group">
<label for="information">Information</label>
<textarea autocomplete="off" title="Information" name="information" autofocus>{{information}}</textarea>
</div>
</div>
</form>