diff --git a/lang/en.json b/lang/en.json index 14faa9d8..d6b19a45 100755 --- a/lang/en.json +++ b/lang/en.json @@ -216,7 +216,8 @@ }, "viewLevelups": "View Levelups", "InvalidOldCharacterImportTitle": "Old Character Import", - "InvalidOldCharacterImportText": "Character data exported prior to system version 1.1 will not generate a complete character. Do you wish to continue?" + "InvalidOldCharacterImportText": "Character data exported prior to system version 1.1 will not generate a complete character. Do you wish to continue?", + "cancelBeastform": "Cancel Beastform" }, "Companion": { "FIELDS": { @@ -316,8 +317,7 @@ "toLoadout": "Send to Loadout", "toVault": "Send to Vault", "unequip": "Unequip", - "useItem": "Use Item", - "cancelBeastform": "Cancel Beastform" + "useItem": "Use Item" }, "Countdown": { "addCountdown": "Add Countdown", diff --git a/module/applications/dialogs/imageSelectDialog.mjs b/module/applications/dialogs/imageSelectDialog.mjs index b54a45e0..9a012325 100644 --- a/module/applications/dialogs/imageSelectDialog.mjs +++ b/module/applications/dialogs/imageSelectDialog.mjs @@ -12,7 +12,7 @@ export default class ImageSelectDialog extends HandlebarsApplicationMixin(Applic tag: 'form', classes: ['daggerheart', 'dialog', 'dh-style', 'image-select'], position: { - width: 600, + width: 612, height: 'auto' }, window: { @@ -30,7 +30,10 @@ export default class ImageSelectDialog extends HandlebarsApplicationMixin(Applic /** @override */ static PARTS = { - main: { template: 'systems/daggerheart/templates/dialogs/image-select/main.hbs' }, + main: { + template: 'systems/daggerheart/templates/dialogs/image-select/main.hbs', + scrollable: ['.images-container'] + }, footer: { template: 'systems/daggerheart/templates/dialogs/image-select/footer.hbs' } }; diff --git a/module/applications/sheets/actors/character.mjs b/module/applications/sheets/actors/character.mjs index 79fa9893..6b89bf48 100644 --- a/module/applications/sheets/actors/character.mjs +++ b/module/applications/sheets/actors/character.mjs @@ -31,6 +31,7 @@ export default class CharacterSheet extends DHBaseActorSheet { toggleEquipItem: CharacterSheet.#toggleEquipItem, toggleResourceDice: CharacterSheet.#toggleResourceDice, handleResourceDice: CharacterSheet.#handleResourceDice, + cancelBeastform: CharacterSheet.#cancelBeastform, useDowntime: this.useDowntime }, window: { @@ -219,6 +220,8 @@ export default class CharacterSheet extends DHBaseActorSheet { } }; + context.beastformActive = this.document.effects.find(x => x.type === 'beastform'); + const homebrewCurrency = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).currency; if (homebrewCurrency.enabled) { context.inventory.currency = homebrewCurrency; @@ -848,6 +851,15 @@ export default class CharacterSheet extends DHBaseActorSheet { }); } + /** + * + */ + static async #cancelBeastform(_, target) { + const item = await getDocFromElement(target); + if (!item) return; + game.system.api.fields.ActionFields.BeastformField.handleActiveTransformations.call(item); + } + /** * Open the downtime application. * @type {ApplicationClickAction} diff --git a/module/applications/sheets/api/application-mixin.mjs b/module/applications/sheets/api/application-mixin.mjs index dd845d34..b229d249 100644 --- a/module/applications/sheets/api/application-mixin.mjs +++ b/module/applications/sheets/api/application-mixin.mjs @@ -420,19 +420,6 @@ export default function DHApplicationMixin(Base) { ]; if (usable) { - options.unshift({ - name: 'DAGGERHEART.APPLICATIONS.ContextMenu.cancelBeastform', - icon: 'fa-solid fa-ban', - condition: target => { - const doc = getDocFromElementSync(target); - return doc && doc.system?.actions?.some(a => a.type === 'beastform'); - }, - callback: async target => - game.system.api.fields.ActionFields.BeastformField.handleActiveTransformations.call( - await getDocFromElement(target) - ) - }); - options.unshift({ name: 'DAGGERHEART.GENERAL.damage', icon: 'fa-solid fa-explosion', diff --git a/module/data/fields/action/beastformField.mjs b/module/data/fields/action/beastformField.mjs index cefbcc21..6ec5fdac 100644 --- a/module/data/fields/action/beastformField.mjs +++ b/module/data/fields/action/beastformField.mjs @@ -41,9 +41,6 @@ export default class BeastformField extends fields.SchemaField { * @param {object} config Object that contains workflow datas. Usually made from Action Fields prepareConfig methods. */ static async execute(config) { - // Should not be useful anymore here - await BeastformField.handleActiveTransformations.call(this); - const { selected, evolved, hybrid } = await BeastformDialog.configure(config, this.item); if (!selected) return false; diff --git a/module/helpers/utils.mjs b/module/helpers/utils.mjs index 3044cd71..d5a402f2 100644 --- a/module/helpers/utils.mjs +++ b/module/helpers/utils.mjs @@ -257,9 +257,10 @@ export const updateActorTokens = async (actor, update) => { /* Update the tokens in all scenes belonging to Actor */ for (let token of actor.getDependentTokens()) { const tokenActor = token.baseActor ?? token.actor; - if (tokenActor?.id === actor.id) { + if (token.id && tokenActor?.id === actor.id) { await token.update({ - ...update + ...update, + _id: token.id }); } } diff --git a/styles/less/dialog/image-select/sheet.less b/styles/less/dialog/image-select/sheet.less index 1548044a..3ed4f583 100644 --- a/styles/less/dialog/image-select/sheet.less +++ b/styles/less/dialog/image-select/sheet.less @@ -6,6 +6,8 @@ display: flex; flex-wrap: wrap; gap: 8px; + max-height: 420px; + overflow: auto; img { width: 136px; diff --git a/templates/dialogs/image-select/main.hbs b/templates/dialogs/image-select/main.hbs index 099d88c3..54bf0d49 100644 --- a/templates/dialogs/image-select/main.hbs +++ b/templates/dialogs/image-select/main.hbs @@ -1,5 +1,7 @@ -
- {{#each images as |image|}} - - {{/each}} +
+
+ {{#each images as |image|}} + + {{/each}} +
\ No newline at end of file diff --git a/templates/sheets/global/partials/inventory-item-V2.hbs b/templates/sheets/global/partials/inventory-item-V2.hbs index 561e66c0..37c53dcc 100644 --- a/templates/sheets/global/partials/inventory-item-V2.hbs +++ b/templates/sheets/global/partials/inventory-item-V2.hbs @@ -139,9 +139,15 @@ Parameters:
{{#each item.system.actions as | action |}}
- + {{#if (and (eq action.type 'beastform') @root.beastformActive)}} + + {{else}} + + {{/if}} {{#if action.uses.max}}