mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 23:49:02 +01:00
Added attribution to environments
This commit is contained in:
parent
54da1e1872
commit
c73f6202bd
26 changed files with 280 additions and 145 deletions
|
|
@ -8,7 +8,7 @@ export default class DhpEnvironment extends DHBaseActorSheet {
|
|||
classes: ['environment'],
|
||||
position: {
|
||||
width: 500,
|
||||
height: 725
|
||||
height: 740
|
||||
},
|
||||
window: {
|
||||
resizable: true,
|
||||
|
|
@ -49,6 +49,10 @@ export default class DhpEnvironment extends DHBaseActorSheet {
|
|||
switch (partId) {
|
||||
case 'header':
|
||||
await this._prepareHeaderContext(context, options);
|
||||
|
||||
const { source, page } = this.document.system.attribution;
|
||||
const attribution = [source, page ? `pg ${page}.` : null].filter(x => x).join('. ');
|
||||
context.attributionLabel = attribution;
|
||||
break;
|
||||
case 'notes':
|
||||
await this._prepareNotesContext(context, options);
|
||||
|
|
|
|||
|
|
@ -130,7 +130,8 @@ export default function DHApplicationMixin(Base) {
|
|||
async _renderFrame(options) {
|
||||
const frame = await super._renderFrame(options);
|
||||
|
||||
if (this.document.system.metadata.hasAttribution) {
|
||||
const headerAttribution = !['environment'].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('. ');
|
||||
const element = `<label class="attribution-header-label">${attribution}</label>`;
|
||||
|
|
@ -144,7 +145,8 @@ export default function DHApplicationMixin(Base) {
|
|||
* Refresh the custom parts of the application frame
|
||||
*/
|
||||
refreshFrame() {
|
||||
if (this.document.system.metadata.hasAttribution) {
|
||||
const headerAttribution = !['environment'].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('. ');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue