Compare commits
19 Commits
foundryvtt
...
foundryvtt
Author | SHA1 | Date | |
---|---|---|---|
1956fdd755 | |||
651356159a | |||
ca304109d5 | |||
9c0d08cb6f | |||
f9fd8a1e24 | |||
03f84eb3f7 | |||
05e48b61ff | |||
f20788d6d9 | |||
009639dd5f | |||
14542cf7cd | |||
f4f2db68e0 | |||
7e75715d88 | |||
d62d1c45bc | |||
62914c343f | |||
9349e81580 | |||
404539a004 | |||
9eaeceafc4 | |||
1cd3bdef25 | |||
fa356bd7f8 |
@ -111,7 +111,7 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
HtmlUtility._showControlWhen(this.html.find(".appliquerFatigue"), ReglesOptionelles.isUsing("appliquer-fatigue"));
|
||||
HtmlUtility.showControlWhen(this.html.find(".appliquerFatigue"), ReglesOptionelles.isUsing("appliquer-fatigue"));
|
||||
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { SYSTEM_RDD } from "./constants.js";
|
||||
import { Grammar } from "./grammar.js";
|
||||
import { HtmlUtility } from "./html-utility.js";
|
||||
import { RdDTimestamp } from "./rdd-timestamp.js";
|
||||
|
||||
|
||||
@ -27,27 +28,10 @@ export class DialogChronologie extends Dialog {
|
||||
dateReel: DialogChronologie.getCurrentDateTime()
|
||||
};
|
||||
const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/dialog-chronologie.html", dialogData);
|
||||
const dialog = new DialogChronologie(html);
|
||||
const dialog = new DialogChronologie(html, dialogData);
|
||||
dialog.render(true);
|
||||
}
|
||||
|
||||
constructor(html) {
|
||||
const options = {
|
||||
classes: ["DialogChronologie"],
|
||||
width: 500,
|
||||
height: 'fit-content',
|
||||
'z-index': 99999
|
||||
};
|
||||
const conf = {
|
||||
title: "Chronologie",
|
||||
content: html,
|
||||
buttons: {
|
||||
ajout: { label: "Ajouter", callback: it => this.ajouter() },
|
||||
}
|
||||
};
|
||||
super(conf, options);
|
||||
}
|
||||
|
||||
static getCurrentDateTime() {
|
||||
return new Date().toLocaleString("sv-SE", {
|
||||
year: "numeric",
|
||||
@ -58,18 +42,60 @@ export class DialogChronologie extends Dialog {
|
||||
}).replace(" ", "T");
|
||||
}
|
||||
|
||||
constructor(html, dialogData) {
|
||||
const options = {
|
||||
classes: ["DialogChronologie"],
|
||||
width: 500,
|
||||
height: 'fit-content',
|
||||
'z-index': 99999
|
||||
};
|
||||
const timeData = dialogData.timestamp.toCalendrier()
|
||||
const conf = {
|
||||
title: `Chronologie - ${timeData.jourDuMois} ${timeData.mois.label} - Heure ${timeData.heure.label}`,
|
||||
content: html,
|
||||
buttons: {
|
||||
}
|
||||
};
|
||||
super(conf, options);
|
||||
this.dialogData = dialogData;
|
||||
}
|
||||
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
this.html = html;
|
||||
super.activateListeners(html);
|
||||
this.showChronologiePreset(!game.journal.get(this.dialogData.journalId).canUserModify(game.user))
|
||||
|
||||
this.html.find("a.chronologie-preset-show").click(event => this.showChronologiePreset(true));
|
||||
this.html.find("a.chronologie-preset-hide").click(event => this.showChronologiePreset(false));
|
||||
this.html.find("button.chronologie-ajouter").click(event => this.ajouter());
|
||||
}
|
||||
|
||||
showChronologiePreset(showPreset) {
|
||||
HtmlUtility.showControlWhen(this.html.find(".chronologie-preset-show"), !showPreset);
|
||||
HtmlUtility.showControlWhen(this.html.find(".chronologie-preset-hide"), showPreset);
|
||||
HtmlUtility.showControlWhen(this.html.find(".chronologie-preset"), showPreset);
|
||||
}
|
||||
|
||||
async ajouter() {
|
||||
await this.forceValidation();
|
||||
const { journalId, journalEntry } = this.findJournal();
|
||||
// ajouter à la page ou créer une page
|
||||
this.addContentToJournal(journalEntry, await this.prepareChronologieEntry());
|
||||
if (journalEntry?.canUserModify(game.user)) {
|
||||
const journalParameters = this.extractJournalParameters();
|
||||
|
||||
this.storeLatestUsedJournalEntry(journalId);
|
||||
const jour = journalParameters.dateRdD.jour;
|
||||
const mois = journalParameters.dateRdD.mois.label;
|
||||
const annee = journalParameters.dateRdD.annee;
|
||||
const section = `${jour} ${mois} ${annee}`
|
||||
const content = await this.prepareChronologieEntry(journalParameters);
|
||||
// ajouter à la page ou créer une page
|
||||
this.addContentToJournal(journalEntry, section, content);
|
||||
this.storeLatestUsedJournalEntry(journalId);
|
||||
this.close();
|
||||
}
|
||||
else {
|
||||
const journal = this.html.find("form.rdddialogchrono select[name='journalId']").val();
|
||||
ui.notifications.warn(`Le journal ${journal} n'est pas accessible`);
|
||||
}
|
||||
}
|
||||
|
||||
async forceValidation() {
|
||||
@ -82,8 +108,8 @@ export class DialogChronologie extends Dialog {
|
||||
return { journalId, journalEntry };
|
||||
}
|
||||
|
||||
async prepareChronologieEntry() {
|
||||
return await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/chronologie-entry.html", this.extractJournalParameters());
|
||||
async prepareChronologieEntry(journalParameters) {
|
||||
return await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/chronologie-entry.html", journalParameters);
|
||||
}
|
||||
|
||||
extractJournalParameters() {
|
||||
@ -101,19 +127,19 @@ export class DialogChronologie extends Dialog {
|
||||
}
|
||||
}
|
||||
|
||||
addContentToJournal(journalEntry, content) {
|
||||
let page = journalEntry.pages.find(p => p.type == 'text' && Grammar.equalsInsensitive(p.name, 'Chronologie'));
|
||||
addContentToJournal(journalEntry, section, content) {
|
||||
let page = journalEntry.pages.find(p => p.type == 'text' && Grammar.equalsInsensitive(p.name, section));
|
||||
if (page) {
|
||||
page.update({ 'text.content': content + '\n' + page.text.content });
|
||||
page.update({ 'text.content': page.text.content + '\n' + content });
|
||||
}
|
||||
else {
|
||||
journalEntry.createEmbeddedDocuments('JournalEntryPage', [this.newPageChronologie(content)]);
|
||||
journalEntry.createEmbeddedDocuments('JournalEntryPage', [this.newPageChronologie(section, content)]);
|
||||
}
|
||||
}
|
||||
|
||||
newPageChronologie(content) {
|
||||
newPageChronologie(section, content) {
|
||||
return new JournalEntryPage({
|
||||
name: 'Chronologie',
|
||||
name: section,
|
||||
type: 'text',
|
||||
title: { show: true, level: 1 },
|
||||
text: { content: content, format: 1 }
|
||||
|
@ -98,7 +98,7 @@ export class DialogCreateSigneDraconique extends Dialog {
|
||||
|
||||
async setEphemere(ephemere) {
|
||||
this.dialogData.signe.system.ephemere = ephemere;
|
||||
HtmlUtility._showControlWhen(this.html.find(".signe-system-duree"), ephemere);
|
||||
HtmlUtility.showControlWhen(this.html.find(".signe-system-duree"), ephemere);
|
||||
}
|
||||
|
||||
async onSelectActor(event) {
|
||||
|
@ -86,6 +86,6 @@ export class DialogItemVente extends Dialog {
|
||||
setQuantiteIllimite(checked) {
|
||||
this.venteData.quantiteIllimite = checked;
|
||||
this.html.find(".label-quantiteIllimite").text(this.venteData.quantiteIllimite ? "Illimités" : "disponibles");
|
||||
HtmlUtility._showControlWhen(this.html.find(".quantiteNbLots"), !this.venteData.quantiteIllimite)
|
||||
HtmlUtility.showControlWhen(this.html.find(".quantiteNbLots"), !this.venteData.quantiteIllimite)
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
export class HtmlUtility{
|
||||
static _showControlWhen(jQuerySelector, condition) {
|
||||
static showControlWhen(jQuerySelector, condition) {
|
||||
if (condition) {
|
||||
jQuerySelector.show();
|
||||
}
|
||||
|
@ -156,8 +156,8 @@ export class RdDItemSheet extends ItemSheet {
|
||||
super.activateListeners(html);
|
||||
this.html = html;
|
||||
|
||||
HtmlUtility._showControlWhen(this.html.find(".item-cout"), ReglesOptionelles.isUsing('afficher-prix-joueurs') || game.user.isGM || !this.item.isOwned);
|
||||
HtmlUtility._showControlWhen(this.html.find(".item-magique"), this.item.isMagique());
|
||||
HtmlUtility.showControlWhen(this.html.find(".item-cout"), ReglesOptionelles.isUsing('afficher-prix-joueurs') || game.user.isGM || !this.item.isOwned);
|
||||
HtmlUtility.showControlWhen(this.html.find(".item-magique"), this.item.isMagique());
|
||||
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
@ -10,7 +10,7 @@ export class RdDAstrologieEditeur extends Dialog {
|
||||
|
||||
let myButtons = {
|
||||
resetButton: { label: "Re-tirer les nombres astraux", callback: html => this.resetNombreAstraux() },
|
||||
saveButton: { label: "Fermer", callback: html => this.fillData() }
|
||||
saveButton: { label: "Fermer", callback: html => {} }
|
||||
};
|
||||
|
||||
// Common conf
|
||||
@ -41,10 +41,6 @@ export class RdDAstrologieEditeur extends Dialog {
|
||||
game.system.rdd.calendrier.showAstrologieEditor();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
fillData() {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
updateData(calendrierData) {
|
||||
this.calendrierData = duplicate(calendrierData);
|
||||
|
@ -33,7 +33,7 @@ export class RdDAstrologieJoueur extends Dialog {
|
||||
content: html,
|
||||
default: "saveButton",
|
||||
buttons: {
|
||||
saveButton: { label: "Fermer", callback: html => this.quitDialog() }
|
||||
saveButton: { label: "Fermer", callback: html => {} }
|
||||
},
|
||||
};
|
||||
super(dialogConf, dialogOptions);
|
||||
@ -93,8 +93,4 @@ export class RdDAstrologieJoueur extends Dialog {
|
||||
this.close();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
quitDialog() {
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -210,15 +210,10 @@ export class RdDCalendrier extends Application {
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getCurrentNombreAstral() {
|
||||
return this.getNombreAstral(this.timestamp.indexDate);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
resetNombreAstral() {
|
||||
this.listeNombreAstral = [];
|
||||
game.settings.set(SYSTEM_RDD, "liste-nombre-astral", this.listeNombreAstral);
|
||||
game.settings.set(SYSTEM_RDD, "liste-nombre-astral", []);
|
||||
|
||||
game.socket.emit(SYSTEM_SOCKET_ID, {
|
||||
msg: "msg_reset_nombre_astral",
|
||||
@ -227,10 +222,19 @@ export class RdDCalendrier extends Application {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getNombreAstral(indexDate) {
|
||||
/**
|
||||
*
|
||||
* @param {*} indexDate la date pour laquelle obtenir le nombre astral. Si undefined, on prend la date du jour
|
||||
* @returns le nombre astral pour la date, ou pour la date du jour si la date n'est pas fournie.
|
||||
* Si aucun nombre astral n'est trouvé, retourne 0 (cas où l'on demanderait un nombre astral en dehors des 12 jours courant et à venir)
|
||||
*/
|
||||
getNombreAstral(indexDate = undefined) {
|
||||
if (indexDate == undefined) {
|
||||
indexDate = this.timestamp.indexDate;
|
||||
}
|
||||
const listNombreAstral = this.getListeNombreAstral();
|
||||
let astralData = listNombreAstral.find((nombreAstral, i) => nombreAstral.index == indexDate);
|
||||
return astralData?.nombreAstral;
|
||||
return astralData?.nombreAstral ?? 0;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -285,8 +289,13 @@ 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))
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -354,38 +363,15 @@ export class RdDCalendrier extends Application {
|
||||
game.settings.set(SYSTEM_RDD, "liste-nombre-astral", this.listeNombreAstral);
|
||||
}
|
||||
|
||||
getHeureChance(heure) {
|
||||
return heure + (this.getCurrentNombreAstral() ?? 1) - 1;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getHeuresChanceMalchance(heureNaissance) {
|
||||
let defHeure = RdDTimestamp.findHeure(heureNaissance);
|
||||
if (defHeure) {
|
||||
const signe = h => h % RDD_HEURES_PAR_JOUR;
|
||||
const chance = this.getHeureChance(defHeure.heure);
|
||||
return [
|
||||
{ ajustement: "+4", heures: [signe(chance)] },
|
||||
{ ajustement: "+2", heures: [signe(chance + 4), signe(chance + 8)] },
|
||||
{ ajustement: "-4", heures: [signe(chance + 6)] },
|
||||
{ ajustement: "-2", heures: [signe(chance + 3), signe(chance + 9)] }
|
||||
];
|
||||
}
|
||||
return [];
|
||||
static ecartHeureChance(heureNaissance, nombreAstral, heure) {
|
||||
return (heureNaissance + nombreAstral - heure) % RDD_HEURES_PAR_JOUR;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getAjustementAstrologique(heureNaissance, name = undefined) {
|
||||
let defHeure = RdDTimestamp.findHeure(heureNaissance);
|
||||
if (defHeure) {
|
||||
const chance = this.getHeureChance(defHeure.heure);
|
||||
const ecartChance = (chance - this.timestamp.heure) % RDD_HEURES_PAR_JOUR;
|
||||
switch (ecartChance) {
|
||||
case 0: return 4;
|
||||
case 4: case 8: return 2;
|
||||
case 6: return -4;
|
||||
case 3: case 9: return -2;
|
||||
}
|
||||
return RdDCalendrier.ajustementAstrologiqueHeure(defHeure.heure, this.getNombreAstral(), this.timestamp.heure);
|
||||
}
|
||||
else if (name) {
|
||||
ui.notifications.warn(name + " n'a pas d'heure de naissance, ou elle est incorrecte : " + heureNaissance);
|
||||
@ -396,6 +382,16 @@ export class RdDCalendrier extends Application {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ajustementAstrologiqueHeure(hn, nbAstral, heure) {
|
||||
switch (RdDCalendrier.ecartHeureChance(hn, nbAstral, heure)) {
|
||||
case 0: return 4;
|
||||
case 4: case 8: return 2;
|
||||
case 6: return -4;
|
||||
case 3: case 9: return -2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getData() {
|
||||
let formData = super.getData();
|
||||
@ -428,9 +424,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.getNombreAstral() ?? "?");
|
||||
}
|
||||
for (let handle of document.getElementsByClassName("calendar-date-rdd")) {
|
||||
handle.innerHTML = dateHTML;
|
||||
@ -486,13 +482,21 @@ export class RdDCalendrier extends Application {
|
||||
return astro;
|
||||
});
|
||||
|
||||
calendrierData.heuresParActeur = {};
|
||||
game.actors.filter(it => it.isPersonnage() && it.hasPlayerOwner).forEach(actor => {
|
||||
let heureNaissance = actor.getHeureNaissance();
|
||||
if (heureNaissance) {
|
||||
calendrierData.heuresParActeur[actor.name] = this.getHeuresChanceMalchance(heureNaissance);
|
||||
const nbAstral = this.getNombreAstral()
|
||||
calendrierData.heures = Array.from(Array(RDD_HEURES_PAR_JOUR).keys());
|
||||
calendrierData.ajustementsActeur = game.actors.filter(it => it.isPersonnage() && it.hasPlayerOwner).map(actor => {
|
||||
return {
|
||||
actor,
|
||||
ajustements: calendrierData.heures.map(heure => {
|
||||
const hn = RdDTimestamp.findHeure(actor.getHeureNaissance())?.heure;
|
||||
return {
|
||||
heure,
|
||||
ajustement: RdDCalendrier.ajustementAstrologiqueHeure(hn, nbAstral, heure)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/calendar-astrologie-template.html', calendrierData);
|
||||
let astrologieEditeur = new RdDAstrologieEditeur(html, this, calendrierData)
|
||||
astrologieEditeur.updateData(calendrierData);
|
||||
|
@ -276,11 +276,11 @@ export class RdDRoll extends Dialog {
|
||||
const diffVariable = RdDItemSort.isDifficulteVariable(sort);
|
||||
const coutVariable = RdDItemSort.isCoutVariable(sort);
|
||||
|
||||
HtmlUtility._showControlWhen(this.html.find(".div-sort-non-rituel"), !sort.system.isrituel);
|
||||
HtmlUtility._showControlWhen(this.html.find(".div-sort-difficulte-var"), diffVariable);
|
||||
HtmlUtility._showControlWhen(this.html.find(".div-sort-difficulte-fixe"), !diffVariable);
|
||||
HtmlUtility._showControlWhen(this.html.find(".div-sort-ptreve-var"), coutVariable);
|
||||
HtmlUtility._showControlWhen(this.html.find(".div-sort-ptreve-fixe"), !coutVariable);
|
||||
HtmlUtility.showControlWhen(this.html.find(".div-sort-non-rituel"), !sort.system.isrituel);
|
||||
HtmlUtility.showControlWhen(this.html.find(".div-sort-difficulte-var"), diffVariable);
|
||||
HtmlUtility.showControlWhen(this.html.find(".div-sort-difficulte-fixe"), !diffVariable);
|
||||
HtmlUtility.showControlWhen(this.html.find(".div-sort-ptreve-var"), coutVariable);
|
||||
HtmlUtility.showControlWhen(this.html.find(".div-sort-ptreve-fixe"), !coutVariable);
|
||||
}
|
||||
|
||||
async setSelectedSigneDraconique(signe) {
|
||||
@ -311,11 +311,11 @@ export class RdDRoll extends Dialog {
|
||||
const resolutionTable = await RdDResolutionTable.buildHTMLTable(RdDResolutionTable.subTable(rollData.caracValue, rollData.finalLevel))
|
||||
const adjustements = await this.buildAjustements(rollData);
|
||||
|
||||
HtmlUtility._showControlWhen(this.html.find(".use-encTotal"), rollData.ajustements.encTotal.visible && RdDCarac.isAgiliteOuDerivee(rollData.selectedCarac));
|
||||
HtmlUtility._showControlWhen(this.html.find(".use-surenc"), rollData.ajustements.surenc.visible && RdDCarac.isActionPhysique(rollData.selectedCarac));
|
||||
HtmlUtility._showControlWhen(this.html.find(".utilisation-moral"), rollData.use.appelAuMoral);
|
||||
HtmlUtility._showControlWhen(this.html.find(".diffMoral"), rollData.ajustements.moralTotal.used);
|
||||
HtmlUtility._showControlWhen(this.html.find(".divAppelAuMoral"), rollData.use.appelAuMoral);
|
||||
HtmlUtility.showControlWhen(this.html.find(".use-encTotal"), rollData.ajustements.encTotal.visible && RdDCarac.isAgiliteOuDerivee(rollData.selectedCarac));
|
||||
HtmlUtility.showControlWhen(this.html.find(".use-surenc"), rollData.ajustements.surenc.visible && RdDCarac.isActionPhysique(rollData.selectedCarac));
|
||||
HtmlUtility.showControlWhen(this.html.find(".utilisation-moral"), rollData.use.appelAuMoral);
|
||||
HtmlUtility.showControlWhen(this.html.find(".diffMoral"), rollData.ajustements.moralTotal.used);
|
||||
HtmlUtility.showControlWhen(this.html.find(".divAppelAuMoral"), rollData.use.appelAuMoral);
|
||||
|
||||
// Mise à jour valeurs
|
||||
this.html.find(".dialog-roll-title").text(this._getTitle(rollData));
|
||||
|
@ -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
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -208,8 +208,8 @@ export class RdDTMRDialog extends Dialog {
|
||||
return;
|
||||
}
|
||||
|
||||
HtmlUtility._showControlWhen(this.html.find(".appliquerFatigue"), ReglesOptionelles.isUsing("appliquer-fatigue"));
|
||||
HtmlUtility._showControlWhen(this.html.find(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(this._getActorCoord()));
|
||||
HtmlUtility.showControlWhen(this.html.find(".appliquerFatigue"), ReglesOptionelles.isUsing("appliquer-fatigue"));
|
||||
HtmlUtility.showControlWhen(this.html.find(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(this._getActorCoord()));
|
||||
|
||||
// Roll Sort
|
||||
this.html.find('.lancer-sort').click((event) => {
|
||||
@ -246,7 +246,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
}
|
||||
const coord = this._getActorCoord();
|
||||
|
||||
HtmlUtility._showControlWhen(this.html.find(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(coord));
|
||||
HtmlUtility.showControlWhen(this.html.find(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(coord));
|
||||
|
||||
let ptsreve = document.getElementById("tmr-pointsreve-value");
|
||||
ptsreve.innerHTML = this.actor.system.reve.reve.value;
|
||||
|
@ -111,6 +111,6 @@ export class RdDTokenHud {
|
||||
|
||||
static _toggleHudListActive(hud, list) {
|
||||
hud.toggleClass('active');
|
||||
HtmlUtility._showControlWhen(list, hud.hasClass('active'));
|
||||
HtmlUtility.showControlWhen(list, hud.hasClass('active'));
|
||||
}
|
||||
}
|
@ -482,6 +482,9 @@ input:is(.blessure-premiers_soins, .blessure-soins_complets) {
|
||||
max-height: 1.5em;
|
||||
border-width: 0;
|
||||
}
|
||||
div.dimmed .img-signe-heure {
|
||||
opacity: 50%;
|
||||
}
|
||||
.button-effect-img {
|
||||
vertical-align: baseline;
|
||||
max-width: 16px;
|
||||
@ -1199,15 +1202,25 @@ div.competence-column div.categorie-competence{
|
||||
}
|
||||
|
||||
/* ======================================== */
|
||||
.table-nombres-astraux {
|
||||
border:1;
|
||||
table.table-nombres-astraux {
|
||||
border: 2px solid rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
table.table-nombres-astraux th >td {
|
||||
font-size: 1rem;
|
||||
}
|
||||
table.table-nombres-astraux tr >td {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
.table-nombres-astraux td {
|
||||
border: 1px solid black;
|
||||
table.table-nombres-astraux :is(tr, th, td) {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-color: rgba(102, 95, 122, 0.2);
|
||||
text-align: center;
|
||||
vertical-align: top;
|
||||
}
|
||||
table.table-nombres-astraux tr:hover {
|
||||
background-color: hsla(38, 20%, 50%, 0.5);
|
||||
}
|
||||
|
||||
/* ======================================== */
|
||||
.tokenhudext {
|
||||
@ -1518,7 +1531,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 +1543,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 +1557,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 +1609,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 +1617,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;
|
||||
@ -1628,54 +1640,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{
|
||||
@ -1692,17 +1705,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;
|
||||
|
@ -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.4",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.5.4.zip",
|
||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json",
|
||||
"compatibility": {
|
||||
"minimum": "10",
|
||||
|
@ -8,16 +8,16 @@
|
||||
<section class="sheet-body">
|
||||
<div class="form-group">
|
||||
<table class='table-nombres-astraux'>
|
||||
<tr class='table-nombres-astraux-td'>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
{{#each astrologieData as |nombreData key|}}
|
||||
<td class='table-nombres-astraux-td'>{{nombreData.date.jour}}{{timestamp-imgSigneHeure nombreData.date.mois}}</td>
|
||||
<th>{{nombreData.date.jour}}{{timestamp-imgSigneHeure nombreData.date.mois}}</th>
|
||||
{{/each}}
|
||||
</tr>
|
||||
<tr class='table-nombres-astraux-td'>
|
||||
<tr>
|
||||
<th>Nombre astral</th>
|
||||
{{#each astrologieData as |nombreData key|}}
|
||||
<td class='table-nombres-astraux-td'>
|
||||
<td>
|
||||
<ol>
|
||||
<b>{{nombreData.nombreAstral}}</b>
|
||||
{{#each nombreData.valeursFausses as |fausseVal key|}}
|
||||
@ -30,24 +30,35 @@
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="alterne-list">
|
||||
{{#each heuresParActeur as |heuresDef name|}}
|
||||
<li class="list-item flexrow">
|
||||
<span><strong>{{name}}</strong>:</span>
|
||||
<span class="flex-grow-2">
|
||||
|{{#each heuresDef as |ajustement|}}
|
||||
<span>
|
||||
<strong>{{ajustement.ajustement}}</strong>
|
||||
{{#each ajustement.heures as |heure|}}
|
||||
{{timestamp-imgSigneHeure heure}}
|
||||
{{/each}}
|
||||
|
|
||||
</span>
|
||||
{{/each}}
|
||||
</span>
|
||||
</li>
|
||||
<table class='table-nombres-astraux'>
|
||||
<tr>
|
||||
<th></th>
|
||||
{{#each heures as |heure|}}
|
||||
<th>
|
||||
{{timestamp-imgSigneHeure heure}}
|
||||
</th>
|
||||
{{/each}}
|
||||
</tr>
|
||||
{{#each ajustementsActeur as |ajustementActeur|}}
|
||||
<tr>
|
||||
<td>
|
||||
<img class="img-signe-heure" src="{{actor.img}}" title="{{actor.name}}" />
|
||||
{{actor.name}}
|
||||
</td>
|
||||
{{#each ajustementActeur.ajustements as |ajustement|}}
|
||||
<td>{{#if (ne ajustement.ajustement 0)}}
|
||||
<strong>
|
||||
{{numberFormat ajustement.ajustement decimals=0 sign=true}}
|
||||
</strong>
|
||||
{{else}}
|
||||
<div class="dimmed">
|
||||
{{timestamp-imgSigneHeure ajustement.heure}}
|
||||
</div>
|
||||
{{/if}}</td>
|
||||
{{/each}}
|
||||
</tr>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
|
@ -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>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<h2>{{dateRdD.jour}} {{dateRdD.mois.label}} {{dateRdD.annee}}, à l'heure de {{dateRdD.heure.label}}</h2>
|
||||
<h2>Heure de {{dateRdD.heure.label}}</h2>
|
||||
<p>{{information}}</p>
|
||||
<p class="poesie-reference">Par {{auteur}} ({{dateReel}})</p>
|
||||
<hr>
|
||||
|
@ -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"}}
|
||||
|
@ -1,27 +1,23 @@
|
||||
<form class="rdddialogchrono">
|
||||
<div class="flexcol">
|
||||
<div class="form-group">
|
||||
<label for="auteur">Auteur</label>
|
||||
<label class="flex-shrink" 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">
|
||||
<div class="form-group chronologie-preset">
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/common/timestamp.hbs"
|
||||
(timestamp-extract timestamp)
|
||||
(timestamp-extract timestamp)
|
||||
path='chronologie'
|
||||
label='Date en jeu'
|
||||
disabled=''
|
||||
}}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dateReel">Date réelle</label>
|
||||
<div class="form-group chronologie-preset">
|
||||
<label class="flex-shrink" for="dateReel">Date réelle</label>
|
||||
<input type="datetime-local" name="dateReel" value="{{dateReel}}" data-dtype="String" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="journalId">Journal</label>
|
||||
<div class="form-group chronologie-preset">
|
||||
<label class="flex-shrink" for="journalId">Journal</label>
|
||||
<select type="text" name="journalId" value="{{journalId}}" data-dtype="String">
|
||||
{{#select journalId}}
|
||||
<option value=""></option>
|
||||
@ -39,5 +35,18 @@
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group chronologie-preset">
|
||||
<hr>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="flex-shrink" for="information">Information
|
||||
<a class="chronologie-preset-show"><i class="fas fa-plus-square"></i></a>
|
||||
<a class="chronologie-preset-hide"><i class="fas fa-minus-square"></i></a>
|
||||
</label>
|
||||
<textarea autocomplete="off" title="Information" name="information" autofocus>{{information}}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button class="chronologie-ajouter">Ajouter au journal</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
@ -1,8 +0,0 @@
|
||||
<div class="post-item">
|
||||
{{#if img}}
|
||||
<img class="chat-icon" src="{{img}}" title="{{name}}" />
|
||||
{{/if}}
|
||||
<p>{{> 'systems/foundryvtt-reve-de-dragon/templates/common/compendium-link.hbs' pack=pack id=id name=name docType=docType}}</p>
|
||||
<p class="card-content">{{{system.description}}}</p>
|
||||
|
||||
</div>
|
Reference in New Issue
Block a user