From 8fb69b0bc54a649b7005921e89b1ee6199688c61 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Tue, 18 May 2021 19:50:24 +0200 Subject: [PATCH] =?UTF-8?q?Images=20par=20d=C3=A9faut=20=C3=A0=20la=20cr?= =?UTF-8?q?=C3=A9ation=20d'Items?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/item.js | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/module/item.js b/module/item.js index 98bda21f..e74c9027 100644 --- a/module/item.js +++ b/module/item.js @@ -7,9 +7,45 @@ const typesObjetsEquipement = ["objet", "arme", "armure", "conteneur", "herbe", const typesObjetsOeuvres = ["oeuvre", "recettecuisine", "musique", "chant", "danse", "jeu"]; const encBrin = 0.00005;// un brin = 1 décigramme = 1/10g = 1/10000kg = 1/20000 enc +export const defaultItemImg = { + competence: "systems/foundryvtt-reve-de-dragon/icons/competence_defaut.webp", + compcreature: "systems/foundryvtt-reve-de-dragon/icons/competence_defaut.webp", + arme: "systems/foundryvtt-reve-de-dragon/icons/armes_armures/epee_gnome.webp", + armure: "systems/foundryvtt-reve-de-dragon/icons/armes_armures/armure_plaques.webp", + conteneur: "systems/foundryvtt-reve-de-dragon/icons/objets/sac_a_dos.webp", + sort: "systems/foundryvtt-reve-de-dragon/icons/competence_oniros.webp", + herbe: "systems/foundryvtt-reve-de-dragon/icons/botanique/Endorlotte.png", + ingredient: "systems/foundryvtt-reve-de-dragon/icons/objets/sable_poudre.webp", + livre: "systems/foundryvtt-reve-de-dragon/icons/objets/livre.webp", + potion: "systems/foundryvtt-reve-de-dragon/icons/objets/liqueur_de_bagdol.webp", + queue: "systems/foundryvtt-reve-de-dragon/icons/queue_dragon.webp", + ombre: "systems/foundryvtt-reve-de-dragon/icons/queue_dragon.webp", + souffle: "systems/foundryvtt-reve-de-dragon/icons/souffle_dragon.webp", + tete: "systems/foundryvtt-reve-de-dragon/icons/tete_dragon.webp", + meditation: "systems/foundryvtt-reve-de-dragon/icons/meditations_ecrits/meditation_alchimie.webp", + recettealchimique: "systems/foundryvtt-reve-de-dragon/icons/competence_alchimie.webp", + chant: "systems/foundryvtt-reve-de-dragon/icons/arts/chant_0.webp", + danse: "systems/foundryvtt-reve-de-dragon/icons/arts/danse_0.webp", + jeu: "systems/foundryvtt-reve-de-dragon/icons/arts/jeux_petasse.webp", + recettecuisine: "systems/foundryvtt-reve-de-dragon/icons/arts/recette_cuisine_1.webp", + musique: "systems/foundryvtt-reve-de-dragon/icons/arts/chant_0.webp", + maladie: "systems/foundryvtt-reve-de-dragon/icons/maladies_venins/maladie.webp", + poison: "systems/foundryvtt-reve-de-dragon/icons/maladies_venins/venin.webp", + oeuvre: "systems/foundryvtt-reve-de-dragon/icons/competence_comedie.webp", + nourritureboisson: "systems/foundryvtt-reve-de-dragon/icons/objets/provision_crue.webp", + signedraconique: "systems/foundryvtt-reve-de-dragon/icons/tmr/signe_draconique.webp", +} + /* -------------------------------------------- */ export class RdDItem extends Item { + constructor(data) { + if (!data.img) { + data.img = defaultItemImg[data.type]; + } + super(data); + } + static getTypeObjetsEquipement() { return typesObjetsEquipement; } @@ -180,7 +216,7 @@ export class RdDItem extends Item { console.log(venteData); let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.html', venteData); - ChatMessage.create( RdDUtility.chatDataSetup(html)); + ChatMessage.create(RdDUtility.chatDataSetup(html)); } /* -------------------------------------------- */