Init settings before sheets
Eviter que le chargement d'acteurs ait lieu avant le chargement des settings
This commit is contained in:
@ -61,7 +61,7 @@ import { RdDSigneDraconiqueItemSheet } from "./item/sheet-signedraconique.js"
|
||||
import { RdDItemInventaireSheet } from "./item/sheet-base-inventaire.js"
|
||||
import { AppAstrologie } from "./sommeil/app-astrologie.js"
|
||||
import { RdDItemArmure } from "./item/armure.js"
|
||||
import { AutoAdjustDarkness as AutoAdjustDarkness } from "./time/auto-adjust-darkness.js"
|
||||
import { AutoAdjustDarkness } from "./time/auto-adjust-darkness.js"
|
||||
import { RdDCreature } from "./actor/creature.js"
|
||||
import { RdDTMRDialog } from "./rdd-tmr-dialog.js"
|
||||
import { OptionsAvancees } from "./settings/options-avancees.js"
|
||||
@ -80,7 +80,7 @@ export class SystemReveDeDragon {
|
||||
const system = new SystemReveDeDragon()
|
||||
Hooks.once('init', async () => await system.onInit())
|
||||
Hooks.once('diceSoNiceReady', (dice3d) => RdDDice.diceSoNiceReady(dice3d))
|
||||
Hooks.once('ready', () => system.onReady())
|
||||
Hooks.once('ready', async () => await system.onReady())
|
||||
}
|
||||
|
||||
constructor() {
|
||||
@ -115,24 +115,31 @@ export class SystemReveDeDragon {
|
||||
game.system.rdd = this
|
||||
this.AppAstrologie = AppAstrologie
|
||||
|
||||
|
||||
console.log(`Initializing Reve de Dragon System`)
|
||||
|
||||
console.log(`Initializing Reve de Dragon System Settings`)
|
||||
|
||||
// preload handlebars templates
|
||||
RdDUtility.preloadHandlebarsTemplates()
|
||||
AppPersonnageAleatoire.preloadHandlebars()
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
this.initSystemSettings()
|
||||
|
||||
ReglesOptionnelles.initSettings()
|
||||
OptionsAvancees.initSettings()
|
||||
AutoAdjustDarkness.initSettings()
|
||||
RdDTimestamp.initSettings()
|
||||
RdDCalendrier.initSettings()
|
||||
SystemCompendiums.initSettings()
|
||||
DialogChronologie.initSettings()
|
||||
RdDTMRDialog.initSettings()
|
||||
Environnement.initSettings()
|
||||
|
||||
this.initSettings()
|
||||
|
||||
/* -------------------------------------------- */
|
||||
// Set an initiative formula for the system
|
||||
CONFIG.Combat.initiative = {
|
||||
formula: "1+(1d6/10)",
|
||||
decimals: 2
|
||||
}
|
||||
|
||||
CONFIG.Combat.initiative = { formula: "1+(1d6/10)", decimals: 2 }
|
||||
|
||||
/* -------------------------------------------- */
|
||||
console.log(`Initializing Reve de Dragon Socket handlers`)
|
||||
game.socket.on(SYSTEM_SOCKET_ID, async (sockmsg) => {
|
||||
console.log(">>>>> MSG RECV", sockmsg)
|
||||
try {
|
||||
@ -144,9 +151,10 @@ export class SystemReveDeDragon {
|
||||
console.error('game.socket.on(SYSTEM_SOCKET_ID) Exception: ', sockmsg, ' => ', e)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
// Define custom Entity classes
|
||||
console.log(`Initializing Reve de Dragon Documents`)
|
||||
CONFIG.Actor.documentClass = RdDBaseActor
|
||||
CONFIG.Item.documentClass = RdDItem
|
||||
CONFIG.RDD = {
|
||||
@ -155,7 +163,7 @@ export class SystemReveDeDragon {
|
||||
ajustementsConditions: RdDUtility.getAjustementsConditions(),
|
||||
difficultesLibres: RdDUtility.getDifficultesLibres()
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
// Register sheet application classes
|
||||
Actors.unregisterSheet("core", ActorSheet)
|
||||
@ -166,7 +174,7 @@ export class SystemReveDeDragon {
|
||||
Actors.registerSheet(SYSTEM_RDD, RdDActorEntiteSheet, { types: ["entite"], makeDefault: true })
|
||||
Items.unregisterSheet("core", ItemSheet)
|
||||
await RdDActorExportSheet.init()
|
||||
|
||||
|
||||
RdDItemSheet.register(RdDSigneDraconiqueItemSheet)
|
||||
RdDItemSheet.register(RdDRencontreItemSheet)
|
||||
RdDItemSheet.register(RdDConteneurItemSheet)
|
||||
@ -176,7 +184,7 @@ export class SystemReveDeDragon {
|
||||
RdDItemSheet.register(RdDIngredientItemSheet)
|
||||
RdDItemSheet.register(RdDServiceItemSheet)
|
||||
RdDItemSheet.register(RdDBlessureItemSheet)
|
||||
|
||||
|
||||
Items.registerSheet(SYSTEM_RDD, RdDItemInventaireSheet, {
|
||||
types: [
|
||||
"objet", "arme", "armure", "livre", "potion", "munition",
|
||||
@ -192,16 +200,10 @@ export class SystemReveDeDragon {
|
||||
"tarot", "extraitpoetique", "empoignade"
|
||||
], makeDefault: true
|
||||
})
|
||||
CONFIG.Combat.documentClass = RdDCombatManager
|
||||
|
||||
// préparation des différents modules
|
||||
AutoAdjustDarkness.init()
|
||||
RdDTimestamp.init()
|
||||
RdDCalendrier.init()
|
||||
SystemCompendiums.init()
|
||||
DialogChronologie.init()
|
||||
ReglesOptionnelles.init()
|
||||
OptionsAvancees.init()
|
||||
console.log(`Initializing Reve de Dragon Hooks and handlers`)
|
||||
CONFIG.Combat.documentClass = RdDCombatManager
|
||||
RdDUtility.init()
|
||||
RdDDice.init()
|
||||
RdDCommands.init()
|
||||
@ -211,15 +213,14 @@ export class SystemReveDeDragon {
|
||||
RdDCompendiumOrganiser.init()
|
||||
EffetsDraconiques.init()
|
||||
TMRUtility.init()
|
||||
await RdDTMRDialog.init()
|
||||
RdDHotbar.init()
|
||||
RdDHotbar.initHooks()
|
||||
RdDPossession.init()
|
||||
TMRRencontres.init()
|
||||
Environnement.init()
|
||||
ExportScriptarium.init()
|
||||
}
|
||||
|
||||
initSystemSettings() {
|
||||
initSettings() {
|
||||
// TODO: déplacer vers les modules correspondants
|
||||
game.settings.register(SYSTEM_RDD, "accorder-entite-cauchemar", {
|
||||
name: "Accorder le rêve aux entités",
|
||||
hint: "A quel moment les personnages doivent accorder leur rêve aux entités de cauchemar",
|
||||
@ -318,4 +319,3 @@ export class SystemReveDeDragon {
|
||||
}
|
||||
|
||||
SystemReveDeDragon.start()
|
||||
|
||||
|
Reference in New Issue
Block a user