mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
[PR][Feature] 798 - Attribution (#986)
* Added attribution for items, adversary and environment * Added Attribution to all adversaries * Added attribution to environments * Added attribution for class and subclass * Added Attribution to Ancestry/Community * Added Attribution for Beastforms * Added Attribution to DomainCards * Added Attribution for wepaons * Attribution for Armor/Loot/Consumables * Added a setting to hide attribution
This commit is contained in:
parent
495575fba4
commit
8c84edddad
982 changed files with 9082 additions and 3996 deletions
|
|
@ -26,7 +26,8 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
|||
hasResource: false,
|
||||
isQuantifiable: false,
|
||||
isInventoryItem: false,
|
||||
hasActions: false
|
||||
hasActions: false,
|
||||
hasAttribution: true
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -37,7 +38,13 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
|||
|
||||
/** @inheritDoc */
|
||||
static defineSchema() {
|
||||
const schema = {};
|
||||
const schema = {
|
||||
attribution: new fields.SchemaField({
|
||||
source: new fields.StringField(),
|
||||
page: new fields.NumberField(),
|
||||
artist: new fields.StringField()
|
||||
})
|
||||
};
|
||||
|
||||
if (this.metadata.hasDescription) schema.description = new fields.HTMLField({ required: true, nullable: true });
|
||||
|
||||
|
|
@ -110,6 +117,13 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
|||
return [];
|
||||
}
|
||||
|
||||
get attributionLabel() {
|
||||
if (!this.attribution) return;
|
||||
|
||||
const { source, page } = this.attribution;
|
||||
return [source, page ? `pg ${page}.` : null].filter(x => x).join('. ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain a data object used to evaluate any dice rolls associated with this Item Type
|
||||
* @param {object} [options] - Options which modify the getRollData method.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue