Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ module.exports = {
Color: false,
DetectionMode: false,
DocumentSheetConfig: false,
HandlebarsApplicationMixin: false,
fromUuidSync: false,
globalThis: false,
toml: false,
Expand Down
10 changes: 10 additions & 0 deletions release-notes/1.1.16.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Downloads
_Manifest URL_: https://asacolips-artifacts.s3.amazonaws.com/pbta/1.1.16/system.json

## Compatible Foundry Versions
![Foundry v13](https://img.shields.io/badge/Foundry-v13-green) ![Foundry v13](https://img.shields.io/badge/Foundry-v13-orange)

# Changes
- Adds support for FoundryVTT V13.
- Removed the system's Combat Tracker for the time being.
- Updated Tagify library (4.33.1 -> 4.35.0)
16 changes: 9 additions & 7 deletions src/module/applications/actor/actor-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
export default class PbtaActorSheet extends ActorSheet {
export default class PbtaActorSheet extends foundry.appv1.sheets.ActorSheet {
static _warnedAppV1 = true;

/** @override */
constructor(...args) {
super(...args);
Expand Down Expand Up @@ -121,7 +123,7 @@ export default class PbtaActorSheet extends ActorSheet {
await this._prepareAttrs(context);

for (let [k, v] of Object.entries(context.system.details)) {
context.system.details[k].enriched = await TextEditor.enrichHTML(v?.value ?? "", context.enrichmentOptions);
context.system.details[k].enriched = await foundry.applications.ux.TextEditor.implementation.enrichHTML(v?.value ?? "", context.enrichmentOptions);
}

// Add playbooks.
Expand Down Expand Up @@ -213,7 +215,7 @@ export default class PbtaActorSheet extends ActorSheet {
if (attrValue.type === "LongText") {
context.system[position][attrKey].attrName = `system.attributes.${attrKey}.value`;
context.system[position][attrKey].enriched =
await TextEditor.enrichHTML(attrValue.value, context.enrichmentOptions);
await foundry.applications.ux.TextEditor.implementation.enrichHTML(attrValue.value, context.enrichmentOptions);
}
if (attrValue.type === "Roll" && attrValue.showResults === undefined) {
attrValue.showResults = true;
Expand Down Expand Up @@ -327,16 +329,16 @@ export default class PbtaActorSheet extends ActorSheet {
// Enrich text fields.
if (item.system?.description) {
item.system.description =
await TextEditor.enrichHTML(item.system.description, enrichmentOptions);
await foundry.applications.ux.TextEditor.implementation.enrichHTML(item.system.description, enrichmentOptions);
}
if (item.system?.choices) {
item.system.choices = await TextEditor.enrichHTML(item.system.choices, enrichmentOptions);
item.system.choices = await foundry.applications.ux.TextEditor.implementation.enrichHTML(item.system.choices, enrichmentOptions);
}
if (item.system?.moveResults) {
for (let [mK, mV] of Object.entries(item.system.moveResults)) {
if (mV.value) {
item.system.moveResults[mK].value =
await TextEditor.enrichHTML(mV.value, enrichmentOptions);
await foundry.applications.ux.TextEditor.implementation.enrichHTML(mV.value, enrichmentOptions);
}
}
}
Expand Down Expand Up @@ -648,7 +650,7 @@ export default class PbtaActorSheet extends ActorSheet {
this._statShifting = {};
this.render(false);

const content = await renderTemplate("systems/pbta/templates/chat/stat-shift.hbs", {
const content = await foundry.applications.handlebars.renderTemplate("systems/pbta/templates/chat/stat-shift.hbs", {
actor: this.actor,
labels,
up: up ? this.actor.system.stats[up] : "",
Expand Down
10 changes: 6 additions & 4 deletions src/module/applications/item/item-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export default class PbtaItemSheet extends ItemSheet {
export default class PbtaItemSheet extends foundry.appv1.sheets.ItemSheet {
static _warnedAppV1 = true;

/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
Expand Down Expand Up @@ -64,7 +66,7 @@ export default class PbtaItemSheet extends ItemSheet {
};

if (context.system?.description) {
context.enriched.description = await TextEditor.enrichHTML(context.system.description, enrichmentOptions);
context.enriched.description = await foundry.applications.ux.TextEditor.implementation.enrichHTML(context.system.description, enrichmentOptions);
}

const sheetConfig = game.pbta.sheetConfig;
Expand Down Expand Up @@ -103,7 +105,7 @@ export default class PbtaItemSheet extends ItemSheet {
for (let [key, moveResult] of Object.entries(context.system.moveResults)) {
context.system.moveResults[key].rangeName = `system.moveResults.${key}.value`;
context.enriched.moveResults[key].value =
await TextEditor.enrichHTML(moveResult.value, enrichmentOptions);
await foundry.applications.ux.TextEditor.implementation.enrichHTML(moveResult.value, enrichmentOptions);
}

if (this.item.type === "move") {
Expand All @@ -130,7 +132,7 @@ export default class PbtaItemSheet extends ItemSheet {
context.system.stats.formula = { label: game.i18n.localize("PBTA.Formula") };

if (context.system?.choices) {
context.enriched.choices = await TextEditor.enrichHTML(context.system.choices, enrichmentOptions);
context.enriched.choices = await foundry.applications.ux.TextEditor.implementation.enrichHTML(context.system.choices, enrichmentOptions);
}
} else if (this.item.type === "npcMove") {
context.system.rollExample = sheetConfig?.rollFormula ?? "2d6";
Expand Down
4 changes: 2 additions & 2 deletions src/module/applications/item/playbook-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default class PlaybookSheet extends PbtaItemSheet {
for (let [k, v] of Object.entries(context.system.attributes)) {
if (["Details", "LongText"].includes(v.type) && context.system.attributes[k].choices) {
for (const choice of context.system.attributes[k].choices) {
choice.enriched = await TextEditor.enrichHTML(choice.value ?? "", context.enrichmentOptions);
choice.enriched = await foundry.applications.ux.TextEditor.implementation.enrichHTML(choice.value ?? "", context.enrichmentOptions);
}
}
}
Expand Down Expand Up @@ -190,7 +190,7 @@ export default class PlaybookSheet extends PbtaItemSheet {
}

async _onDrop(event) {
const data = TextEditor.getDragEventData(event);
const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event);
if (!["Item", "Folder"].includes(data.type)) return super._onDrop(event, data);

if (data.type === "Folder") return this._onDropFolder(event, data);
Expand Down
2 changes: 0 additions & 2 deletions src/module/applications/sidebar/_module.js
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export { default as ActorDirectoryPbtA } from "./actor-directory.js";
export { default as PbtACombatTracker } from "./combat-tracker.js";

30 changes: 14 additions & 16 deletions src/module/applications/sidebar/actor-directory.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
export default class ActorDirectoryPbtA extends ActorDirectory {
static entryPartial = "systems/pbta/templates/sidebar/actor-document-partial.hbs";
export default class ActorDirectoryPbtA extends foundry.applications.sidebar.tabs.ActorDirectory {
static _entryPartial = "systems/pbta/templates/sidebar/actor-document-partial.hbs";

static get defaultOptions() {
const options = super.defaultOptions;
options.renderUpdateKeys.push("system.advancements", "system.playbook.name");
return options;
}
static DEFAULT_OPTIONS = {
collection: "Actor",
renderUpdateKeys: ["name", "img", "ownership", "sort", "folder", "system.advancements", "system.playbook.name"]
};

async getData(options) {
const data = await super.getData(options);
return foundry.utils.mergeObject(data, {
async _prepareContext(options) {
const context = await super._prepareContext(options);
Object.assign(context, {
hideAdvancement: game.settings.get("pbta", "hideAdvancement") !== "none"
});
return context;
}

_getEntryContextOptions() {
const options = super._getEntryContextOptions();
return options.concat({
name: "PBTA.ResetAdvancements",
icon: '<i class="fas fa-undo"></i>',
condition: (header) => {
const li = header.closest(".directory-item");
const document = this.collection.get(li.data("documentId"));
condition: (li) => {
const document = this.collection.get(li.dataset.documentId);
const advancements = foundry.utils.getProperty(document, "system.advancements") > 0;
return advancements && game.user.isGM;
},
callback: (header) => {
const li = header.closest(".directory-item");
const document = this.collection.get(li.data("documentId"));
callback: (li) => {
const document = this.collection.get(li.dataset.documentId);
return document.update({ "system.advancements": 0 });
}
});
Expand Down
Loading
Loading