diff --git a/fvtt-celestopol.mjs b/fvtt-celestopol.mjs index 4a187a2..7e4f6c9 100644 --- a/fvtt-celestopol.mjs +++ b/fvtt-celestopol.mjs @@ -233,3 +233,19 @@ function _onSocketMessage(data) { } } } + +/* ─── Nom par défaut des items à la création ─────────────────────────────── */ + +Hooks.on("preCreateItem", (item, data) => { + const defaultNames = { + weapon: () => game.i18n.localize("TYPES.Item.weapon"), + armure: () => game.i18n.localize("TYPES.Item.armure"), + anomaly: () => game.i18n.localize("TYPES.Item.anomaly"), + aspect: () => game.i18n.localize("TYPES.Item.aspect"), + equipment: () => game.i18n.localize("TYPES.Item.equipment"), + } + const fn = defaultNames[item.type] + if (fn && (!data.name || data.name === "New Item" || data.name === item.type)) { + item.updateSource({ name: fn() }) + } +}) diff --git a/lang/fr.json b/lang/fr.json index f78eb30..42a7c7c 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -7,7 +7,9 @@ "Item": { "anomaly": "Anomalie", "aspect": "Aspect", - "equipment": "Équipement" + "equipment": "Équipement", + "weapon": "Arme", + "armure": "Armure" } }, "CELESTOPOL": { diff --git a/packs-system/anomalies/000003.log b/packs-system/anomalies/000007.log similarity index 100% rename from packs-system/anomalies/000003.log rename to packs-system/anomalies/000007.log diff --git a/packs-system/anomalies/CURRENT b/packs-system/anomalies/CURRENT index 1a84852..f7753e2 100644 --- a/packs-system/anomalies/CURRENT +++ b/packs-system/anomalies/CURRENT @@ -1 +1 @@ -MANIFEST-000002 +MANIFEST-000006 diff --git a/packs-system/anomalies/LOG b/packs-system/anomalies/LOG index ed6d6cc..a24feaa 100644 --- a/packs-system/anomalies/LOG +++ b/packs-system/anomalies/LOG @@ -1 +1,3 @@ -2026/03/28-09:47:34.669467 7f0018fff6c0 Delete type=3 #1 +2026/03/29-17:12:00.740305 7f4bda7ed6c0 Recovering log #4 +2026/03/29-17:12:00.787211 7f4bda7ed6c0 Delete type=3 #2 +2026/03/29-17:12:00.787276 7f4bda7ed6c0 Delete type=0 #4 diff --git a/packs-system/anomalies/LOG.old b/packs-system/anomalies/LOG.old new file mode 100644 index 0000000..2014d7a --- /dev/null +++ b/packs-system/anomalies/LOG.old @@ -0,0 +1,5 @@ +2026/03/28-09:47:34.669467 7f0018fff6c0 Delete type=3 #1 +2026/03/29-17:08:09.756858 7effca7fc6c0 Level-0 table #5: started +2026/03/29-17:08:09.756892 7effca7fc6c0 Level-0 table #5: 0 bytes OK +2026/03/29-17:08:09.762851 7effca7fc6c0 Delete type=0 #3 +2026/03/29-17:08:09.769416 7effca7fc6c0 Manual compaction at level-0 from 'undefined' @ 72057594037927935 : 1 .. 'undefined' @ 0 : 0; will stop at (end) diff --git a/packs-system/anomalies/MANIFEST-000002 b/packs-system/anomalies/MANIFEST-000002 deleted file mode 100644 index bbbc585..0000000 Binary files a/packs-system/anomalies/MANIFEST-000002 and /dev/null differ diff --git a/packs-system/anomalies/MANIFEST-000006 b/packs-system/anomalies/MANIFEST-000006 new file mode 100644 index 0000000..8bc3162 Binary files /dev/null and b/packs-system/anomalies/MANIFEST-000006 differ diff --git a/packs-system/aspects/000003.log b/packs-system/aspects/000007.log similarity index 100% rename from packs-system/aspects/000003.log rename to packs-system/aspects/000007.log diff --git a/packs-system/aspects/CURRENT b/packs-system/aspects/CURRENT index 1a84852..f7753e2 100644 --- a/packs-system/aspects/CURRENT +++ b/packs-system/aspects/CURRENT @@ -1 +1 @@ -MANIFEST-000002 +MANIFEST-000006 diff --git a/packs-system/aspects/LOG b/packs-system/aspects/LOG index 25eefb2..f7becb0 100644 --- a/packs-system/aspects/LOG +++ b/packs-system/aspects/LOG @@ -1 +1,3 @@ -2026/03/28-09:47:34.653497 7effcaffd6c0 Delete type=3 #1 +2026/03/29-17:12:00.691509 7f4bd9fec6c0 Recovering log #4 +2026/03/29-17:12:00.738164 7f4bd9fec6c0 Delete type=3 #2 +2026/03/29-17:12:00.738214 7f4bd9fec6c0 Delete type=0 #4 diff --git a/packs-system/aspects/LOG.old b/packs-system/aspects/LOG.old new file mode 100644 index 0000000..c749628 --- /dev/null +++ b/packs-system/aspects/LOG.old @@ -0,0 +1,5 @@ +2026/03/28-09:47:34.653497 7effcaffd6c0 Delete type=3 #1 +2026/03/29-17:08:09.762957 7effca7fc6c0 Level-0 table #5: started +2026/03/29-17:08:09.762977 7effca7fc6c0 Level-0 table #5: 0 bytes OK +2026/03/29-17:08:09.769218 7effca7fc6c0 Delete type=0 #3 +2026/03/29-17:08:09.769426 7effca7fc6c0 Manual compaction at level-0 from 'undefined' @ 72057594037927935 : 1 .. 'undefined' @ 0 : 0; will stop at (end) diff --git a/packs-system/aspects/MANIFEST-000002 b/packs-system/aspects/MANIFEST-000002 deleted file mode 100644 index bbbc585..0000000 Binary files a/packs-system/aspects/MANIFEST-000002 and /dev/null differ diff --git a/packs-system/aspects/MANIFEST-000006 b/packs-system/aspects/MANIFEST-000006 new file mode 100644 index 0000000..8bc3162 Binary files /dev/null and b/packs-system/aspects/MANIFEST-000006 differ