diff --git a/lang/fr.json b/lang/fr.json index 45ad040..893985a 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -1,4 +1,16 @@ { + "TYPES": { + "Actor": { + "character": "Personnage", + "npc": "PNJ" + }, + "Item": { + "anomaly": "Anomalie", + "aspect": "Aspect", + "attribute": "Attribut", + "equipment": "Équipement" + } + }, "CELESTOPOL": { "Actor": { "name": "Nom", @@ -36,14 +48,14 @@ "Anomaly": { "type": "Type d'anomalie", "none": "Aucune", - "charnel": "Charnel", - "mecanique": "Mécanique", - "spectral": "Spectral", - "onirique": "Onirique", - "telepath": "Télépathique", - "alchimique": "Alchimique", - "cosmique": "Cosmique", - "temporel": "Temporel" + "entropie": "Entropie", + "communicationaveclesmorts": "Communication avec les morts", + "illusion": "Illusion", + "suggestion": "Suggestion", + "tarotdivinatoire": "Tarot divinatoire", + "telekinesie": "Télékinésie", + "telepathie": "Télépathie", + "voyageastral": "Voyage astral" }, "Attribut": { "entregent": "Entregent", @@ -92,24 +104,28 @@ "criticalSuccess": "Succès critique !", "criticalFailure": "Échec critique !", "moonBonus": "Bonus de lune", + "title": "Jet de dés", + "roll": "Lancer !", "rollTitle": "Lancer les dés" }, "Moon": { - "nouvelleLune": "Nouvelle Lune", - "croissantDebutant": "Croissant débutant", - "croissantMontant": "Croissant montant", - "gibbeuseMontante": "Gibbeuse montante", - "pleineLune": "Pleine Lune", - "gibbeuseDecroissante": "Gibbeuse décroissante", - "croissantDecroissant": "Croissant décroissant", - "croissantFinissant": "Croissant finissant" + "none": "Aucune phase", + "nouvellelune": "Nouvelle Lune", + "premiercroissant": "Premier Croissant", + "premierquartier": "Premier Quartier", + "lunegibbeuse": "Lune Gibbeuse", + "lunevoutee": "Lune Voûtée", + "derniercroissant": "Dernier Croissant", + "dernierquartier": "Dernier Quartier", + "pleinelune": "Pleine Lune" }, "Difficulty": { + "unknown": "Aucun seuil", "facile": "Facile", "normal": "Normal", "difficile": "Difficile", - "extreme": "Extrême", - "impossible": "Impossible" + "ardu": "Ardu", + "extreme": "Extrême" }, "Item": { "anomalies": "Anomalies", @@ -134,13 +150,11 @@ "weight": "Poids" }, "Equipment": { - "type": { - "general": "Général", - "arme": "Arme", - "armure": "Armure", - "vehicule": "Véhicule", - "gadget": "Gadget" - } + "autre": "Autre", + "arme": "Arme", + "protection": "Protection / Armure", + "vehicule": "Véhicule", + "type": "Type d'équipement" }, "Sheet": { "editMode": "Mode édition", diff --git a/module/applications/sheets/base-item-sheet.mjs b/module/applications/sheets/base-item-sheet.mjs index f4c0cd5..fa62910 100644 --- a/module/applications/sheets/base-item-sheet.mjs +++ b/module/applications/sheets/base-item-sheet.mjs @@ -12,6 +12,9 @@ export default class CelestopolItemSheet extends HandlebarsApplicationMixin(foun }, } + /** Default tab group for item sheets */ + tabGroups = { "item-tabs": "description" } + /** @override */ async _prepareContext() { return { @@ -21,9 +24,21 @@ export default class CelestopolItemSheet extends HandlebarsApplicationMixin(foun system: this.document.system, source: this.document.toObject(), isEditable: this.isEditable, + activeTab: this.tabGroups["item-tabs"] ?? "description", } } + /** @override */ + _onRender(context, options) { + // Wire up tab navigation for inline item tabs + this.element.querySelectorAll('.item-tabs [data-tab]').forEach(tabEl => { + tabEl.addEventListener('click', () => { + const group = "item-tabs" + this.changeTab(tabEl.dataset.tab, group) + }) + }) + } + static async #onEditImage(event, target) { const attr = target.dataset.edit const current = foundry.utils.getProperty(this.document, attr) diff --git a/module/applications/sheets/npc-sheet.mjs b/module/applications/sheets/npc-sheet.mjs index b15e435..cf65591 100644 --- a/module/applications/sheets/npc-sheet.mjs +++ b/module/applications/sheets/npc-sheet.mjs @@ -37,6 +37,7 @@ export default class CelestopolNPCSheet extends CelestopolActorSheet { context.tabs = this.#getTabs() context.stats = SYSTEM.STATS context.skills = SYSTEM.SKILLS + context.anomalyTypes = SYSTEM.ANOMALY_TYPES context.woundLevels = SYSTEM.WOUND_LEVELS return context } diff --git a/module/documents/chat-message.mjs b/module/documents/chat-message.mjs index 5bae106..aa181a9 100644 --- a/module/documents/chat-message.mjs +++ b/module/documents/chat-message.mjs @@ -1,7 +1,6 @@ export default class CelestopolChatMessage extends ChatMessage { /** @override */ - async getHTML() { - const html = await super.getHTML() - return html + async renderHTML(options = {}) { + return super.renderHTML(options) } } diff --git a/module/documents/roll.mjs b/module/documents/roll.mjs index cab0c32..d1470bd 100644 --- a/module/documents/roll.mjs +++ b/module/documents/roll.mjs @@ -35,9 +35,11 @@ export class CelestopolRoll extends Roll { const dialogContext = { actorName: options.actorName, + statLabel: options.statLabel, skillLabel: options.skillLabel, skillValue: options.skillValue, woundMalus: options.woundMalus ?? 0, + nbDice: Math.max(1, options.skillValue ?? 1), difficultyChoices:SYSTEM.DIFFICULTY_CHOICES, moonPhaseChoices: SYSTEM.MOON_DICE_PHASES, defaultDifficulty:options.difficulty ?? "normal", @@ -135,25 +137,33 @@ export class CelestopolRoll extends Roll { } async _getChatCardData(isPrivate) { + const statLabel = this.options.statLabel + const skillLabel = this.options.skillLabel + const resultType = this.resultType + const diceResults = this.dice[0]?.results?.map(r => r.result) ?? [] + return { - css: [SYSTEM.id, "dice-roll"], cssClass: [SYSTEM.id, "dice-roll"].join(" "), actorId: this.actorId, - actingCharName: this.actorName, - actingCharImg: this.actorImage, - skillLabel: this.skillLabel, + actorName: this.actorName, + actorImg: this.actorImage, + statLabel: statLabel ? game.i18n.localize(statLabel) : "", + skillLabel: skillLabel ? game.i18n.localize(skillLabel) : "", formula: this.formula, total: this.total, - resultType: this.resultType, - isSuccess: this.isSuccess, - isFailure: this.isFailure, + resultType, + resultClass: resultType === "success" ? "success" : resultType === "failure" ? "failure" : "", + success: this.isSuccess, + failure: this.isFailure, difficulty: this.options.difficulty, - difficultyValue:this.options.difficultyValue, + difficultyLabel:game.i18n.localize(SYSTEM.DIFFICULTY_CHOICES[this.options.difficulty]?.label ?? ""), moonPhase: this.options.moonPhase, + moonPhaseLabel: game.i18n.localize(SYSTEM.MOON_DICE_PHASES[this.options.moonPhase]?.label ?? ""), moonBonus: this.moonBonus, + modifier: this.options.modifier, isPrivate, tooltip: isPrivate ? "" : await this.getTooltip(), - results: this.dice[0]?.results ?? [], + diceResults, } } diff --git a/module/models/character.mjs b/module/models/character.mjs index 4abe1e5..e23dfac 100644 --- a/module/models/character.mjs +++ b/module/models/character.mjs @@ -165,6 +165,7 @@ export default class CelestopolCharacter extends foundry.abstract.TypeDataModel actorImage: this.parent.img, statId, skillId, + statLabel: SYSTEM.STATS[statId]?.label, skillLabel: skill.label, skillValue: skill.value, woundMalus: this.getWoundMalus(), diff --git a/packs-system/anomalies/000003.log b/packs-system/anomalies/000003.log new file mode 100644 index 0000000..e69de29 diff --git a/packs-system/anomalies/CURRENT b/packs-system/anomalies/CURRENT new file mode 100644 index 0000000..1a84852 --- /dev/null +++ b/packs-system/anomalies/CURRENT @@ -0,0 +1 @@ +MANIFEST-000002 diff --git a/packs-system/anomalies/LOCK b/packs-system/anomalies/LOCK new file mode 100644 index 0000000..e69de29 diff --git a/packs-system/anomalies/LOG b/packs-system/anomalies/LOG new file mode 100644 index 0000000..ed6d6cc --- /dev/null +++ b/packs-system/anomalies/LOG @@ -0,0 +1 @@ +2026/03/28-09:47:34.669467 7f0018fff6c0 Delete type=3 #1 diff --git a/packs-system/anomalies/MANIFEST-000002 b/packs-system/anomalies/MANIFEST-000002 new file mode 100644 index 0000000..bbbc585 Binary files /dev/null and b/packs-system/anomalies/MANIFEST-000002 differ diff --git a/packs-system/aspects/000003.log b/packs-system/aspects/000003.log new file mode 100644 index 0000000..e69de29 diff --git a/packs-system/aspects/CURRENT b/packs-system/aspects/CURRENT new file mode 100644 index 0000000..1a84852 --- /dev/null +++ b/packs-system/aspects/CURRENT @@ -0,0 +1 @@ +MANIFEST-000002 diff --git a/packs-system/aspects/LOCK b/packs-system/aspects/LOCK new file mode 100644 index 0000000..e69de29 diff --git a/packs-system/aspects/LOG b/packs-system/aspects/LOG new file mode 100644 index 0000000..25eefb2 --- /dev/null +++ b/packs-system/aspects/LOG @@ -0,0 +1 @@ +2026/03/28-09:47:34.653497 7effcaffd6c0 Delete type=3 #1 diff --git a/packs-system/aspects/MANIFEST-000002 b/packs-system/aspects/MANIFEST-000002 new file mode 100644 index 0000000..bbbc585 Binary files /dev/null and b/packs-system/aspects/MANIFEST-000002 differ diff --git a/styles/character.less b/styles/character.less index f27daa1..d0fafa6 100644 --- a/styles/character.less +++ b/styles/character.less @@ -2,7 +2,7 @@ // ─── Character sheet specifics ─────────────────────────────────────────────── -.celestopol.character-sheet { +.fvtt-celestopol.character { // Attributs perso (Entregent, Fortune, Rêve, Vision) .perso-attributs { diff --git a/styles/global.less b/styles/global.less index 4dbcc87..4469824 100644 --- a/styles/global.less +++ b/styles/global.less @@ -1,5 +1,9 @@ // ─── Variables CSS (couleurs + typo) ──────────────────────────────────────── +// ─── FVTT-wide type label fix ──────────────────────────────────────────────── +// Override window title color for celestopol sheets +.fvtt-celestopol .window-title { color: var(--cel-orange, #e07b00); } + :root { --cel-green: rgb(12, 76, 12); --cel-green-light: rgb(20, 110, 20); @@ -17,7 +21,7 @@ // ─── Sheet base layout ─────────────────────────────────────────────────────── -.celestopol { +.fvtt-celestopol { &.sheet { background: var(--cel-cream); font-family: var(--cel-font-body); @@ -154,5 +158,10 @@ padding: 8px; } - .tab { display: none; &.active { display: block; } } + .tab { + display: none; + padding: 8px; + overflow-y: auto; + &.active { display: block; } + } } diff --git a/styles/items.less b/styles/items.less index 940e601..784f7be 100644 --- a/styles/items.less +++ b/styles/items.less @@ -2,7 +2,7 @@ // ─── Item sheets shared ─────────────────────────────────────────────────────── -.celestopol.item-sheet { +.fvtt-celestopol.item { .item-header { display: flex; @@ -147,7 +147,7 @@ } // Equipment-specific - &.equipment-sheet { + &.equipment { .equipment-stats { display: grid; grid-template-columns: repeat(3, 1fr); diff --git a/styles/npc.less b/styles/npc.less index 7b06383..4bad616 100644 --- a/styles/npc.less +++ b/styles/npc.less @@ -2,7 +2,7 @@ // ─── NPC sheet specifics ───────────────────────────────────────────────────── -.celestopol.npc-sheet { +.fvtt-celestopol.npc { .stats-grid { display: grid; diff --git a/templates/anomaly.hbs b/templates/anomaly.hbs index 056d937..59f1647 100644 --- a/templates/anomaly.hbs +++ b/templates/anomaly.hbs @@ -7,7 +7,9 @@
diff --git a/templates/aspect.hbs b/templates/aspect.hbs index 7b84b46..e56d54c 100644 --- a/templates/aspect.hbs +++ b/templates/aspect.hbs @@ -13,20 +13,20 @@ -