Gestion des signes draconiques #455

Closed
vincent.vandeme wants to merge 233 commits from v1.4-signes-draconiques into master
2 changed files with 14 additions and 10 deletions
Showing only changes of commit 80b10cbbaa - Show all commits

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