Update class imports to use fully qualified Foundry paths
This commit is contained in:
parent
c26574d2d1
commit
2a797ed8ed
10 changed files with 41 additions and 23 deletions
|
@ -2,7 +2,7 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
export class DS4ActiveEffectConfig extends ActiveEffectConfig {
|
export class DS4ActiveEffectConfig extends foundry.applications.sheets.ActiveEffectConfig {
|
||||||
/** @override */
|
/** @override */
|
||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||||
|
|
|
@ -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 ActorSheet {
|
export class DS4ActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||||
/** @override */
|
/** @override */
|
||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||||
|
|
|
@ -17,9 +17,12 @@ 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 TextEditor.enrichHTML(context.data.system.profile.biography, {
|
context.data.system.profile.biography = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
|
||||||
|
context.data.system.profile.biography,
|
||||||
|
{
|
||||||
async: true,
|
async: true,
|
||||||
});
|
},
|
||||||
|
);
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,12 @@ 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 TextEditor.enrichHTML(context.data.system.baseInfo.description, {
|
context.data.system.baseInfo.description = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
|
||||||
|
context.data.system.baseInfo.description,
|
||||||
|
{
|
||||||
async: true,
|
async: true,
|
||||||
});
|
},
|
||||||
|
);
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 ItemSheet {
|
export class DS4ItemSheet extends foundry.appv1.sheets.ItemSheet {
|
||||||
/** @override */
|
/** @override */
|
||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||||
|
@ -33,9 +33,12 @@ export class DS4ItemSheet extends 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 TextEditor.enrichHTML(superContext.data.system.description, {
|
superContext.data.system.description = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
|
||||||
|
superContext.data.system.description,
|
||||||
|
{
|
||||||
async: true,
|
async: true,
|
||||||
});
|
},
|
||||||
|
);
|
||||||
const context = {
|
const context = {
|
||||||
...superContext,
|
...superContext,
|
||||||
config: DS4,
|
config: DS4,
|
||||||
|
|
|
@ -166,7 +166,7 @@ async function askForInteractiveRollData(checkTargetNumber, options = {}, { temp
|
||||||
}),
|
}),
|
||||||
id,
|
id,
|
||||||
};
|
};
|
||||||
const renderedHtml = await renderTemplate(usedTemplate, templateData);
|
const renderedHtml = await foundry.applications.handlebars.renderTemplate(usedTemplate, templateData);
|
||||||
|
|
||||||
const dialogPromise = new Promise((resolve) => {
|
const dialogPromise = new Promise((resolve) => {
|
||||||
new DialogWithListeners(
|
new DialogWithListeners(
|
||||||
|
|
|
@ -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 renderTemplate(template, chatData);
|
return foundry.applications.handlebars.renderTemplate(template, chatData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 loadTemplates(templatePaths);
|
await foundry.applications.handlebars.loadTemplates(templatePaths);
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,16 +65,25 @@ async function init() {
|
||||||
|
|
||||||
registerSystemSettings();
|
registerSystemSettings();
|
||||||
|
|
||||||
DocumentSheetConfig.unregisterSheet(Actor, "core", ActorSheet);
|
foundry.applications.apps.DocumentSheetConfig.unregisterSheet(Actor, "core", foundry.appv1.sheets.ActorSheet);
|
||||||
DocumentSheetConfig.registerSheet(Actor, "ds4", DS4CharacterActorSheet, {
|
foundry.applications.apps.DocumentSheetConfig.registerSheet(Actor, "ds4", DS4CharacterActorSheet, {
|
||||||
types: ["character"],
|
types: ["character"],
|
||||||
makeDefault: true,
|
makeDefault: true,
|
||||||
});
|
});
|
||||||
DocumentSheetConfig.registerSheet(Actor, "ds4", DS4CreatureActorSheet, { types: ["creature"], makeDefault: true });
|
foundry.applications.apps.DocumentSheetConfig.registerSheet(Actor, "ds4", DS4CreatureActorSheet, {
|
||||||
DocumentSheetConfig.unregisterSheet(Item, "core", ItemSheet);
|
types: ["creature"],
|
||||||
DocumentSheetConfig.registerSheet(Item, "ds4", DS4ItemSheet, { makeDefault: true });
|
makeDefault: true,
|
||||||
DocumentSheetConfig.unregisterSheet(ActiveEffect, "core", ActiveEffectConfig);
|
});
|
||||||
DocumentSheetConfig.registerSheet(ActiveEffect, "ds4", DS4ActiveEffectConfig, { 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();
|
preloadFonts();
|
||||||
await registerHandlebarsPartials();
|
await registerHandlebarsPartials();
|
||||||
|
|
|
@ -40,7 +40,7 @@ export function getCanvas() {
|
||||||
* @returns {Game}
|
* @returns {Game}
|
||||||
*/
|
*/
|
||||||
export function getGame() {
|
export function getGame() {
|
||||||
enforce(game instanceof Game, "Game is not initialized yet.");
|
enforce(game instanceof foundry.Game, "Game is not initialized yet.");
|
||||||
return game;
|
return game;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue