Add a different default image for attribute items so they stand out a bit more in the item tab
This commit is contained in:
parent
a30d68a327
commit
6723e0d25f
2 changed files with 11 additions and 1 deletions
8
module/documents/Item.mjs
Normal file
8
module/documents/Item.mjs
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
export class TAFItem extends foundry.documents.Item {
|
||||||
|
static getDefaultArtwork(itemData) {
|
||||||
|
switch (itemData.type) {
|
||||||
|
case `attribute`: return { img: `icons/svg/jump.svg` };
|
||||||
|
};
|
||||||
|
return super.getDefaultArtwork(itemData);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
@ -13,6 +13,7 @@ import { PlayerData } from "../data/Actor/player.mjs";
|
||||||
// Documents
|
// Documents
|
||||||
import { TAFActor } from "../documents/Actor.mjs";
|
import { TAFActor } from "../documents/Actor.mjs";
|
||||||
import { TAFCombatant } from "../documents/Combatant.mjs";
|
import { TAFCombatant } from "../documents/Combatant.mjs";
|
||||||
|
import { TAFItem } from "../documents/Item.mjs";
|
||||||
import { TAFTokenDocument } from "../documents/Token.mjs";
|
import { TAFTokenDocument } from "../documents/Token.mjs";
|
||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
|
|
@ -29,9 +30,10 @@ Hooks.on(`init`, () => {
|
||||||
Logger.debug(`Initializing`);
|
Logger.debug(`Initializing`);
|
||||||
|
|
||||||
// #region Documents
|
// #region Documents
|
||||||
CONFIG.Token.documentClass = TAFTokenDocument;
|
|
||||||
CONFIG.Actor.documentClass = TAFActor;
|
CONFIG.Actor.documentClass = TAFActor;
|
||||||
CONFIG.Combatant.documentClass = TAFCombatant;
|
CONFIG.Combatant.documentClass = TAFCombatant;
|
||||||
|
CONFIG.Item.documentClass = TAFItem;
|
||||||
|
CONFIG.Token.documentClass = TAFTokenDocument;
|
||||||
// #endregion Documents
|
// #endregion Documents
|
||||||
|
|
||||||
// #region Data Models
|
// #region Data Models
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue