Added JournalCompendium with welcome message. Auto opens on first world entry (#539)

This commit is contained in:
WBHarry 2025-08-03 14:42:17 +02:00 committed by GitHub
parent 6ef28abd03
commit 195f624868
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 131 additions and 2 deletions

View file

@ -150,7 +150,7 @@ Hooks.once('init', () => {
return handlebarsRegistration();
});
Hooks.on('ready', () => {
Hooks.on('ready', async () => {
ui.resources = new CONFIG.ui.resources();
if (game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).displayFear !== 'hide')
ui.resources.render({ force: true });
@ -159,6 +159,14 @@ Hooks.on('ready', () => {
socketRegistration.registerSocketHooks();
registerRollDiceHooks();
socketRegistration.registerUserQueries();
if (!game.user.getFlag(CONFIG.DH.id, CONFIG.DH.FLAGS.userFlags.welcomeMessage)) {
const welcomeMessage = await foundry.utils.fromUuid(CONFIG.DH.GENERAL.compendiumJournals.welcome);
if (welcomeMessage) {
welcomeMessage.sheet.render({ force: true });
game.user.setFlag(CONFIG.DH.id, CONFIG.DH.FLAGS.userFlags.welcomeMessage, true);
}
}
});
Hooks.once('dicesoniceready', () => {});