Update compendium and welcom chat message
Some checks failed
Release Creation / build (release) Failing after 1m41s

This commit is contained in:
2026-04-11 15:29:44 +02:00
parent 3358dea306
commit 7a2be0cc0e
25 changed files with 254 additions and 34 deletions

View File

@@ -40,6 +40,7 @@ import {
const DAMAGE_APPLICATION_FLAG = "damageApplication"
const FACTION_ASPECT_STATE_SETTING = "factionAspectState"
const WELCOME_SCENE_IMPORTED_SETTING = "welcomeSceneImported"
/* ─── Init hook ──────────────────────────────────────────────────────────── */
@@ -156,7 +157,7 @@ Hooks.once("init", () => {
/* ─── Ready hook ─────────────────────────────────────────────────────────── */
Hooks.once("ready", () => {
Hooks.once("ready", async () => {
console.log(`${SYSTEM_ID} | System ready`)
// Socket handler for GM-only operations (e.g. wound application)
@@ -179,7 +180,10 @@ Hooks.once("ready", () => {
_migrateObsoleteItems()
_migrateIntegerTracks()
_setupAnomaliesFolder()
await _setupWelcomeScene()
}
await _createWelcomeChatMessage()
})
/** Supprime les items dont le type n'est plus reconnu par le système. */
@@ -349,6 +353,79 @@ function _registerSettings() {
type: Object,
default: _getDefaultFactionAspectState(),
})
game.settings.register(SYSTEM_ID, WELCOME_SCENE_IMPORTED_SETTING, {
scope: "world",
config: false,
type: Boolean,
default: false,
})
}
async function _createWelcomeChatMessage() {
const activeGM = game.users.activeGM
if (!game.user.isGM || (activeGM && activeGM.id !== game.user.id)) return
const helpPack = game.packs.get(`${SYSTEM_ID}.aides-de-jeu`)
const helpDocs = helpPack ? await helpPack.getDocuments() : []
const helpEntry = helpDocs[0] ?? null
const helpReference = helpEntry
? `@UUID[${helpEntry.uuid}]{${helpEntry.name}}`
: `**${helpPack?.metadata?.label ?? game.i18n.localize("CELESTOPOL.Welcome.helpFallback")}**`
const rawContent = `
<div class="cel-welcome-message chat-system-card">
<div class="welcome-header">
<span class="welcome-mark">✦</span>
<span class="welcome-title">${game.i18n.localize("CELESTOPOL.Welcome.title")}</span>
</div>
<div class="welcome-body">
<p>${game.i18n.localize("CELESTOPOL.Welcome.intro")}</p>
<div class="welcome-note">
<span class="welcome-label">${game.i18n.localize("CELESTOPOL.Welcome.helpLabel")}</span>
<span class="welcome-value">${game.i18n.format("CELESTOPOL.Welcome.helpCompendium", { help: helpReference })}</span>
</div>
<div class="welcome-note">
<span class="welcome-label">${game.i18n.localize("CELESTOPOL.Welcome.bookLabel")}</span>
<span class="welcome-value"><a href="https://antre-monde.com/produit/celestopol-1922-le-jeu-de-role-livre-de-base/" target="_blank" rel="noopener noreferrer">${game.i18n.localize("CELESTOPOL.Welcome.bookLinkLabel")}</a></span>
</div>
</div>
</div>
`
await ChatMessage.create({
style: CONST.CHAT_MESSAGE_STYLES.OOC,
speaker: { alias: game.system.title },
content: await foundry.applications.ux.TextEditor.implementation.enrichHTML(rawContent, { async: true }),
})
}
async function _setupWelcomeScene() {
const activeGM = game.users.activeGM
if (!game.user.isGM || (activeGM && activeGM.id !== game.user.id)) return
if (game.settings.get(SYSTEM_ID, WELCOME_SCENE_IMPORTED_SETTING)) return
const sceneName = "Accueil Celestopol 1922"
let scene = game.scenes.getName(sceneName)
if (!scene) {
const pack = game.packs.get(`${SYSTEM_ID}.scenes`)
if (!pack) {
console.warn(`${SYSTEM_ID} | Compendium de scènes introuvable`)
return
}
const docs = await pack.getDocuments()
const sourceScene = docs.find(doc => doc.name === sceneName)
if (!sourceScene) {
console.warn(`${SYSTEM_ID} | Scène d'accueil introuvable dans le compendium`)
return
}
scene = await Scene.create(sourceScene.toObject())
}
await scene.activate()
await scene.view()
await game.settings.set(SYSTEM_ID, WELCOME_SCENE_IMPORTED_SETTING, true)
}
/* ─── Template preload ───────────────────────────────────────────────────── */

View File

@@ -404,6 +404,15 @@
"hint": "Cocher automatiquement 'Lancer le dé de la lune' dans les fenêtres de jet"
}
},
"Welcome": {
"title": "Bienvenue dans Célestopol 1922",
"intro": "Bienvenue dans le système FoundryVTT de Célestopol 1922.",
"helpLabel": "Aide de jeu",
"helpCompendium": "Une aide de jeu est disponible dans le compendium : {help}.",
"bookLabel": "Livre de base",
"helpFallback": "Célestopol 1922 — Aides de jeu",
"bookLinkLabel": "Voir le livre de base sur le site dAntre-Monde Éditions"
},
"ChatCard": {
"rollFor": "Jet de {skill} ({stat})"
},

Binary file not shown.

View File

@@ -0,0 +1 @@
MANIFEST-000022

View File

View File

@@ -0,0 +1,8 @@
2026/04/11-15:27:57.620400 7ff3bebfd6c0 Recovering log #20
2026/04/11-15:27:57.630743 7ff3bebfd6c0 Delete type=3 #18
2026/04/11-15:27:57.630810 7ff3bebfd6c0 Delete type=0 #20
2026/04/11-15:29:26.022154 7ff3bdbfb6c0 Level-0 table #25: started
2026/04/11-15:29:26.022184 7ff3bdbfb6c0 Level-0 table #25: 0 bytes OK
2026/04/11-15:29:26.028372 7ff3bdbfb6c0 Delete type=0 #23
2026/04/11-15:29:26.034985 7ff3bdbfb6c0 Manual compaction at level-0 from '!journal!eNYstmPK0mMmVJYC' @ 72057594037927935 : 1 .. '!journal.pages!eNYstmPK0mMmVJYC.r9h1ggd3G9hiqYJX' @ 0 : 0; will stop at (end)
2026/04/11-15:29:26.054681 7ff3bdbfb6c0 Manual compaction at level-1 from '!journal!eNYstmPK0mMmVJYC' @ 72057594037927935 : 1 .. '!journal.pages!eNYstmPK0mMmVJYC.r9h1ggd3G9hiqYJX' @ 0 : 0; will stop at (end)

View File

@@ -0,0 +1,8 @@
2026/04/11-15:27:20.564248 7f20edbfe6c0 Recovering log #16
2026/04/11-15:27:20.573933 7f20edbfe6c0 Delete type=3 #14
2026/04/11-15:27:20.573986 7f20edbfe6c0 Delete type=0 #16
2026/04/11-15:27:31.323603 7f1e4ffff6c0 Level-0 table #21: started
2026/04/11-15:27:31.323630 7f1e4ffff6c0 Level-0 table #21: 0 bytes OK
2026/04/11-15:27:31.330503 7f1e4ffff6c0 Delete type=0 #19
2026/04/11-15:27:31.336782 7f1e4ffff6c0 Manual compaction at level-0 from '!journal!eNYstmPK0mMmVJYC' @ 72057594037927935 : 1 .. '!journal.pages!eNYstmPK0mMmVJYC.r9h1ggd3G9hiqYJX' @ 0 : 0; will stop at (end)
2026/04/11-15:27:31.347179 7f1e4ffff6c0 Manual compaction at level-1 from '!journal!eNYstmPK0mMmVJYC' @ 72057594037927935 : 1 .. '!journal.pages!eNYstmPK0mMmVJYC.r9h1ggd3G9hiqYJX' @ 0 : 0; will stop at (end)

Binary file not shown.

View File

View File

@@ -1 +1 @@
MANIFEST-000028
MANIFEST-000058

View File

@@ -1,15 +1,15 @@
2026/04/11-14:57:57.789089 7f20ee3ff6c0 Recovering log #25
2026/04/11-14:57:57.798668 7f20ee3ff6c0 Delete type=3 #23
2026/04/11-14:57:57.798745 7f20ee3ff6c0 Delete type=0 #25
2026/04/11-14:58:32.475719 7f1e4ffff6c0 Level-0 table #31: started
2026/04/11-14:58:32.479327 7f1e4ffff6c0 Level-0 table #31: 3524 bytes OK
2026/04/11-14:58:32.485215 7f1e4ffff6c0 Delete type=0 #29
2026/04/11-14:58:32.485355 7f1e4ffff6c0 Manual compaction at level-0 from '!items!anomCommMorts001' @ 72057594037927935 : 1 .. '!items!null' @ 0 : 0; will stop at (end)
2026/04/11-14:58:32.485398 7f1e4ffff6c0 Manual compaction at level-1 from '!items!anomCommMorts001' @ 72057594037927935 : 1 .. '!items!null' @ 0 : 0; will stop at '!items!null' @ 29 : 1
2026/04/11-14:58:32.485404 7f1e4ffff6c0 Compacting 1@1 + 1@2 files
2026/04/11-14:58:32.488550 7f1e4ffff6c0 Generated table #32@1: 9 keys, 6617 bytes
2026/04/11-14:58:32.488570 7f1e4ffff6c0 Compacted 1@1 + 1@2 files => 6617 bytes
2026/04/11-14:58:32.494415 7f1e4ffff6c0 compacted to: files[ 0 0 1 0 0 0 0 ]
2026/04/11-14:58:32.494503 7f1e4ffff6c0 Delete type=2 #27
2026/04/11-14:58:32.494598 7f1e4ffff6c0 Delete type=2 #31
2026/04/11-14:58:32.513712 7f1e4ffff6c0 Manual compaction at level-1 from '!items!null' @ 29 : 1 .. '!items!null' @ 0 : 0; will stop at (end)
2026/04/11-15:27:57.608051 7ff3bf3fe6c0 Recovering log #55
2026/04/11-15:27:57.617618 7ff3bf3fe6c0 Delete type=3 #53
2026/04/11-15:27:57.617668 7ff3bf3fe6c0 Delete type=0 #55
2026/04/11-15:29:26.012403 7ff3bdbfb6c0 Level-0 table #61: started
2026/04/11-15:29:26.015819 7ff3bdbfb6c0 Level-0 table #61: 3524 bytes OK
2026/04/11-15:29:26.022024 7ff3bdbfb6c0 Delete type=0 #59
2026/04/11-15:29:26.034975 7ff3bdbfb6c0 Manual compaction at level-0 from '!items!anomCommMorts001' @ 72057594037927935 : 1 .. '!items!null' @ 0 : 0; will stop at (end)
2026/04/11-15:29:26.044411 7ff3bdbfb6c0 Manual compaction at level-1 from '!items!anomCommMorts001' @ 72057594037927935 : 1 .. '!items!null' @ 0 : 0; will stop at '!items!null' @ 53 : 1
2026/04/11-15:29:26.044420 7ff3bdbfb6c0 Compacting 1@1 + 1@2 files
2026/04/11-15:29:26.047715 7ff3bdbfb6c0 Generated table #62@1: 9 keys, 6617 bytes
2026/04/11-15:29:26.047736 7ff3bdbfb6c0 Compacted 1@1 + 1@2 files => 6617 bytes
2026/04/11-15:29:26.054365 7ff3bdbfb6c0 compacted to: files[ 0 0 1 0 0 0 0 ]
2026/04/11-15:29:26.054474 7ff3bdbfb6c0 Delete type=2 #57
2026/04/11-15:29:26.054607 7ff3bdbfb6c0 Delete type=2 #61
2026/04/11-15:29:26.064047 7ff3bdbfb6c0 Manual compaction at level-1 from '!items!null' @ 53 : 1 .. '!items!null' @ 0 : 0; will stop at (end)

View File

@@ -1,15 +1,15 @@
2026/04/11-09:06:09.549060 7f20edbfe6c0 Recovering log #20
2026/04/11-09:06:09.559919 7f20edbfe6c0 Delete type=3 #18
2026/04/11-09:06:09.559969 7f20edbfe6c0 Delete type=0 #20
2026/04/11-14:57:53.882273 7f1e4ffff6c0 Level-0 table #26: started
2026/04/11-14:57:53.885416 7f1e4ffff6c0 Level-0 table #26: 3524 bytes OK
2026/04/11-14:57:53.891947 7f1e4ffff6c0 Delete type=0 #24
2026/04/11-14:57:53.892102 7f1e4ffff6c0 Manual compaction at level-0 from '!items!anomCommMorts001' @ 72057594037927935 : 1 .. '!items!null' @ 0 : 0; will stop at (end)
2026/04/11-14:57:53.902087 7f1e4ffff6c0 Manual compaction at level-1 from '!items!anomCommMorts001' @ 72057594037927935 : 1 .. '!items!null' @ 0 : 0; will stop at '!items!null' @ 25 : 1
2026/04/11-14:57:53.902094 7f1e4ffff6c0 Compacting 1@1 + 1@2 files
2026/04/11-14:57:53.905146 7f1e4ffff6c0 Generated table #27@1: 9 keys, 6617 bytes
2026/04/11-14:57:53.905170 7f1e4ffff6c0 Compacted 1@1 + 1@2 files => 6617 bytes
2026/04/11-14:57:53.911010 7f1e4ffff6c0 compacted to: files[ 0 0 1 0 0 0 0 ]
2026/04/11-14:57:53.911117 7f1e4ffff6c0 Delete type=2 #22
2026/04/11-14:57:53.911253 7f1e4ffff6c0 Delete type=2 #26
2026/04/11-14:57:53.928122 7f1e4ffff6c0 Manual compaction at level-1 from '!items!null' @ 25 : 1 .. '!items!null' @ 0 : 0; will stop at (end)
2026/04/11-15:27:20.551914 7f20ee3ff6c0 Recovering log #50
2026/04/11-15:27:20.562310 7f20ee3ff6c0 Delete type=3 #48
2026/04/11-15:27:20.562396 7f20ee3ff6c0 Delete type=0 #50
2026/04/11-15:27:31.313674 7f1e4ffff6c0 Level-0 table #56: started
2026/04/11-15:27:31.317287 7f1e4ffff6c0 Level-0 table #56: 3524 bytes OK
2026/04/11-15:27:31.323440 7f1e4ffff6c0 Delete type=0 #54
2026/04/11-15:27:31.336770 7f1e4ffff6c0 Manual compaction at level-0 from '!items!anomCommMorts001' @ 72057594037927935 : 1 .. '!items!null' @ 0 : 0; will stop at (end)
2026/04/11-15:27:31.336813 7f1e4ffff6c0 Manual compaction at level-1 from '!items!anomCommMorts001' @ 72057594037927935 : 1 .. '!items!null' @ 0 : 0; will stop at '!items!null' @ 49 : 1
2026/04/11-15:27:31.336819 7f1e4ffff6c0 Compacting 1@1 + 1@2 files
2026/04/11-15:27:31.340181 7f1e4ffff6c0 Generated table #57@1: 9 keys, 6617 bytes
2026/04/11-15:27:31.340207 7f1e4ffff6c0 Compacted 1@1 + 1@2 files => 6617 bytes
2026/04/11-15:27:31.346883 7f1e4ffff6c0 compacted to: files[ 0 0 1 0 0 0 0 ]
2026/04/11-15:27:31.346998 7f1e4ffff6c0 Delete type=2 #52
2026/04/11-15:27:31.347109 7f1e4ffff6c0 Delete type=2 #56
2026/04/11-15:27:31.353403 7f1e4ffff6c0 Manual compaction at level-1 from '!items!null' @ 49 : 1 .. '!items!null' @ 0 : 0; will stop at (end)

Binary file not shown.

View File

Binary file not shown.

View File

@@ -0,0 +1 @@
MANIFEST-000015

0
packs-system/scenes/LOCK Normal file
View File

15
packs-system/scenes/LOG Normal file
View File

@@ -0,0 +1,15 @@
2026/04/11-15:27:57.633319 7ff3bf3fe6c0 Recovering log #13
2026/04/11-15:27:57.644646 7ff3bf3fe6c0 Delete type=3 #11
2026/04/11-15:27:57.644712 7ff3bf3fe6c0 Delete type=0 #13
2026/04/11-15:29:26.001386 7ff3bdbfb6c0 Level-0 table #18: started
2026/04/11-15:29:26.005135 7ff3bdbfb6c0 Level-0 table #18: 3095 bytes OK
2026/04/11-15:29:26.012219 7ff3bdbfb6c0 Delete type=0 #16
2026/04/11-15:29:26.034958 7ff3bdbfb6c0 Manual compaction at level-0 from '!scenes!Jr7lGxYk2RETlXRv' @ 72057594037927935 : 1 .. '!scenes.tokens.delta.items!Jr7lGxYk2RETlXRv.6urwC5SVcou6UOAG.CTg4yBE12iMee1RU.BYT1CrA37R3Og0nu' @ 0 : 0; will stop at (end)
2026/04/11-15:29:26.035011 7ff3bdbfb6c0 Manual compaction at level-1 from '!scenes!Jr7lGxYk2RETlXRv' @ 72057594037927935 : 1 .. '!scenes.tokens.delta.items!Jr7lGxYk2RETlXRv.6urwC5SVcou6UOAG.CTg4yBE12iMee1RU.BYT1CrA37R3Og0nu' @ 0 : 0; will stop at '!scenes.tokens.delta.items!Jr7lGxYk2RETlXRv.6urwC5SVcou6UOAG.CTg4yBE12iMee1RU.BYT1CrA37R3Og0nu' @ 31 : 1
2026/04/11-15:29:26.035018 7ff3bdbfb6c0 Compacting 1@1 + 1@2 files
2026/04/11-15:29:26.038199 7ff3bdbfb6c0 Generated table #19@1: 7 keys, 3095 bytes
2026/04/11-15:29:26.038215 7ff3bdbfb6c0 Compacted 1@1 + 1@2 files => 3095 bytes
2026/04/11-15:29:26.044152 7ff3bdbfb6c0 compacted to: files[ 0 0 1 0 0 0 0 ]
2026/04/11-15:29:26.044236 7ff3bdbfb6c0 Delete type=2 #10
2026/04/11-15:29:26.044341 7ff3bdbfb6c0 Delete type=2 #18
2026/04/11-15:29:26.064030 7ff3bdbfb6c0 Manual compaction at level-1 from '!scenes.tokens.delta.items!Jr7lGxYk2RETlXRv.6urwC5SVcou6UOAG.CTg4yBE12iMee1RU.BYT1CrA37R3Og0nu' @ 31 : 1 .. '!scenes.tokens.delta.items!Jr7lGxYk2RETlXRv.6urwC5SVcou6UOAG.CTg4yBE12iMee1RU.BYT1CrA37R3Og0nu' @ 0 : 0; will stop at (end)

View File

@@ -0,0 +1,8 @@
2026/04/11-15:27:20.576678 7f20ecbfc6c0 Recovering log #8
2026/04/11-15:27:20.586717 7f20ecbfc6c0 Delete type=3 #6
2026/04/11-15:27:20.586780 7f20ecbfc6c0 Delete type=0 #8
2026/04/11-15:27:31.330627 7f1e4ffff6c0 Level-0 table #14: started
2026/04/11-15:27:31.330649 7f1e4ffff6c0 Level-0 table #14: 0 bytes OK
2026/04/11-15:27:31.336642 7f1e4ffff6c0 Delete type=0 #12
2026/04/11-15:27:31.336792 7f1e4ffff6c0 Manual compaction at level-0 from '!scenes!Jr7lGxYk2RETlXRv' @ 72057594037927935 : 1 .. '!scenes.tokens.delta.items!Jr7lGxYk2RETlXRv.6urwC5SVcou6UOAG.CTg4yBE12iMee1RU.BYT1CrA37R3Og0nu' @ 0 : 0; will stop at (end)
2026/04/11-15:27:31.347189 7f1e4ffff6c0 Manual compaction at level-1 from '!scenes!Jr7lGxYk2RETlXRv' @ 72057594037927935 : 1 .. '!scenes.tokens.delta.items!Jr7lGxYk2RETlXRv.6urwC5SVcou6UOAG.CTg4yBE12iMee1RU.BYT1CrA37R3Og0nu' @ 0 : 0; will stop at (end)

Binary file not shown.

View File

@@ -899,6 +899,84 @@
}
}
.chat-message .cel-welcome-message {
border: 1px solid var(--cel-border, #7a5c20);
border-radius: 4px;
overflow: hidden;
background: linear-gradient(180deg, rgba(255,248,232,0.98), rgba(240,229,209,0.95));
font-family: var(--cel-font-body, "Palatino Linotype", serif);
.welcome-header {
display: flex;
align-items: center;
gap: 8px;
padding: 7px 10px;
background: var(--cel-green, #0c4c0c);
background-image: url("../assets/ui/fond_cadrille.jpg");
background-blend-mode: soft-light;
border-bottom: 2px solid var(--cel-orange, #e07b00);
}
.welcome-mark {
color: var(--cel-orange, #e07b00);
font-size: 1.05em;
line-height: 1;
}
.welcome-title {
font-family: var(--cel-font-title, "CopaseticNF", serif);
color: var(--cel-orange, #e07b00);
font-size: 0.98em;
letter-spacing: 0.05em;
text-transform: uppercase;
}
.welcome-body {
padding: 9px 11px 10px;
color: #3f3623;
font-size: 0.84em;
line-height: 1.45;
p {
margin: 0 0 8px;
}
}
.welcome-note {
margin-top: 7px;
padding: 6px 8px;
border: 1px solid rgba(122,92,32,0.2);
border-radius: 4px;
background: rgba(255,255,255,0.5);
}
.welcome-label {
display: block;
margin-bottom: 2px;
color: var(--cel-border, #7a5c20);
font-size: 0.72em;
font-weight: bold;
letter-spacing: 0.05em;
text-transform: uppercase;
}
.welcome-value {
color: var(--cel-green, #0c4c0c);
}
a.content-link,
a[href] {
color: var(--cel-orange, #e07b00);
font-weight: bold;
text-decoration: none;
}
a.content-link:hover,
a[href]:hover {
text-decoration: underline;
}
}
.application.faction-aspect-dialog {
width: min(540px, 92vw);
}

View File

@@ -6,7 +6,7 @@
"download": "#{DOWNLOAD}#",
"url": "https://www.uberwald.me/gitea/public/fvtt-celestopol",
"license": "LICENSE",
"version": "13.0.0",
"version": "14.0.0",
"authors": [
{
"name": "Uberwald",
@@ -30,7 +30,7 @@
},
"compatibility": {
"minimum": "13",
"verified": "13"
"verified": "14"
},
"esmodules": [
"fvtt-celestopol.mjs"
@@ -97,7 +97,22 @@
"system": "fvtt-celestopol",
"path": "packs-system/anomalies",
"type": "Item"
},
{
"name": "aides-de-jeu",
"label": "Célestopol 1922 — Aides de jeu",
"system": "fvtt-celestopol",
"path": "packs-system/aides-de-jeu",
"type": "JournalEntry"
},
{
"name": "scenes",
"label": "Célestopol 1922 — Scènes",
"system": "fvtt-celestopol",
"path": "packs-system/scenes",
"type": "Scene"
}
],
"grid": {
"distance": 5,