Skip to content

Commit

Permalink
5.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Plushtoast committed Dec 6, 2023
1 parent 8ce3099 commit 3df6954
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
4 changes: 2 additions & 2 deletions bundle/modules/dsa5.js

Large diffs are not rendered by default.

28 changes: 22 additions & 6 deletions modules/wizards/adventure_wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class BookWizard extends Application {
Hooks.on("renderJournalDirectory", (app, html) => {
let div = $('<div class="header-actions action-buttons flexrow"></div>')
let button = $(`<button id="openJournalBrowser"><i class="fa fa-book"></i>${game.i18n.localize("Book.Wizard")}</button>`)
button.click(() => { BookWizard.wizard.render(true) })
button.on('click', () => { BookWizard.wizard.render(true) })
div.append(button)
html.find(".header-actions:first-child").after(div)
})
Expand Down Expand Up @@ -128,6 +128,13 @@ export default class BookWizard extends Application {
this.filterToc($(ev.currentTarget).val())
})

html.on('click', '.show-item', async(ev) => {
//TODO maybe try to open imported character
let itemId = ev.currentTarget.dataset.uuid
const item = await fromUuid(itemId)
item.sheet.render(true)
})

html.on('click', '.movePage', async(ev) => this.movePage(ev))

html.on('click', '.loadBook', ev => {
Expand Down Expand Up @@ -251,6 +258,7 @@ export default class BookWizard extends Application {
async loadJournal(name) {
await this.showJournal(this.journals.find(x => x.name == name && x.flags.dsa5.parent == this.selectedChapter ))
}

async loadJournalById(id) {
await this.showJournal(this.journals.find(x => x.id == id))
}
Expand Down Expand Up @@ -311,7 +319,11 @@ export default class BookWizard extends Application {
const data = await sheet.getData();
const view = (await sheet._renderInner(data)).get();
let pageContent = $(view[view.length -1]).html()

if(page.type == "video") pageContent = `<div class="video-container">${pageContent}</div>`

if(journal.name != page.name) pageContent = `<h2>${page.name}</h2>${pageContent}`

content += pageContent
}
const pinIcon = this.findSceneNote(journal.getFlag("dsa5", "initId"))
Expand All @@ -325,11 +337,15 @@ export default class BookWizard extends Application {
$(this._element).find('.subChapter').removeClass('selected')
$(this._element).find(`[data-jid="${journal.id}"]`).addClass("selected")
bindImgToCanvasDragStart(chapter)
chapter.find('.documentName-link, .entity-link, .content-link').click(ev => {
const elem = $(ev.currentTarget)
if (this.bookData && elem.attr("data-pack") == this.bookData.journal) {
ev.stopPropagation()
this.loadJournalById(elem.attr("data-id"))
chapter.find('.documentName-link, .entity-link, .content-link').on('click', ev => {
const dataset = ev.currentTarget.dataset
if (this.bookData && dataset.pack == this.bookData.journal) {
//todo make this work for pages
if(dataset.type != "JournalEntryPage") {
ev.stopPropagation()
this.loadJournalById(dataset.id)
}

}
})
}
Expand Down
4 changes: 2 additions & 2 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "dsa5",
"title": "Das Schwarze Auge/The Dark Eye (5th Edition)",
"description": "The \"Das Schwarze Auge\" system for Foundry VTT. Includes all relevant mechanisms to play in the wonderous world of Aventuria and Das Schwarze Auge/The Dark Eye.",
"version": "5.2.4",
"version": "5.2.5",
"authors": [{
"name": "Plushtoast"
},{
Expand Down Expand Up @@ -91,7 +91,7 @@
},
"url": "https://github.com/Plushtoast/dsa5-foundryVTT",
"manifest": "https://raw.githubusercontent.com/Plushtoast/dsa5-foundryVTT/foundry11/system.json",
"download": "https://github.com/Plushtoast/dsa5-foundryVTT/releases/download/5.2.4/dsa5-foundryVTT-5.2.4.zip",
"download": "https://github.com/Plushtoast/dsa5-foundryVTT/releases/download/5.2.5/dsa5-foundryVTT-5.2.5.zip",
"name": "dsa5",
"minimumCoreVersion": "11.306",
"packFolders": [
Expand Down
1 change: 0 additions & 1 deletion templates/items/browse/npc.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{log document.flags.core.sheetClass}}
{{#if (eq document.flags.core.sheetClass "dsa5.MerchantSheetDSA5")}}
{{> systems/dsa5/templates/items/browse/garadan.html}}
{{else}}
Expand Down
1 change: 0 additions & 1 deletion templates/system/global-mod-addition.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<div class="table-title">
{{localize 'Category'}}
</div>
{{log config}}
{{#each categories as |cat|}}
<div class="form-group">
<label class="label-text">{{itemCategory cat}}</label>
Expand Down

0 comments on commit 3df6954

Please sign in to comment.