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(); return handlebarsRegistration();
}); });
Hooks.on('ready', () => { Hooks.on('ready', async () => {
ui.resources = new CONFIG.ui.resources(); ui.resources = new CONFIG.ui.resources();
if (game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).displayFear !== 'hide') if (game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).displayFear !== 'hide')
ui.resources.render({ force: true }); ui.resources.render({ force: true });
@ -159,6 +159,14 @@ Hooks.on('ready', () => {
socketRegistration.registerSocketHooks(); socketRegistration.registerSocketHooks();
registerRollDiceHooks(); registerRollDiceHooks();
socketRegistration.registerUserQueries(); 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', () => {}); Hooks.once('dicesoniceready', () => {});

View file

@ -9,3 +9,7 @@ export const encounterCountdown = {
}; };
export const itemAttachmentSource = 'attachmentSource'; export const itemAttachmentSource = 'attachmentSource';
export const userFlags = {
welcomeMessage: 'welcome-message'
};

View file

@ -1,3 +1,7 @@
export const compendiumJournals = {
welcome: 'Compendium.daggerheart.journals.JournalEntry.g7NhKvwltwafmMyR'
};
export const range = { export const range = {
self: { self: {
id: 'self', id: 'self',

View file

@ -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": "<p>Greetings prospective GM or Player. The Foundryborne team hopes you'll have a great time using the system and enjoying Daggerheart.</p><p>We've included some good to know information here as a first time message. You refer back to this journal in the Compendium Journals.</p><ul><li><p>@UUID[Compendium.daggerheart.journals.JournalEntry.g7NhKvwltwafmMyR.JournalEntryPage.VBhZyON3eZi6dfo7]{Automation / Manual}</p></li><li><p><a href=\"https://github.com/Foundryborne/daggerheart/wiki/Dice-Rolls-&amp;-Chat-Commands\">Chat Commands &amp; Enrichment</a></p></li></ul>"
},
"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": "<p>The system supports various levels of automation. You find these settings in the <strong>Automation</strong> system settings.</p><p>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.</p>"
},
"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"
}

View file

@ -145,6 +145,15 @@
"private": false, "private": false,
"flags": {} "flags": {}
}, },
{
"name": "journals",
"label": "Journals",
"system": "daggerheart",
"path": "packs/journals.db",
"type": "JournalEntry",
"private": false,
"flags": {}
},
{ {
"name": "beastforms", "name": "beastforms",
"label": "Beastforms", "label": "Beastforms",
@ -160,7 +169,7 @@
"name": "Daggerheart", "name": "Daggerheart",
"sorting": "m", "sorting": "m",
"color": "#08718c", "color": "#08718c",
"packs": ["adversaries", "environments"], "packs": ["adversaries", "environments", "journals"],
"folders": [ "folders": [
{ {
"name": "Character Options", "name": "Character Options",