Fix dé dragon sans bords pour tous

Pas uniquement pour le système rdd
This commit is contained in:
Vincent Vandemeulebrouck 2021-04-29 23:17:29 +02:00
parent 94136b8879
commit 80b10cbbaa
2 changed files with 14 additions and 10 deletions

View File

@ -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 = `<img src="${signeDragon}" />`;
const imgSigneDragon = `<img src="${signeDragon}" class="dice-img" />`;
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));
}
}
/* -------------------------------------------- */

View File

@ -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%;