Rework des fiches creature/PJ et Tinji/Loksyu

This commit is contained in:
2026-03-30 17:37:38 +02:00
parent 40c8c523b7
commit 637ea883dd
48 changed files with 3119 additions and 292 deletions
+15 -33
View File
@@ -1,4 +1,18 @@
/**
* Chroniques de l'Étrange — Système FoundryVTT
*
* Chroniques de l'Étrange est un jeu de rôle édité par Antre-Monde Éditions.
* Ce système FoundryVTT est une implémentation indépendante et n'est pas
* affilié à Antre-Monde Éditions,
* mais a été réalisé avec l'autorisation d'Antre-Monde Éditions.
*
* @author LeRatierBretonnien
* @copyright 20242026 LeRatierBretonnien
* @license CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0/
*/
import { ACTOR_TYPES, ITEM_TYPES, MAGICS, SUBTYPES, SYSTEM_ID } from "./config/constants.js"
import { registerSettings, migrateIfNeeded } from "./config/settings.js"
import { preLocalizeConfig } from "./config/localize.js"
import { configureRuntime } from "./config/runtime.js"
import { CharacterDataModel, NpcDataModel } from "./data/actors/index.js"
@@ -13,7 +27,6 @@ import { CDECharacterSheet, CDENpcSheet } from "./ui/sheets/actors/index.js"
import { CDEItemSheet, CDEKungfuSheet, CDESpellSheet, CDESupernaturalSheet, CDEWeaponSheet, CDEArmorSheet, CDESanheiSheet, CDEIngredientSheet } from "./ui/sheets/items/index.js"
import { CDELoksyuApp } from "./ui/apps/loksyu-app.js"
import { CDETinjiApp } from "./ui/apps/tinji-app.js"
import { migrateIfNeeded, registerSettings } from "./migration.js"
import { injectRollActions, refreshAllRollActions } from "./ui/roll-actions.js"
Hooks.once("i18nInit", preLocalizeConfig)
@@ -107,7 +120,6 @@ Hooks.once("init", async () => {
await preloadPartials()
registerHandlebarsHelpers()
registerDice()
Hooks.on("renderSettings", (_app, html) => injectCompendiumLink(html))
console.info(`CHRONIQUESDELETRANGE | Initialized`)
})
@@ -138,7 +150,7 @@ Hooks.on("renderChatLog", (_app, html) => {
// Use event delegation to avoid being swallowed by Foundry's own handlers
wrapper.addEventListener("click", (ev) => {
if (ev.target.closest(".cde-chat-btn--loksyu")) CDELoksyuApp.open()
if (ev.target.closest(".cde-chat-btn--tinji")) CDETinjiApp.open()
if (ev.target.closest(".cde-chat-btn--tinji")) CDETinjiApp.open()
})
// Insert before the chat form — works on v12 and v13
@@ -161,33 +173,3 @@ Hooks.on("updateSetting", setting => {
refreshAllRollActions()
}
})
function injectCompendiumLink(html) {
const header = html[0]?.querySelector?.("h4.divider")
if (!header) return
const section = document.createElement("section")
section.classList.add("settings", "flexcol")
section.innerHTML = `
<section class="links flexcol">
<img class="logo-info" src="systems/fvtt-chroniques-de-l-etrange/images/logo_jeu.webp" />
<h4 class="divider">&nbsp;Lien utile&nbsp;<i class="fa-light fa-up-right-from-square"></i>&nbsp;</h4>
</section>
<section class="settings flexcol">
<button type="button" data-action="open-cde-link">
<i class="fa fa-download"></i>&nbsp;Compendium pour Les CdE&nbsp;<i class="fa-light fa-up-right-from-square"></i>
</button>
<details>
<summary><small>Guide d'installation</small></summary>
<small style="text-align: center;">
<p>Rendez-vous sur le site de l'éditeur, téléchargez les PDF contenant les liens vers les compendia, puis ajoutez leurs manifestes dans Foundry.</p>
</small>
</details>
</section>
`
section.querySelector("button[data-action='open-cde-link']")?.addEventListener("click", () => {
window.open("https://antre-monde.com/les-chroniques-de-letrange/", "_blank")
})
header.parentNode.insertBefore(section, header)
}