Fix Hook init usage in v12

This commit is contained in:
LeRatierBretonnien 2025-01-14 00:39:28 +01:00
parent 72a9752820
commit b524716ede
3 changed files with 8 additions and 7 deletions

View File

@ -6,8 +6,8 @@ import { ExportScriptarium } from "./export-scriptarium.js";
import { CATEGORIES_COMPETENCES, CATEGORIES_DRACONIC, Mapping } from "./mapping.js"; import { CATEGORIES_COMPETENCES, CATEGORIES_DRACONIC, Mapping } from "./mapping.js";
export class RdDActorExportSheet extends RdDActorSheet { export class RdDActorExportSheet extends RdDActorSheet {
static async init() { static init() {
await loadTemplates([ loadTemplates([
"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/arme.hbs", "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/arme.hbs",
"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/blessure.hbs", "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/blessure.hbs",
"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/blessures.hbs", "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/blessures.hbs",
@ -23,6 +23,7 @@ export class RdDActorExportSheet extends RdDActorSheet {
]) ])
Actors.registerSheet(SYSTEM_RDD, RdDActorExportSheet, { types: ["personnage"], makeDefault: false, label: "Feuille simplifiée" }) Actors.registerSheet(SYSTEM_RDD, RdDActorExportSheet, { types: ["personnage"], makeDefault: false, label: "Feuille simplifiée" })
} }
static get defaultOptions() { static get defaultOptions() {
return foundry.utils.mergeObject(RdDActorSheet.defaultOptions, { return foundry.utils.mergeObject(RdDActorSheet.defaultOptions, {
template: "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/actor-encart-sheet.hbs", template: "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/actor-encart-sheet.hbs",

View File

@ -123,14 +123,14 @@ export class SystemReveDeDragon {
/* -------------------------------------------- */ /* -------------------------------------------- */
/* Foundry VTT Initialization */ /* Foundry VTT Initialization */
/* -------------------------------------------- */ /* -------------------------------------------- */
async onInit() { onInit() {
game.system.rdd = this game.system.rdd = this
this.AppAstrologie = AppAstrologie this.AppAstrologie = AppAstrologie
console.log(`Initializing Reve de Dragon System Settings`) console.log(`Initializing Reve de Dragon System Settings`)
// preload handlebars templates // preload handlebars templates
await RdDUtility.preloadHandlebarsTemplates() RdDUtility.preloadHandlebarsTemplates()
AppPersonnageAleatoire.preloadHandlebars() AppPersonnageAleatoire.preloadHandlebars()
RdDItemSort.preloadHandlebars() RdDItemSort.preloadHandlebars()
@ -187,7 +187,7 @@ export class SystemReveDeDragon {
Actors.registerSheet(SYSTEM_RDD, RdDActorVehiculeSheet, { types: ["vehicule"], makeDefault: true }) Actors.registerSheet(SYSTEM_RDD, RdDActorVehiculeSheet, { types: ["vehicule"], makeDefault: true })
Actors.registerSheet(SYSTEM_RDD, RdDActorEntiteSheet, { types: ["entite"], makeDefault: true }) Actors.registerSheet(SYSTEM_RDD, RdDActorEntiteSheet, { types: ["entite"], makeDefault: true })
Items.unregisterSheet("core", ItemSheet) Items.unregisterSheet("core", ItemSheet)
await RdDActorExportSheet.init() RdDActorExportSheet.init()
RdDItemSheet.register(RdDSigneDraconiqueItemSheet) RdDItemSheet.register(RdDSigneDraconiqueItemSheet)
RdDItemSheet.register(RdDRencontreItemSheet) RdDItemSheet.register(RdDRencontreItemSheet)

View File

@ -107,7 +107,7 @@ export class RdDUtility {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static async preloadHandlebarsTemplates() { static preloadHandlebarsTemplates() {
const templatePaths = [ const templatePaths = [
//Character Sheets //Character Sheets
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/actor-sheet.html',
@ -341,7 +341,7 @@ export class RdDUtility {
Handlebars.registerHelper('typeTmr-name', type => TMRUtility.typeTmrName(type)); Handlebars.registerHelper('typeTmr-name', type => TMRUtility.typeTmrName(type));
Handlebars.registerHelper('effetRencontre-name', coord => TMRUtility.typeTmrName(coord)); Handlebars.registerHelper('effetRencontre-name', coord => TMRUtility.typeTmrName(coord));
await loadTemplates(templatePaths); loadTemplates(templatePaths);
} }
static getItem(itemId, actorId = undefined) { static getItem(itemId, actorId = undefined) {