feat: update base sheet and item sheet classes

This commit is contained in:
Alexander Minges 2025-07-13 15:00:37 +02:00
parent 251cfa100b
commit 6e1b043e4f
Signed by: Athemis
GPG key ID: 31FBDEF92DDB162B
4 changed files with 9 additions and 5 deletions

View file

@ -7,7 +7,7 @@
/**
* The base sheet class for DS4 Actor Sheets
*/
export class DS4ActorSheet extends foundry.applications.api.DocumentSheetV2 {
export class DS4ActorSheet extends foundry.applications.api.HandlebarsApplicationMixin(foundry.applications.sheets.ActorSheetV2) {
static DEFAULT_OPTIONS = {
classes: ["sheet", "ds4-actor-sheet", "themed"],
tag: "form",
@ -68,6 +68,7 @@ export class DS4ActorSheet extends foundry.applications.api.DocumentSheetV2 {
return templatePath;
}
/** @override */
async _renderHTML(context) {
return await foundry.applications.handlebars.renderTemplate(this.template, context);
@ -78,6 +79,8 @@ export class DS4ActorSheet extends foundry.applications.api.DocumentSheetV2 {
content.innerHTML = result;
}
/** @override */
async _prepareContext(options) {
const context = await super._prepareContext(options);
@ -612,7 +615,8 @@ export class DS4ActorSheet extends foundry.applications.api.DocumentSheetV2 {
* @param {Event} event - The triggering event
* @param {HTMLElement} target - The target element
*/
async _onEditImage(event, target) {
async _onEditImage(_event, _target) {
const attr = "img";
const current = this.document.img;

View file

@ -7,7 +7,7 @@
/**
* The Sheet class for DS4 Items
*/
export class DS4ItemSheet extends foundry.applications.sheets.ItemSheetV2 {
export class DS4ItemSheet extends foundry.applications.api.HandlebarsApplicationMixin(foundry.applications.sheets.ItemSheetV2) {
static DEFAULT_OPTIONS = {
classes: ["sheet", "ds4-item-sheet", "themed"],
tag: "form",

View file

@ -491,7 +491,7 @@ export class DS4Actor extends Actor {
}),
ok: {
label: getGame().i18n.localize("DS4.GenericOkButton"),
callback: (event, button, dialog) => {
callback: (_event, button, _dialog) => {
const selectedAttribute = button.form.elements[attributeIdentifier].value;
if (!isAttribute(selectedAttribute)) {
throw new Error(

View file

@ -96,7 +96,7 @@ export class DS4Weapon extends DS4Item {
}),
ok: {
label: getGame().i18n.localize("DS4.GenericOkButton"),
callback: (event, button, dialog) => {
callback: (_event, button, _dialog) => {
const selectedAttackType = button.form.elements[identifier].value;
if (selectedAttackType !== "melee" && selectedAttackType !== "ranged") {
throw new Error(