Update class imports to use fully qualified Foundry paths

This commit is contained in:
Alexander Minges 2025-05-02 11:53:38 +02:00
parent c26574d2d1
commit 2a797ed8ed
Signed by: Athemis
GPG key ID: 31FBDEF92DDB162B
10 changed files with 41 additions and 23 deletions

View file

@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: MIT
export class DS4ActiveEffectConfig extends ActiveEffectConfig {
export class DS4ActiveEffectConfig extends foundry.applications.sheets.ActiveEffectConfig {
/** @override */
static get 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.
*/
export class DS4ActorSheet extends ActorSheet {
export class DS4ActorSheet extends foundry.appv1.sheets.ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {

View file

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

View file

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

View file

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

View file

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

View file

@ -29,6 +29,6 @@ export class DS4Roll extends Roll {
isCoup: isPrivate ? null : isCoup,
isFumble: isPrivate ? null : isFumble,
};
return renderTemplate(template, chatData);
return foundry.applications.handlebars.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/rollable-image.hbs",
];
await loadTemplates(templatePaths);
await foundry.applications.handlebars.loadTemplates(templatePaths);
}

View file

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

View file

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