diff --git a/daggerheart.mjs b/daggerheart.mjs index af72e504..0fdca67c 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -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', () => {}); diff --git a/module/config/flagsConfig.mjs b/module/config/flagsConfig.mjs index 64a36fdf..91712288 100644 --- a/module/config/flagsConfig.mjs +++ b/module/config/flagsConfig.mjs @@ -9,3 +9,7 @@ export const encounterCountdown = { }; export const itemAttachmentSource = 'attachmentSource'; + +export const userFlags = { + welcomeMessage: 'welcome-message' +}; diff --git a/module/config/generalConfig.mjs b/module/config/generalConfig.mjs index 5f2011bb..c41f7ab5 100644 --- a/module/config/generalConfig.mjs +++ b/module/config/generalConfig.mjs @@ -1,3 +1,7 @@ +export const compendiumJournals = { + welcome: 'Compendium.daggerheart.journals.JournalEntry.g7NhKvwltwafmMyR' +}; + export const range = { self: { id: 'self', diff --git a/src/packs/journals/journal_Welcome___Information_g7NhKvwltwafmMyR.json b/src/packs/journals/journal_Welcome___Information_g7NhKvwltwafmMyR.json new file mode 100644 index 00000000..9b1c4b31 --- /dev/null +++ b/src/packs/journals/journal_Welcome___Information_g7NhKvwltwafmMyR.json @@ -0,0 +1,104 @@ +{ + "name": "Welcome - Information", + "_id": "g7NhKvwltwafmMyR", + "pages": [ + { + "sort": 100000, + "name": "The Daggerheart System", + "type": "text", + "_id": "Qn12vkbvV4m8LW3E", + "system": {}, + "title": { + "show": true, + "level": 1 + }, + "image": {}, + "text": { + "format": 1, + "content": "

Greetings prospective GM or Player. The Foundryborne team hopes you'll have a great time using the system and enjoying Daggerheart.

We've included some good to know information here as a first time message. You refer back to this journal in the Compendium Journals.

" + }, + "video": { + "controls": true, + "volume": 0.5 + }, + "src": null, + "category": null, + "ownership": { + "default": -1, + "MQSznptE5yLT7kj8": 3 + }, + "flags": {}, + "_stats": { + "compendiumSource": null, + "duplicateSource": null, + "exportSource": null, + "coreVersion": "13.346", + "systemId": "daggerheart", + "systemVersion": "0.0.1", + "createdTime": 1754223650079, + "modifiedTime": 1754223942641, + "lastModifiedBy": "MQSznptE5yLT7kj8" + }, + "_key": "!journal.pages!g7NhKvwltwafmMyR.Qn12vkbvV4m8LW3E" + }, + { + "sort": 200000, + "name": "Automation / Manual", + "type": "text", + "_id": "VBhZyON3eZi6dfo7", + "system": {}, + "title": { + "show": true, + "level": 1 + }, + "image": {}, + "text": { + "format": 1, + "content": "

The system supports various levels of automation. You find these settings in the Automation system settings.

The most immediate choice you should make is if you want to use the game setting for `Levelup Automation`. You should make a choice there, and then not change it during play to avoid potential unwanted oddities.

" + }, + "video": { + "controls": true, + "volume": 0.5 + }, + "src": null, + "category": null, + "ownership": { + "default": -1, + "MQSznptE5yLT7kj8": 3 + }, + "flags": {}, + "_stats": { + "compendiumSource": null, + "duplicateSource": null, + "exportSource": null, + "coreVersion": "13.346", + "systemId": "daggerheart", + "systemVersion": "0.0.1", + "createdTime": 1754223746740, + "modifiedTime": 1754223862937, + "lastModifiedBy": "MQSznptE5yLT7kj8" + }, + "_key": "!journal.pages!g7NhKvwltwafmMyR.VBhZyON3eZi6dfo7" + } + ], + "folder": null, + "categories": [], + "sort": 0, + "ownership": { + "default": 0, + "MQSznptE5yLT7kj8": 3 + }, + "flags": {}, + "_stats": { + "compendiumSource": null, + "duplicateSource": null, + "exportSource": null, + "coreVersion": "13.346", + "systemId": "daggerheart", + "systemVersion": "0.0.1", + "createdTime": 1754223645043, + "modifiedTime": 1754223645043, + "lastModifiedBy": "MQSznptE5yLT7kj8" + }, + "_key": "!journal!g7NhKvwltwafmMyR" +} diff --git a/system.json b/system.json index eee2711f..0914c88f 100644 --- a/system.json +++ b/system.json @@ -145,6 +145,15 @@ "private": false, "flags": {} }, + { + "name": "journals", + "label": "Journals", + "system": "daggerheart", + "path": "packs/journals.db", + "type": "JournalEntry", + "private": false, + "flags": {} + }, { "name": "beastforms", "label": "Beastforms", @@ -160,7 +169,7 @@ "name": "Daggerheart", "sorting": "m", "color": "#08718c", - "packs": ["adversaries", "environments"], + "packs": ["adversaries", "environments", "journals"], "folders": [ { "name": "Character Options",