Init settings before sheets
Eviter que le chargement d'acteurs ait lieu avant le chargement des settings
This commit is contained in:
parent
174ef4256a
commit
90d46c6a78
@ -8,7 +8,7 @@ const LATEST_USED_JOURNAL_ID = "chronologie-dernier-journal";
|
||||
|
||||
export class DialogChronologie extends Dialog {
|
||||
|
||||
static init() {
|
||||
static initSettings() {
|
||||
game.settings.register(SYSTEM_RDD, LATEST_USED_JOURNAL_ID, {
|
||||
name: "Dernier article de journal utilisé pour enregistrer la chronologie",
|
||||
scope: "client",
|
||||
|
@ -7,7 +7,7 @@ import { CompendiumTableHelpers, CompendiumTable, SystemCompendiums } from "./se
|
||||
const COMPENDIUMS_RECHERCHE = 'compendiums-recherche';
|
||||
|
||||
export class Environnement {
|
||||
static init() {
|
||||
static initSettings() {
|
||||
game.settings.register(SYSTEM_RDD, COMPENDIUMS_RECHERCHE, {
|
||||
name: COMPENDIUMS_RECHERCHE,
|
||||
default: [
|
||||
|
@ -79,8 +79,7 @@ export class RdDHotbar {
|
||||
* Actor - open actor sheet
|
||||
* Journal - open journal sheet
|
||||
*/
|
||||
static init() {
|
||||
|
||||
static initHooks() {
|
||||
Hooks.on('hotbarDrop', (bar, documentData, slot) => {
|
||||
|
||||
// Create item macro if rollable item - weapon, spell, prayer, trait, or skill
|
||||
|
@ -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 {
|
||||
@ -147,6 +154,7 @@ export class SystemReveDeDragon {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
// Define custom Entity classes
|
||||
console.log(`Initializing Reve de Dragon Documents`)
|
||||
CONFIG.Actor.documentClass = RdDBaseActor
|
||||
CONFIG.Item.documentClass = RdDItem
|
||||
CONFIG.RDD = {
|
||||
@ -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()
|
||||
|
||||
|
@ -34,7 +34,7 @@ const TMR_DISPLAY_SIZE = {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class RdDTMRDialog extends Dialog {
|
||||
static async init() {
|
||||
static initSettings() {
|
||||
game.settings.register(SYSTEM_RDD, TMR_DISPLAY_SIZE.code, {
|
||||
name: 'Taille des cases des TMR',
|
||||
hint: "Taille en pixel des cases des TMR (réglable directement dans la fenêtre des TMR)",
|
||||
|
@ -8,7 +8,7 @@ const OPTIONS_AVANCEES = [
|
||||
]
|
||||
|
||||
export class OptionsAvancees extends FormApplication {
|
||||
static init() {
|
||||
static initSettings() {
|
||||
for (const regle of OPTIONS_AVANCEES) {
|
||||
const name = regle.name
|
||||
const id = OptionsAvancees._getId(name)
|
||||
|
@ -46,7 +46,7 @@ const listeReglesOptionnelles = [
|
||||
const uniquementJoueur = listeReglesOptionnelles.filter(it => it.uniquementJoueur).map(it=>it.name);
|
||||
|
||||
export class ReglesOptionnelles extends FormApplication {
|
||||
static init() {
|
||||
static initSettings() {
|
||||
for (const regle of listeReglesOptionnelles) {
|
||||
const name = regle.name;
|
||||
const id = ReglesOptionnelles._getIdRegle(name);
|
||||
|
@ -25,7 +25,7 @@ const CONFIGURABLE_COMPENDIUMS = {
|
||||
* ======= Gestion des accès aux compendiums systèmes (ou surchargés) =======
|
||||
*/
|
||||
export class SystemCompendiums extends FormApplication {
|
||||
static init() {
|
||||
static initSettings() {
|
||||
Object.keys(CONFIGURABLE_COMPENDIUMS).forEach(compendium => {
|
||||
const definition = CONFIGURABLE_COMPENDIUMS[compendium];
|
||||
foundry.utils.mergeObject(definition, {
|
||||
|
@ -4,7 +4,7 @@ export const AUTO_ADJUST_DARKNESS = "auto-adjust-darkness";
|
||||
|
||||
export class AutoAdjustDarkness {
|
||||
|
||||
static init() {
|
||||
static initSettings() {
|
||||
game.settings.register(SYSTEM_RDD, AUTO_ADJUST_DARKNESS, {
|
||||
name: AUTO_ADJUST_DARKNESS,
|
||||
scope: "world",
|
||||
|
@ -15,7 +15,7 @@ const TEMPLATE_CALENDRIER = "systems/foundryvtt-reve-de-dragon/templates/time/ca
|
||||
const INITIAL_CALENDAR_POS = { top: 200, left: 200, horlogeAnalogique: true };
|
||||
/* -------------------------------------------- */
|
||||
export class RdDCalendrier extends Application {
|
||||
static init() {
|
||||
static initSettings() {
|
||||
game.settings.register(SYSTEM_RDD, "liste-nombre-astral", {
|
||||
name: "liste-nombre-astral",
|
||||
scope: "world",
|
||||
|
@ -49,7 +49,7 @@ const FORMULES_PERIODE = [
|
||||
|
||||
export class RdDTimestamp {
|
||||
|
||||
static init() {
|
||||
static initSettings() {
|
||||
game.settings.register(SYSTEM_RDD, WORLD_TIMESTAMP_SETTING, {
|
||||
name: WORLD_TIMESTAMP_SETTING,
|
||||
scope: "world",
|
||||
|
Loading…
Reference in New Issue
Block a user