From 1bdda17c1664ae0f0910e996884a39a6efacac62 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 2 Jan 2021 19:27:15 +0100 Subject: [PATCH] =?UTF-8?q?Rendu=20des=20r=C3=A9sultats=20sp=C3=A9ciaux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/rdd-resolution-table.js | 20 ++++++++++++++------ styles/simple.css | 5 +++++ templates/chat-infojet.html | 2 +- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/module/rdd-resolution-table.js b/module/rdd-resolution-table.js index 6285151f..ef4518a8 100644 --- a/module/rdd-resolution-table.js +++ b/module/rdd-resolution-table.js @@ -180,7 +180,7 @@ export class RdDResolutionTable { rolled.caracValue = caracValue; rolled.finalLevel = finalLevel; rolled.bonus = bonus; - rolled.factor = RdDResolutionTable._getFractionHtml(diviseur); + rolled.factorHtml = RdDResolutionTable._getFractionHtml(diviseur); return rolled; } @@ -320,11 +320,19 @@ export class RdDResolutionTable { /* -------------------------------------------- */ static buildHTMLResults(caracValue, levelValue) { let cell = this.computeChances(caracValue, levelValue); - let descr = $(''); - descr.append("Particulière : " + cell.part + " - Significative : " + cell.sign + " - Réussite : " + cell.score); - descr.append("
Echec Particulier : " + cell.epart + " - Echec Total : " + cell.etotal); - descr.append("
"); - return descr; + cell.epart = cell.epart>99? 'N/A' : cell.epart; + cell.etotal = cell.etotal>100? 'N/A' : cell.etotal; + cell.score = Math.min(cell.score, 99); + + return ` + +Particulière: ${cell.part} +- Significative: ${cell.sign} +- Réussite: ${cell.score} +- Echec Particulier: ${cell.epart} +- Echec Total: ${cell.etotal} + +` } /* -------------------------------------------- */ diff --git a/styles/simple.css b/styles/simple.css index 4588e8f0..76ad3e7f 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -410,6 +410,11 @@ table {border: 1px solid #7a7971;} background-color: lightblue; } +#resolutionValeurs{ + font-size: 0.8rem; + padding: 5px; +} + /* ======================================== */ /* Sheet */ .window-app.sheet .window-content .sheet-header{ diff --git a/templates/chat-infojet.html b/templates/chat-infojet.html index 4d493711..1e89bd77 100644 --- a/templates/chat-infojet.html +++ b/templates/chat-infojet.html @@ -14,7 +14,7 @@ {{/each}} {{/if}} - {{#if rolled.factor}}×{{{rolled.factor}}}{{/if}} + {{#if rolled.factorHtml}}×{{{rolled.factorHtml}}}{{/if}} = {{rolled.score}}%