Fix: Fenêtre d'édition du calendrier
Ajout d'un helper Handlebars pour accéder à l'objet RDD_CONFIG sans avoir besoin de l'ajouter dans les données pour rendu du template
This commit is contained in:
@ -1146,8 +1146,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
diffNbDoses: -Number(this.system.compteurs.ethylisme.nb_doses || 0),
|
||||
finalLevel: 0,
|
||||
diffConditions: 0,
|
||||
ajustementsForce: CONFIG.RDD.difficultesLibres,
|
||||
config: game.system.rdd.config
|
||||
ajustementsForce: CONFIG.RDD.difficultesLibres
|
||||
}
|
||||
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-ethylisme.html', rollData);
|
||||
new RdDRollDialogEthylisme(html, rollData, this, r => this.saouler(r.forceAlcool)).render(true);
|
||||
|
@ -38,8 +38,7 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
description: await TextEditor.enrichHTML(this.actor.system.description, { async: true }),
|
||||
notesmj: await TextEditor.enrichHTML(this.actor.system.notesmj, { async: true }),
|
||||
options: RdDSheetUtility.mergeDocumentRights(this.options, this.actor, this.isEditable),
|
||||
effects: this.actor.effects,
|
||||
config: game.system.rdd.config
|
||||
effects: this.actor.effects
|
||||
}
|
||||
|
||||
RdDBaseActorSheet.filterItemsPerTypeForSheet(formData, this.actor.itemTypes);
|
||||
|
@ -25,7 +25,6 @@ export class DialogChronologie extends Dialog {
|
||||
journalId: game.settings.get(SYSTEM_RDD, LATEST_USED_JOURNAL_ID),
|
||||
journaux: game.journal.filter(it => it.testUserPermission(game.user, CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER)),
|
||||
timestamp: game.system.rdd.calendrier.timestamp,
|
||||
config: game.system.rdd.config,
|
||||
dateReel: game.system.rdd.calendrier.dateReel()
|
||||
};
|
||||
const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/dialog-chronologie.html", dialogData);
|
||||
|
@ -99,7 +99,6 @@ export class RdDItemSheet extends ItemSheet {
|
||||
descriptionmj: await TextEditor.enrichHTML(this.item.system.descriptionmj, { async: true }),
|
||||
isComestible: this.item.getUtilisationCuisine(),
|
||||
options: RdDSheetUtility.mergeDocumentRights(this.options, this.item, this.isEditable),
|
||||
config: game.system.rdd.config
|
||||
}
|
||||
if (this.item.type == TYPES.competencecreature) {
|
||||
formData.isparade = RdDItemCompetenceCreature.isParade(this.item)
|
||||
|
@ -71,15 +71,16 @@ import { RdDTMRDialog } from "./rdd-tmr-dialog.js";
|
||||
* Software License: GNU GPLv3
|
||||
*/
|
||||
export class SystemReveDeDragon {
|
||||
|
||||
|
||||
static start() {
|
||||
const system = new SystemReveDeDragon()
|
||||
Hooks.once('init', async () => await system.onInit())
|
||||
Hooks.once('diceSoNiceReady', (dice3d) => RdDDice.diceSoNiceReady(dice3d))
|
||||
Hooks.once('ready', () => system.onReady())
|
||||
}
|
||||
|
||||
|
||||
constructor() {
|
||||
this.config = RDD_CONFIG;
|
||||
this.RdDUtility = RdDUtility;
|
||||
this.RdDHotbar = RdDHotbar;
|
||||
this.itemClasses = {
|
||||
@ -108,7 +109,6 @@ export class SystemReveDeDragon {
|
||||
/* -------------------------------------------- */
|
||||
async onInit() {
|
||||
game.system.rdd = this;
|
||||
game.system.rdd.config = RDD_CONFIG;
|
||||
this.AppAstrologie = AppAstrologie;
|
||||
|
||||
|
||||
|
@ -19,6 +19,7 @@ import { RdDEmpoignade } from "./rdd-empoignade.js";
|
||||
import { ExperienceLog } from "./actor/experience-log.js";
|
||||
import { RdDCoeur } from "./coeur/rdd-coeur.js";
|
||||
import { APP_ASTROLOGIE_REFRESH } from "./sommeil/app-astrologie.js";
|
||||
import { RDD_CONFIG } from "./constants.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
// This table starts at 0 -> niveau -10
|
||||
@ -262,8 +263,6 @@ export class RdDUtility {
|
||||
];
|
||||
|
||||
Handlebars.registerHelper('either', (a, b) => a ?? b);
|
||||
Handlebars.registerHelper('computeResolutionScore', (row, col) => RdDResolutionTable.computePercentage(row, col));
|
||||
Handlebars.registerHelper('computeResolutionChances', (row, col) => RdDResolutionTable.computeChances(row, col));
|
||||
Handlebars.registerHelper('upperFirst', str => Misc.upperFirst(str ?? 'Null'));
|
||||
Handlebars.registerHelper('lowerFirst', str => Misc.lowerFirst(str ?? 'Null'));
|
||||
Handlebars.registerHelper('upper', str => str?.toUpperCase() ?? '');
|
||||
@ -272,6 +271,10 @@ export class RdDUtility {
|
||||
Handlebars.registerHelper('apostrophe', (article, str) => Grammar.apostrophe(article, str));
|
||||
Handlebars.registerHelper('un', str => Grammar.articleIndetermine(str));
|
||||
Handlebars.registerHelper('accord', (genre, ...args) => Grammar.accord(genre, args));
|
||||
|
||||
Handlebars.registerHelper('RDD_CONFIG', path => RDD_CONFIG[path])
|
||||
Handlebars.registerHelper('computeResolutionScore', (row, col) => RdDResolutionTable.computePercentage(row, col));
|
||||
Handlebars.registerHelper('computeResolutionChances', (row, col) => RdDResolutionTable.computeChances(row, col));
|
||||
Handlebars.registerHelper('buildLigneInventaire', (item, options) => { return new Handlebars.SafeString(RdDUtility.buildLigneInventaire(item, options)); });
|
||||
Handlebars.registerHelper('buildInventaireConteneur', (actorId, itemId, options) => { return new Handlebars.SafeString(RdDUtility.buildInventaireConteneur(actorId, itemId, options)); });
|
||||
Handlebars.registerHelper('buildContenuConteneur', (item, options) => { return new Handlebars.SafeString(RdDUtility.buildContenuConteneur(item, options)); });
|
||||
|
@ -123,9 +123,9 @@ export class RdDCalendrier extends Application {
|
||||
/* -------------------------------------------- */
|
||||
fillCalendrierData(formData = {}) {
|
||||
foundry.utils.mergeObject(formData, this.timestamp.toCalendrier());
|
||||
formData.isGM = game.user.isGM;
|
||||
formData.isGM = game.user.isGM
|
||||
formData.heures = RdDTimestamp.definitions()
|
||||
formData.horlogeAnalogique = this.horlogeAnalogique;
|
||||
formData.horlogeAnalogique = this.horlogeAnalogique
|
||||
formData.autoDarkness = AutoAdjustDarkness.isAuto()
|
||||
return formData;
|
||||
}
|
||||
@ -372,7 +372,7 @@ export class RdDCalendrier extends Application {
|
||||
game.socket.emit(SYSTEM_SOCKET_ID, { msg: "msg_app_astrologie_refresh", data: {} })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async addNbAstralJoueur(actor, date, nbAstral, isValid) {
|
||||
const nombresAstraux = this.getNombresAstraux()
|
||||
const astralData = nombresAstraux.find(it => it.index == date)
|
||||
|
Reference in New Issue
Block a user