Passage en minutes relatives uniquement
This commit is contained in:
parent
d5c4b69e1d
commit
13bb8ddcda
@ -27,7 +27,6 @@ export class RdDCalendrierEditeur extends Dialog {
|
||||
this.calendrierData.moisKey = $("#nomMois").val();
|
||||
this.calendrierData.heureKey = $("#nomHeure").val();
|
||||
this.calendrierData.jourMois = $("#jourMois").val();
|
||||
this.calendrierData.heuresRelative = $("#heuresRelative").val();
|
||||
this.calendrierData.minutesRelative = $("#minutesRelative").val();
|
||||
|
||||
console.log("UPDATE ", this.calendrierData);
|
||||
@ -50,7 +49,6 @@ export class RdDCalendrierEditeur extends Dialog {
|
||||
$("#nomMois").val(calendrierData.moisKey);
|
||||
$("#nomHeure").val(calendrierData.heureKey);
|
||||
$("#jourMois").val(calendrierData.jourMois);
|
||||
$("#heuresRelative").val(calendrierData.heuresRelative);
|
||||
$("#minutesRelative").val(calendrierData.minutesRelative);
|
||||
});
|
||||
|
||||
|
@ -39,7 +39,6 @@ export class RdDCalendrier extends Application {
|
||||
console.log("CALENDRIER", this.calendrier);
|
||||
if ( this.calendrier == undefined || this.calendrier.moisRdD == undefined) {
|
||||
this.calendrier.heureRdD = 0; // Index dans heuresList
|
||||
this.calendrier.heuresRelative = 0;
|
||||
this.calendrier.minutesRelative = 0;
|
||||
this.calendrier.moisRdD = 0; // Index dans heuresList
|
||||
this.calendrier.jour = 0;
|
||||
@ -157,13 +156,8 @@ export class RdDCalendrier extends Application {
|
||||
/* -------------------------------------------- */
|
||||
incrementTime(heure, minute = 0) {
|
||||
this.calendrier.minutesRelative += minute;
|
||||
if (this.calendrier.minutesRelative >= 60 ) {
|
||||
this.calendrier.minutesRelative -= 60;
|
||||
heure += 1;
|
||||
}
|
||||
this.calendrier.heuresRelative += heure;
|
||||
if (this.calendrier.heuresRelative >= 2) {
|
||||
this.calendrier.heuresRelative -= 2;
|
||||
if (this.calendrier.minutesRelative >= 120 ) {
|
||||
this.calendrier.minutesRelative -= 120;
|
||||
this.calendrier.heureRdD += 1;
|
||||
}
|
||||
if ( this.calendrier.heureRdD > 11 ) {
|
||||
@ -203,7 +197,6 @@ export class RdDCalendrier extends Application {
|
||||
this.incrementerJour();
|
||||
this.calendrier.heureRdD = indexHeure;
|
||||
this.calendrier.minutesRelative = 0;
|
||||
this.calendrier.heuresRelative = 0;
|
||||
game.settings.set("foundryvtt-reve-de-dragon", "calendrier", duplicate(this.calendrier) );
|
||||
}
|
||||
|
||||
@ -224,7 +217,6 @@ export class RdDCalendrier extends Application {
|
||||
data.nomHeure = heure.label;
|
||||
data.iconHeure = dossierIconesHeures + heure.icon;
|
||||
data.nomSaison = saisonsDef[mois.saison].label;
|
||||
data.heuresRelative = this.calendrier.heuresRelative;
|
||||
data.minutesRelative = this.calendrier.minutesRelative;
|
||||
data.isGM = game.user.isGM;
|
||||
return data;
|
||||
@ -338,13 +330,12 @@ export class RdDCalendrier extends Application {
|
||||
}
|
||||
document.getElementById("calendar--move-handle").innerHTML = dateHTML;
|
||||
document.getElementById("calendar-heure-texte").innerHTML = `${data.nomHeure}`;
|
||||
document.getElementById("calendar-time").innerHTML = `${data.heuresRelative}:${data.minutesRelative}`;
|
||||
document.getElementById("calendar-time").innerHTML = `${data.minutesRelative} min.`;
|
||||
document.getElementById("calendar-heure-img").src = data.iconHeure;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
saveEditeur( calendrierData ) {
|
||||
this.calendrier.heuresRelative = Number(calendrierData.heuresRelative);
|
||||
this.calendrier.minutesRelative = Number(calendrierData.minutesRelative);
|
||||
this.calendrier.jour = Number(calendrierData.jourMois) - 1;
|
||||
this.calendrier.moisRdD = heuresList.findIndex(mois => mois === calendrierData.moisKey);
|
||||
@ -362,7 +353,7 @@ export class RdDCalendrier extends Application {
|
||||
if ( this.editeur == undefined ) {
|
||||
calendrierData.jourMoisOptions = Array(28).fill().map((item, index) => 1 + index);
|
||||
calendrierData.heuresOptions = [0, 1];
|
||||
calendrierData.minutesOptions = Array(60).fill().map((item, index) => 0 + index);
|
||||
calendrierData.minutesOptions = Array(120).fill().map((item, index) => 0 + index);
|
||||
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/calendar-editor-template.html', calendrierData );
|
||||
this.editeur = new RdDCalendrierEditeur(html, this, calendrierData )
|
||||
}
|
||||
|
@ -33,16 +33,6 @@
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Heures</label>
|
||||
<select name="heuresRelative" id="heuresRelative" data-dtype="String">
|
||||
{{#select heuresRelative}}
|
||||
{{#each heuresOptions as |key|}}
|
||||
<option value={{key}}>{{numberFormat key decimals=0}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Minutes</label>
|
||||
<select name="minutesRelative" id="minutesRelative" data-dtype="String">
|
||||
|
Loading…
Reference in New Issue
Block a user