From a55904742ba06818ebcc0d2daa743f6e8966f5cd Mon Sep 17 00:00:00 2001 From: fabres Date: Tue, 14 Jul 2026 22:08:32 +0200 Subject: [PATCH] fix(encombrement): exclure le poids propre des conteneurs du total MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Les conteneurs n'ajoutent plus leur propre encombrement au total (seuls les objets qu'ils contiennent sont comptés) - Ajout indicateur visuel quand une compétence atteint son niveau d'archétype (bordure dorée + icône ✓) --- css/foundryvtt-reve-de-dragon.css | 8 ++++++++ less/foundryvtt-reve-de-dragon.less | 8 ++++++++ module/actor/base-actor.js | 1 + module/item-competence.js | 1 + templates/actor/competence.hbs | 3 ++- 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/css/foundryvtt-reve-de-dragon.css b/css/foundryvtt-reve-de-dragon.css index 5ceaf8af..85c83b5f 100644 --- a/css/foundryvtt-reve-de-dragon.css +++ b/css/foundryvtt-reve-de-dragon.css @@ -2072,6 +2072,14 @@ body { flex-basis: 2rem; text-align: center; } +.system-foundryvtt-reve-de-dragon .window-app.sheet .window-content .at-archetype { + border-left: 3px solid var(--color-archetype-atteint, #b8860b); +} +.system-foundryvtt-reve-de-dragon .window-app.sheet .window-content .archetype-check { + color: var(--color-archetype-atteint, #b8860b); + font-size: 0.75rem; + margin-left: 0.15rem; +} .system-foundryvtt-reve-de-dragon .window-app.sheet .window-content .carac-value, .system-foundryvtt-reve-de-dragon .window-app.sheet .window-content .competence-xp-sort { flex-grow: 0; diff --git a/less/foundryvtt-reve-de-dragon.less b/less/foundryvtt-reve-de-dragon.less index aa8ac3b7..e56a2713 100644 --- a/less/foundryvtt-reve-de-dragon.less +++ b/less/foundryvtt-reve-de-dragon.less @@ -1408,6 +1408,14 @@ flex-basis: 2rem; text-align: center; } + .window-app.sheet .window-content .at-archetype { + border-left: 3px solid var(--color-archetype-atteint, #b8860b); + } + .window-app.sheet .window-content .archetype-check { + color: var(--color-archetype-atteint, #b8860b); + font-size: 0.75rem; + margin-left: 0.15rem; + } .window-app.sheet .window-content .carac-value, .window-app.sheet .window-content .competence-xp-sort { flex-grow: 0; diff --git a/module/actor/base-actor.js b/module/actor/base-actor.js index 98551db3..cb177d26 100644 --- a/module/actor/base-actor.js +++ b/module/actor/base-actor.js @@ -652,6 +652,7 @@ export class RdDBaseActor extends Actor { else { const wasSurenc = this.isSurenc() this.encTotal = this.items.filter(it => RdDItem.getItemTypesInventaire().includes(it.type)) + .filter(it => it.type !== ITEM_TYPES.conteneur) .map(it => it.getEncTotal()).reduce(Misc.sum(), 0) const isSurenc = this.isSurenc() if (isSurenc != wasSurenc) { diff --git a/module/item-competence.js b/module/item-competence.js index 741673e1..035243a5 100644 --- a/module/item-competence.js +++ b/module/item-competence.js @@ -238,6 +238,7 @@ export class RdDItemCompetence extends RdDItem { if (xpManquant > 0 && stressTransforme > 0 && item.system.niveau < item.system.niveau_archetype) { item.system.stressXpMax = Math.min(xpManquant, stressTransforme); } + item.system.isArchetypeAtteint = item.system.niveau >= item.system.niveau_archetype; } /* -------------------------------------------- */ diff --git a/templates/actor/competence.hbs b/templates/actor/competence.hbs index 2174601d..d65c5e0b 100644 --- a/templates/actor/competence.hbs +++ b/templates/actor/competence.hbs @@ -1,5 +1,5 @@ {{#unless system.isHidden}} -
  • +
  • {{name}} @@ -44,6 +44,7 @@ compname="{{name}}" value="{{plusMoins system.niveau_archetype}}" data-tooltip="Niveau d'archétype {{plusMoins system.niveau_archetype}}" {{#if (not @root.options.vueArchetype)}}disabled{{/if}} /> + {{#if system.isArchetypeAtteint}}{{/if}} {{>'systems/foundryvtt-reve-de-dragon/templates/actor/item-action-controls.hbs' item=this options=@root.options}} {{/if}}