- Remplacer les balises <prose-mirror> brutes par {{formInput}}
pour les champs HTMLField (biographie, notes, description)
- Onglets passent en basculement CSS sans re-render
- Ajout de systemFields au contexte des feuilles d'acteur
3.4 KiB
3.4 KiB
BoL — FoundryVTT Game System
FoundryVTT game system for Barbarians of Lemuria (French edition, Ludospherik). System id bol. Compatible Foundry v13–v14.
Commands
| Command | Action |
|---|---|
npm run css |
Compile LESS → css/bol.css (one-shot) |
npm run watch / npm start |
Watch styles/**/*.less, recompile on change |
No test or lint scripts exist.
Entry Point & Architecture
module/bol.js — wires everything in Hooks.once('init', ...) and Hooks.once('ready', ...).
| Path | Role |
|---|---|
module/bol.js |
System init, sheet/data model registration, socket setup |
module/system/config.js |
BOL constants, System.debugMode flag |
module/system/bol-utility.js |
Static helpers, settings (bol namespace), socket handler (system.bol) |
module/controllers/bol-rolls.js |
All roll logic — BoLRoll static methods |
module/models/ |
DataModel classes (.mjs) for Actor/Item types |
module/applications/sheets/ |
AppV2 sheets (ActorSheetV2/ItemSheetV2 + HandlebarsApplicationMixin) |
styles/ |
LESS sources → compiled to css/bol.css |
templates/ |
Handlebars .hbs partials |
lang/ |
fr.json, en.json, de.json, es.json |
Key Conventions
- AppV2 sheets — base classes are
foundry.applications.sheets.ActorSheetV2/ItemSheetV2mixed withHandlebarsApplicationMixin. Do NOT usefoundry.appv1.sheets.*. game.bol— system exposesBoLActor,BoLItem,BoLRoll,BoLUtility,Macros,BOLconfig,models,sheetson this namespace after init.- i18n prefix — all keys start with
BOL.; usegame.i18n.localize("BOL.xxx"). - FR-first —
fr.jsonis most complete. EN compendium translation requires Babele module. A warning fires at startup if EN is selected without Babele. System.debugMode = trueinmodule/system/config.js:8— set tofalsebefore release.- LESS only — never edit
css/bol.cssdirectly. Edit.lessfiles understyles/, recompile withnpm run css. - Data models —
template.jsondefines schema viaActor.types(character, encounter, horde, vehicle) andItem.types(item, feature). All data lives under.system. - Sheet partials — registered in
module/system/templates.js. Add new partials there. - Static classes —
BoLRollandBoLUtilityare purely static; never instantiate. template.json.SAVEDin root is the data model reference; the actualtemplate.jsonmay need regeneration.package.jsonand lockfile are in.gitignore— npm is dev-only for LESS compilation. Not needed to run the system in Foundry.{{formInput}}for HTML fields — always use{{formInput fieldDef enriched=x value=y name="system.path" toggled=isEditable}}forHTMLFieldin AppV2 sheets. Never use raw<prose-mirror>elements; they break form submission.- Tab switching — use CSS-only toggle (no
this.render()) to preserve ProseMirror editor state. Seebase-item-sheet.mjspattern.
CI & Release
- CI triggers only on release publish (
.gitea/workflows/main.yml). - Release zips:
system.json template.json README.md LICENSE assets/ compendiums/ css/ fonts/ images/ lang/ module/ packs/ styles/ templates/ ui/. - Version/URL manifest/download are substituted in
system.jsonduring CI. - Published to Foundry package registry via
foundryvtt-publish-package-action.