From d5488516c44e37ce9a684b120e6ff7951328ff80 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Sun, 29 Mar 2026 19:10:42 +0200 Subject: [PATCH] feat: ajoute le champ 'valeur' sur l'item Aspect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - DataModel : champ NumberField 'valeur' (entier, min 0, défaut 0) - Fiche item aspect.hbs : champ valeur dans le header - Fiche personnage : affiche item.system.valeur dans la liste des aspects - CSS : .item-value dans cel-item-row (vert, gras) ; .item-header-valeur dans items.less - i18n : CELESTOPOL.Aspect.valeur Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- lang/fr.json | 3 +++ module/models/items.mjs | 1 + styles/items.less | 23 +++++++++++++++++++++++ styles/mixins.less | 7 +++++++ templates/aspect.hbs | 4 ++++ templates/character-competences.hbs | 2 +- 6 files changed, 39 insertions(+), 1 deletion(-) diff --git a/lang/fr.json b/lang/fr.json index d1e6b11..6de57cb 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -253,6 +253,9 @@ "protectionHint": "Réduit les blessures subies de ce montant", "malus": "Malus", "malusHint": "Malus aux tests de Mobilité et Discrétion (ou Domaine Corps pour PNJ)" + }, + "Aspect": { + "valeur": "Valeur" } } } \ No newline at end of file diff --git a/module/models/items.mjs b/module/models/items.mjs index 3d3c9c5..8fcbd0e 100644 --- a/module/models/items.mjs +++ b/module/models/items.mjs @@ -46,6 +46,7 @@ export class CelestopolAspect extends foundry.abstract.TypeDataModel { static defineSchema() { const fields = foundry.data.fields return { + valeur: new fields.NumberField({ required: true, integer: true, initial: 0, min: 0 }), description: new fields.HTMLField({ required: true, textSearch: true }), } } diff --git a/styles/items.less b/styles/items.less index 6141e31..a62286d 100644 --- a/styles/items.less +++ b/styles/items.less @@ -82,6 +82,29 @@ padding: 2px 4px; } + .item-header-valeur { + display: flex; + align-items: center; + gap: 6px; + label { + font-size: 0.8em; + color: var(--cel-orange-light); + text-transform: uppercase; + letter-spacing: 0.05em; + } + input[type="number"] { + width: 52px; + background: rgba(0,0,0,0.15); + border: 1px solid var(--cel-orange-light); + border-radius: 3px; + color: var(--cel-orange); + font-weight: bold; + font-size: 1em; + text-align: center; + padding: 1px 4px; + } + } + .item-meta { display: flex; gap: 8px; diff --git a/styles/mixins.less b/styles/mixins.less index 4e82966..30886b1 100644 --- a/styles/mixins.less +++ b/styles/mixins.less @@ -72,6 +72,13 @@ .item-name { flex: 1; font-style: italic; } + .item-value { + font-weight: bold; + min-width: 24px; + text-align: center; + color: var(--cel-green); + } + .item-controls { display: flex; gap: 4px; diff --git a/templates/aspect.hbs b/templates/aspect.hbs index d5a1722..52a7b61 100644 --- a/templates/aspect.hbs +++ b/templates/aspect.hbs @@ -5,6 +5,10 @@
+
+ + {{formInput systemFields.valeur value=system.valeur name="system.valeur"}} +
diff --git a/templates/character-competences.hbs b/templates/character-competences.hbs index 5e2be33..b588df3 100644 --- a/templates/character-competences.hbs +++ b/templates/character-competences.hbs @@ -145,7 +145,7 @@
{{item.name}} {{item.name}} - {{item.system.value}} + {{item.system.valeur}}
{{#if ../isEditMode}}{{/if}}