diff --git a/src/assets/default/ability.png b/src/assets/default/ability.png new file mode 100644 index 0000000..096ebee Binary files /dev/null and b/src/assets/default/ability.png differ diff --git a/src/assets/default/armor.png b/src/assets/default/armor.png new file mode 100644 index 0000000..9700343 Binary files /dev/null and b/src/assets/default/armor.png differ diff --git a/src/assets/default/item.png b/src/assets/default/item.png new file mode 100644 index 0000000..03f9835 Binary files /dev/null and b/src/assets/default/item.png differ diff --git a/src/assets/default/spell.png b/src/assets/default/spell.png new file mode 100644 index 0000000..15b9c69 Binary files /dev/null and b/src/assets/default/spell.png differ diff --git a/src/assets/default/weapon.png b/src/assets/default/weapon.png new file mode 100644 index 0000000..446f93b Binary files /dev/null and b/src/assets/default/weapon.png differ diff --git a/src/module/item/entity.js b/src/module/item/entity.js index d01a972..1fb576b 100644 --- a/src/module/item/entity.js +++ b/src/module/item/entity.js @@ -4,14 +4,34 @@ import { OseDice } from "../dice.js"; * Override and extend the basic :class:`Item` implementation */ export class OseItem extends Item { + /* -------------------------------------------- */ /* Data Preparation */ /* -------------------------------------------- */ - /** * Augment the basic Item data model with additional dynamic data. */ prepareData() { + // Set default image + let img = CONST.DEFAULT_TOKEN; + switch (this.data.type) { + case "spell": + img = "/systems/ose/assets/default/spell.png"; + break; + case "ability": + img = "/systems/ose/assets/default/ability.png"; + break; + case "armor": + img = "/systems/ose/assets/default/armor.png"; + break; + case "weapon": + img = "/systems/ose/assets/default/weapon.png"; + break; + case "item": + img = "/systems/ose/assets/default/item.png"; + break; + } + if (!this.data.img) this.data.img = img; super.prepareData(); }