From 80b10cbbaa1c42f94952aae5e2764bdb857dd001 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Thu, 29 Apr 2021 23:17:29 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20d=C3=A9=20dragon=20sans=20bords=20pour=20?= =?UTF-8?q?tous?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pas uniquement pour le système rdd --- module/rdd-dice.js | 21 +++++++++++---------- styles/simple.css | 3 +++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/module/rdd-dice.js b/module/rdd-dice.js index 03e74da4..464a73f5 100644 --- a/module/rdd-dice.js +++ b/module/rdd-dice.js @@ -3,7 +3,7 @@ import { SYSTEM_RDD } from "./constants.js"; import { Misc } from "./misc.js"; const signeDragon = 'systems/foundryvtt-reve-de-dragon/icons/heures/hdragon.webp'; -const imgSigneDragon = ``; +const imgSigneDragon = ``; const labelsDeDragon = ['1', '2', '3', '4', '5', '6', signeDragon, '0']; const bumpsDeDragon = [, , , , , , signeDragon, ]; @@ -12,8 +12,8 @@ export class De7 extends Die { /** @override */ static DENOMINATION = "7"; - static diceSoNiceData() { - return { type: "d7", labels: labelsDeDragon, bumpMaps: bumpsDeDragon, system: SYSTEM_RDD } + static diceSoNiceData(system) { + return { type: "d7", labels: labelsDeDragon, bumpMaps: bumpsDeDragon, system: system } } constructor(termData) { @@ -33,7 +33,7 @@ export class De7 extends Die { static getResultLabel(result) { switch (result) { - case '7': return imgSigneDragon + case 7: return imgSigneDragon } return result; } @@ -43,8 +43,8 @@ export class De7 extends Die { export class DeDraconique extends Die { static DENOMINATION = "r"; - static diceSoNiceData() { - return { type: "dr", labels: labelsDeDragon, bumpMaps: bumpsDeDragon, system: SYSTEM_RDD } + static diceSoNiceData(system) { + return { type: "dr", labels: labelsDeDragon, bumpMaps: bumpsDeDragon, system: system } } constructor(termData) { @@ -64,7 +64,7 @@ export class DeDraconique extends Die { static getResultLabel(result) { switch (result) { - case '7': return imgSigneDragon + case 7: return imgSigneDragon } return result; } @@ -77,9 +77,10 @@ export class RdDDice { } static diceSoNiceReady(dice3d) { - dice3d.addSystem({ id: SYSTEM_RDD, name: "Rêve de Dragon" }); - dice3d.addDicePreset(De7.diceSoNiceData()); - dice3d.addDicePreset(DeDraconique.diceSoNiceData()); + for (const system of Object.keys(dice3d.DiceFactory.systems)) { + dice3d.addDicePreset(De7.diceSoNiceData(system)); + dice3d.addDicePreset(DeDraconique.diceSoNiceData(system)); + } } /* -------------------------------------------- */ diff --git a/styles/simple.css b/styles/simple.css index 3f9f5f67..84e3ca78 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -242,6 +242,9 @@ table {border: 1px solid #7a7971;} object-position: 50% 0; } +.dice-img { + border-width: 0; +} .button-img { vertical-align: baseline; width: 8%;