Skip to content

Commit

Permalink
Merge pull request #516 from jconabree/handout-all-content
Browse files Browse the repository at this point in the history
Option to allow handouts for all content
  • Loading branch information
MrPrimate authored Oct 30, 2024
2 parents 26afaa5 + b24fa34 commit e6a0c64
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@
"show-image-to-players.hint": "In journals provide hover-over button to show image to players? (Reload required)",
"show-read-alouds-button.name": "Show the show read aloud to players button?",
"show-read-alouds-button.hint": "In journals provide hover-over button to show the read aloud to players? (Reload required)",
"show-read-alouds-all-content.name": "Enable read aloud for all content?",
"show-read-alouds-all-content.hint": "Show the read aloud to player button in content not imported by DDB Importer as well. (Reload required)",
"dynamic-sync": {
"dynamic-sync": "Enable Dynamic Sync?",
"dynamic-sync-policy-currency": "Currency?",
Expand Down
14 changes: 10 additions & 4 deletions src/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,16 @@ export function renderItemSheet(sheet, html) {
}

export function renderJournalSheet(sheet, html, data) {
if (data.cssClass !== "editable" && sheet.document.flags?.ddb) {
linkTables("journal", html);
linkImages(html, data);
showReadAlouds(html, data);
if (data.cssClass !== "editable") {
if (sheet.document.flags?.ddb) {
linkTables("journal", html);
linkImages(html, data);
}

const enableReadAloudsForAllContent = game.settings.get("ddb-importer", "show-read-alouds-all-content");
if (sheet.document.flags?.ddb || enableReadAloudsForAllContent) {
showReadAlouds(html, data);
}
}
adventureFlags(sheet, html, data);
}
7 changes: 7 additions & 0 deletions src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,13 @@ const SETTINGS = {
type: Boolean,
default: true,
},
"show-read-alouds-all-content": {
name: "ddb-importer.settings.show-read-alouds-all-content.name",
hint: "ddb-importer.settings.show-read-alouds-all-content.hint",
config: true,
type: Boolean,
default: false,
},
},
PERMISSIONS: {
"restrict-to-trusted": {
Expand Down

0 comments on commit e6a0c64

Please sign in to comment.