mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-11 11:35:59 +01:00
Added Attribution to Ancestry/Community
This commit is contained in:
parent
8761880b12
commit
f6cdc9c157
78 changed files with 744 additions and 362 deletions
|
|
@ -130,7 +130,7 @@ export default function DHApplicationMixin(Base) {
|
|||
async _renderFrame(options) {
|
||||
const frame = await super._renderFrame(options);
|
||||
|
||||
const headerAttribution = !['environment'].includes(this.document.type);
|
||||
const headerAttribution = !['environment', 'ancestry', 'community'].includes(this.document.type);
|
||||
if (this.document.system.metadata.hasAttribution && headerAttribution) {
|
||||
const { source, page } = this.document.system.attribution;
|
||||
const attribution = [source, page ? `pg ${page}.` : null].filter(x => x).join('. ');
|
||||
|
|
@ -145,7 +145,7 @@ export default function DHApplicationMixin(Base) {
|
|||
* Refresh the custom parts of the application frame
|
||||
*/
|
||||
refreshFrame() {
|
||||
const headerAttribution = !['environment'].includes(this.document.type);
|
||||
const headerAttribution = !['environment', 'ancestry', 'community'].includes(this.document.type);
|
||||
if (this.document.system.metadata.hasAttribution && headerAttribution) {
|
||||
const { source, page } = this.document.system.attribution;
|
||||
const attribution = [source, page ? `pg ${page}.` : null].filter(x => x).join('. ');
|
||||
|
|
|
|||
|
|
@ -117,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