Compare commits

..

No commits in common. "v13" and "main" have entirely different histories.
v13 ... main

11 changed files with 24 additions and 42 deletions

View file

@ -2,7 +2,7 @@
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
export class DS4ActiveEffectConfig extends foundry.applications.sheets.ActiveEffectConfig { export class DS4ActiveEffectConfig extends ActiveEffectConfig {
/** @override */ /** @override */
static get defaultOptions() { static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, { return foundry.utils.mergeObject(super.defaultOptions, {

View file

@ -16,7 +16,7 @@ import { disableOverriddenFields } from "../sheet-helpers";
/** /**
* The base sheet class for all {@link DS4Actor}s. * The base sheet class for all {@link DS4Actor}s.
*/ */
export class DS4ActorSheet extends foundry.appv1.sheets.ActorSheet { export class DS4ActorSheet extends ActorSheet {
/** @override */ /** @override */
static get defaultOptions() { static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, { return foundry.utils.mergeObject(super.defaultOptions, {

View file

@ -17,12 +17,9 @@ export class DS4CharacterActorSheet extends DS4ActorSheet {
/** @override */ /** @override */
async getData(options = {}) { async getData(options = {}) {
const context = await super.getData(options); const context = await super.getData(options);
context.data.system.profile.biography = await foundry.applications.ux.TextEditor.implementation.enrichHTML( context.data.system.profile.biography = await TextEditor.enrichHTML(context.data.system.profile.biography, {
context.data.system.profile.biography, async: true,
{ });
async: true,
},
);
return context; return context;
} }
} }

View file

@ -17,12 +17,9 @@ export class DS4CreatureActorSheet extends DS4ActorSheet {
/** @override */ /** @override */
async getData(options = {}) { async getData(options = {}) {
const context = await super.getData(options); const context = await super.getData(options);
context.data.system.baseInfo.description = await foundry.applications.ux.TextEditor.implementation.enrichHTML( context.data.system.baseInfo.description = await TextEditor.enrichHTML(context.data.system.baseInfo.description, {
context.data.system.baseInfo.description, async: true,
{ });
async: true,
},
);
return context; return context;
} }
} }

View file

@ -12,7 +12,7 @@ import { disableOverriddenFields } from "./sheet-helpers";
/** /**
* The Sheet class for DS4 Items * The Sheet class for DS4 Items
*/ */
export class DS4ItemSheet extends foundry.appv1.sheets.ItemSheet { export class DS4ItemSheet extends ItemSheet {
/** @override */ /** @override */
static get defaultOptions() { static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, { return foundry.utils.mergeObject(super.defaultOptions, {
@ -33,12 +33,9 @@ export class DS4ItemSheet extends foundry.appv1.sheets.ItemSheet {
/** @override */ /** @override */
async getData(options = {}) { async getData(options = {}) {
const superContext = await super.getData(options); const superContext = await super.getData(options);
superContext.data.system.description = await foundry.applications.ux.TextEditor.implementation.enrichHTML( superContext.data.system.description = await TextEditor.enrichHTML(superContext.data.system.description, {
superContext.data.system.description, async: true,
{ });
async: true,
},
);
const context = { const context = {
...superContext, ...superContext,
config: DS4, config: DS4,

View file

@ -166,7 +166,7 @@ async function askForInteractiveRollData(checkTargetNumber, options = {}, { temp
}), }),
id, id,
}; };
const renderedHtml = await foundry.applications.handlebars.renderTemplate(usedTemplate, templateData); const renderedHtml = await renderTemplate(usedTemplate, templateData);
const dialogPromise = new Promise((resolve) => { const dialogPromise = new Promise((resolve) => {
new DialogWithListeners( new DialogWithListeners(

View file

@ -29,6 +29,6 @@ export class DS4Roll extends Roll {
isCoup: isPrivate ? null : isCoup, isCoup: isPrivate ? null : isCoup,
isFumble: isPrivate ? null : isFumble, isFumble: isPrivate ? null : isFumble,
}; };
return foundry.applications.handlebars.renderTemplate(template, chatData); return renderTemplate(template, chatData);
} }
} }

View file

@ -56,5 +56,5 @@ export async function registerHandlebarsPartials() {
"systems/ds4/templates/sheets/shared/components/control-button-group.hbs", "systems/ds4/templates/sheets/shared/components/control-button-group.hbs",
"systems/ds4/templates/sheets/shared/components/rollable-image.hbs", "systems/ds4/templates/sheets/shared/components/rollable-image.hbs",
]; ];
await foundry.applications.handlebars.loadTemplates(templatePaths); await loadTemplates(templatePaths);
} }

View file

@ -65,25 +65,16 @@ async function init() {
registerSystemSettings(); registerSystemSettings();
foundry.applications.apps.DocumentSheetConfig.unregisterSheet(Actor, "core", foundry.appv1.sheets.ActorSheet); DocumentSheetConfig.unregisterSheet(Actor, "core", ActorSheet);
foundry.applications.apps.DocumentSheetConfig.registerSheet(Actor, "ds4", DS4CharacterActorSheet, { DocumentSheetConfig.registerSheet(Actor, "ds4", DS4CharacterActorSheet, {
types: ["character"], types: ["character"],
makeDefault: true, makeDefault: true,
}); });
foundry.applications.apps.DocumentSheetConfig.registerSheet(Actor, "ds4", DS4CreatureActorSheet, { DocumentSheetConfig.registerSheet(Actor, "ds4", DS4CreatureActorSheet, { types: ["creature"], makeDefault: true });
types: ["creature"], DocumentSheetConfig.unregisterSheet(Item, "core", ItemSheet);
makeDefault: true, DocumentSheetConfig.registerSheet(Item, "ds4", DS4ItemSheet, { makeDefault: true });
}); DocumentSheetConfig.unregisterSheet(ActiveEffect, "core", ActiveEffectConfig);
foundry.applications.apps.DocumentSheetConfig.unregisterSheet(Item, "core", foundry.appv1.sheets.ItemSheet); DocumentSheetConfig.registerSheet(ActiveEffect, "ds4", DS4ActiveEffectConfig, { makeDefault: true });
foundry.applications.apps.DocumentSheetConfig.registerSheet(Item, "ds4", DS4ItemSheet, { makeDefault: true });
foundry.applications.apps.DocumentSheetConfig.unregisterSheet(
ActiveEffect,
"core",
foundry.applications.sheets.ActiveEffectConfig,
);
foundry.applications.apps.DocumentSheetConfig.registerSheet(ActiveEffect, "ds4", DS4ActiveEffectConfig, {
makeDefault: true,
});
preloadFonts(); preloadFonts();
await registerHandlebarsPartials(); await registerHandlebarsPartials();

View file

@ -40,7 +40,7 @@ export function getCanvas() {
* @returns {Game} * @returns {Game}
*/ */
export function getGame() { export function getGame() {
enforce(game instanceof foundry.Game, "Game is not initialized yet."); enforce(game instanceof Game, "Game is not initialized yet.");
return game; return game;
} }

View file

@ -4,7 +4,7 @@ SPDX-FileCopyrightText: 2021 Johannes Loher
SPDX-License-Identifier: MIT SPDX-License-Identifier: MIT
--}} --}}
<div class="dice-roll" data-action="expandRoll"> <div class="dice-roll">
{{#if flavor}} {{#if flavor}}
<div class="dice-flavor">{{flavor}}</div> <div class="dice-flavor">{{flavor}}</div>
{{/if}} {{/if}}