Ajout Aiguille Horloge

This commit is contained in:
2023-03-08 22:33:23 +01:00
parent 77cf72a752
commit 0c11013694
6 changed files with 97 additions and 6 deletions

View File

@ -49,6 +49,7 @@ export class RdDCalendrier extends Application {
if (setting.key == SYSTEM_RDD + '.' + WORLD_TIMESTAMP_SETTING) {
this.timestamp = RdDTimestamp.getWorldTime();
this.updateDisplay();
Hooks.callAll(APP_ASTROLOGIE_REFRESH);
}
}
@ -286,6 +287,7 @@ export class RdDCalendrier extends Application {
this.positionnerHeure(Number(calendarSet.value));
}
this.updateDisplay();
Hooks.callAll(APP_ASTROLOGIE_REFRESH);
}
/* -------------------------------------------- */

View File

@ -252,6 +252,7 @@ export class RdDTimestamp {
get heure() { return Math.floor(this.indexMinute / RDD_MINUTES_PAR_HEURES) }
get minute() { return this.indexMinute % RDD_MINUTES_PAR_HEURES }
get round() { return ROUNDS_PAR_MINUTE * (this.indexMinute - Math.floor(this.indexMinute)) }
get pourcentageDuJour() { return this.indexMinute / RDD_MINUTES_PAR_JOUR }
formatDate() {
const jour = this.jour + 1;

View File

@ -161,16 +161,24 @@ export class AppAstrologie extends Application {
this.html.find(`select[name="signe-astral"]`).val(this.appData.theme.signeAstral.key)
this.html.find(`select[name="signe-naissance"]`).val(this.appData.theme.signeNaissance.key)
const angle = ((chiffreAstral + heureNaissance) * 30) % 360;
const rotation = `rotate(${angle}deg)`;
this.html.find(`div.astro-roue div.astro-disque img`).css({
const angleAstrologie = ((chiffreAstral + heureNaissance) * 30) % 360;
this.html.find(`div.astro-roue div.astro-disque img`).css(this.cssRotation(angleAstrologie));
const timestamp = game.system.rdd.calendrier.getTimestamp();
const angleHeure = timestamp.pourcentageDuJour * 360
this.html.find(`div.astro-roue div.astro-horloge img`).css(this.cssRotation(angleHeure));
}
cssRotation(angleAstrologie) {
const rotation = `rotate(${angleAstrologie}deg)`;
const cssRotation = {
'transform': rotation,
'-ms-transform': rotation,
'-moz-transform': rotation,
'-webkit-transform': rotation,
'-o-transform': rotation
});
};
return cssRotation;
}
requestJetAstrologie() {
@ -199,6 +207,7 @@ export class AppAstrologie extends Application {
refreshAstrologie() {
this.render(true)
}
async close(options) {
Hooks.off(APP_ASTROLOGIE_REFRESH, this.hookReference);
this.hookReference = undefined