From eef89c5a10921644444ea23fe0e04047c330bd56 Mon Sep 17 00:00:00 2001 From: macniel Date: Mon, 27 Oct 2025 16:15:13 +0100 Subject: [PATCH] fixes default behavior for editing an image --- src/module/sheets/characterSheet.mjs | 4 ++-- src/module/sheets/creatureSheet.mjs | 5 ++--- src/module/sheets/equipmentSheet.mjs | 3 +-- src/module/sheets/groupSheet.mjs | 5 ++--- src/module/sheets/merchantSheet.mjs | 6 +++--- src/templates/actor/character/main-sheet.hbs | 2 +- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/module/sheets/characterSheet.mjs b/src/module/sheets/characterSheet.mjs index ac9be466..2d46c838 100644 --- a/src/module/sheets/characterSheet.mjs +++ b/src/module/sheets/characterSheet.mjs @@ -11,7 +11,7 @@ import {CombatActionDialog} from "../dialog/combatAction.mjs"; import {ActionManager} from "./actions/action-manager.mjs"; import {DefenseActionDialog} from "../dialog/defenseAction.mjs"; -const {HandlebarsApplicationMixin} = foundry.applications.api +const {HandlebarsApplicationMixin, DocumentSheetV2} = foundry.applications.api const {ActorSheetV2} = foundry.applications.sheets const {ContextMenu} = foundry.applications.ux @@ -35,7 +35,7 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { rollCombatSkill: CharacterSheet.#rollCombatSkill, rollSkill: CharacterSheet.#rollSkill, roll: CharacterSheet.#dieRoll, - editImage: ActorSheetV2.DEFAULT_OPTIONS.actions.editImage, + editImage: DocumentSheetV2.DEFAULT_OPTIONS.actions.editImage, openEmbeddedDocument: CharacterSheet.#openEmbeddedDocument, openCultureDocument: CharacterSheet.#openCultureDocument, openSpeciesDocument: CharacterSheet.#openSpeciesDocument, diff --git a/src/module/sheets/creatureSheet.mjs b/src/module/sheets/creatureSheet.mjs index 6e754e2a..88ca33ef 100644 --- a/src/module/sheets/creatureSheet.mjs +++ b/src/module/sheets/creatureSheet.mjs @@ -1,4 +1,4 @@ -const {HandlebarsApplicationMixin} = foundry.applications.api +const {HandlebarsApplicationMixin, DocumentSheetV2} = foundry.applications.api const {ActorSheetV2} = foundry.applications.sheets export class CreatureSheet extends HandlebarsApplicationMixin(ActorSheetV2) { @@ -18,8 +18,7 @@ export class CreatureSheet extends HandlebarsApplicationMixin(ActorSheetV2) { removeAttack: CreatureSheet.#removeAttack, addAttack: CreatureSheet.#addAttack, roll: CreatureSheet.#dieRoll, - editImage: ActorSheetV2.DEFAULT_OPTIONS.actions.editImage, - + editImage: DocumentSheetV2.DEFAULT_OPTIONS.actions.editImage, } } diff --git a/src/module/sheets/equipmentSheet.mjs b/src/module/sheets/equipmentSheet.mjs index 3af53364..7f0f4238 100644 --- a/src/module/sheets/equipmentSheet.mjs +++ b/src/module/sheets/equipmentSheet.mjs @@ -27,8 +27,7 @@ export class EquipmentSheet extends HandlebarsApplicationMixin(DocumentSheetV2) resizable: true, }, actions: { - editImage: - DocumentSheetV2.DEFAULT_OPTIONS.actions.editImage + editImage: DocumentSheetV2.DEFAULT_OPTIONS.actions.editImage } } diff --git a/src/module/sheets/groupSheet.mjs b/src/module/sheets/groupSheet.mjs index 968b6f60..60a0102d 100644 --- a/src/module/sheets/groupSheet.mjs +++ b/src/module/sheets/groupSheet.mjs @@ -1,6 +1,5 @@ -const {HandlebarsApplicationMixin} = foundry.applications.api +const {HandlebarsApplicationMixin, DocumentSheetV2} = foundry.applications.api const {ActorSheetV2} = foundry.applications.sheets -const {ContextMenu} = foundry.applications.ux export class GroupSheet extends HandlebarsApplicationMixin(ActorSheetV2) { @@ -22,7 +21,7 @@ export class GroupSheet extends HandlebarsApplicationMixin(ActorSheetV2) { }, actions: { roll: GroupSheet.#dieRoll, - editImage: ActorSheetV2.DEFAULT_OPTIONS.actions.editImage, + editImage: DocumentSheetV2.DEFAULT_OPTIONS.actions.editImage, openEmbeddedDocument: GroupSheet.#openEmbeddedDocument, openActorDocument: GroupSheet.#openActorDocument, } diff --git a/src/module/sheets/merchantSheet.mjs b/src/module/sheets/merchantSheet.mjs index 22bc492a..85f9130c 100644 --- a/src/module/sheets/merchantSheet.mjs +++ b/src/module/sheets/merchantSheet.mjs @@ -1,5 +1,5 @@ -const {HandlebarsApplicationMixin} = foundry.applications.api -const {DocumentSheetV2, ActorSheetV2} = foundry.applications.sheets +const {HandlebarsApplicationMixin, DocumentSheetV2} = foundry.applications.api +const {ActorSheetV2} = foundry.applications.sheets export class MerchantSheet extends HandlebarsApplicationMixin(ActorSheetV2) { @@ -20,7 +20,7 @@ export class MerchantSheet extends HandlebarsApplicationMixin(ActorSheetV2) { resizable: true, }, actions: { - editImage: MerchantSheet.editImage, + editImage: DocumentSheetV2.DEFAULT_OPTIONS.actions.editImage, editServiceImage: MerchantSheet.#editServiceImage, editNewServiceImage: MerchantSheet.#editNewServiceImage, addNewService: MerchantSheet.#addNewService, diff --git a/src/templates/actor/character/main-sheet.hbs b/src/templates/actor/character/main-sheet.hbs index 086a1760..58b1bcc3 100644 --- a/src/templates/actor/character/main-sheet.hbs +++ b/src/templates/actor/character/main-sheet.hbs @@ -26,7 +26,7 @@
- +