diff --git a/lang/en.json b/lang/en.json index 132c9f0b..498a45cb 100755 --- a/lang/en.json +++ b/lang/en.json @@ -2262,7 +2262,9 @@ "hybridizeFeatureTitle": "Hybrid Features", "hybridizeDrag": "Drag a form here to hybridize it.", "mainTrait": "Main Trait", - "traitBonus": "Trait Bonus" + "traitBonus": "Trait Bonus", + "evolvedTokenHint": "An evolved beastform's token is based on that of the form you evolve", + "evolvedImagePlaceholder": "The image for the form selected for evolution will be used" }, "Class": { "hopeFeatures": "Hope Features", diff --git a/module/applications/sheets/items/beastform.mjs b/module/applications/sheets/items/beastform.mjs index 5e9cffec..880c0796 100644 --- a/module/applications/sheets/items/beastform.mjs +++ b/module/applications/sheets/items/beastform.mjs @@ -77,7 +77,7 @@ export default class BeastformSheet extends DHBaseItemSheet { name: context.document.system.advantageOn[key].value })) ); - context.dimensionsDisabled = context.document.system.tokenSize.size === 'custom'; + context.dimensionsDisabled = context.document.system.tokenSize.size !== 'custom'; break; case 'effects': context.effects.actives = context.effects.actives.map(effect => { diff --git a/module/data/fields/action/beastformField.mjs b/module/data/fields/action/beastformField.mjs index 6ec5fdac..6185f0f8 100644 --- a/module/data/fields/action/beastformField.mjs +++ b/module/data/fields/action/beastformField.mjs @@ -92,6 +92,18 @@ export default class BeastformField extends fields.SchemaField { beastformEffect.changes = [...beastformEffect.changes, ...evolvedForm.changes]; formData.system.features = [...formData.system.features, ...selectedForm.system.features.map(x => x.uuid)]; + + const baseSize = evolvedData.form.system.tokenSize.size; + const evolvedSize = + baseSize === 'custom' + ? 'custom' + : (Object.keys(CONFIG.DH.ACTOR.tokenSize).find( + x => CONFIG.DH.ACTOR.tokenSize[x].value === CONFIG.DH.ACTOR.tokenSize[baseSize].value + 1 + ) ?? baseSize); + formData.system.tokenSize = { + ...evolvedData.form.system.tokenSize, + size: evolvedSize + }; } if (selectedForm.system.beastformType === CONFIG.DH.ITEM.beastformTypes.hybrid.id) { diff --git a/module/data/item/beastform.mjs b/module/data/item/beastform.mjs index 57a1e0a8..532cfcec 100644 --- a/module/data/item/beastform.mjs +++ b/module/data/item/beastform.mjs @@ -221,8 +221,8 @@ export default class DHBeastform extends BaseDataItem { const { x, y } = game.system.api.documents.DhToken.getSnappedPositionInSquareGrid( token.object.scene.grid, { x: token.x, y: token.y, elevation: token.elevation }, - width, - height + width ?? token.width, + height ?? token.height ); return { ...prototypeTokenUpdate, diff --git a/styles/less/sheets/items/beastform.less b/styles/less/sheets/items/beastform.less index 162c4925..100b024a 100644 --- a/styles/less/sheets/items/beastform.less +++ b/styles/less/sheets/items/beastform.less @@ -5,5 +5,8 @@ flex-direction: column; margin-top: 10px; } + .hint { + font-style: italic; + } } } diff --git a/templates/sheets/items/beastform/settings.hbs b/templates/sheets/items/beastform/settings.hbs index 470175d2..844b9d61 100644 --- a/templates/sheets/items/beastform/settings.hbs +++ b/templates/sheets/items/beastform/settings.hbs @@ -22,31 +22,33 @@
{{localize "DAGGERHEART.ITEMS.Beastform.tokenTitle"}} + {{#unless (eq source.system.beastformType 'evolved')}} +
+ {{formGroup systemFields.tokenImg value=source.system.tokenImg localize=true}} +
-
- {{formGroup systemFields.tokenImg value=source.system.tokenImg localize=true}} -
- -
- {{formGroup systemFields.tokenRingImg value=source.system.tokenRingImg localize=true}} -
- -
- {{formGroup systemFields.tokenSize.fields.size value=source.system.tokenSize.size label=(localize "DAGGERHEART.GENERAL.tokenSize") localize=true }} - {{formGroup - systemFields.tokenSize.fields.height - value=source.system.tokenSize.height - localize=true - placeholder=(localize (ifThen dimensionsDisabled "DAGGERHEART.ITEMS.Beastform.FIELDS.tokenSize.disabledPlaceholder" "DAGGERHEART.ITEMS.Beastform.FIELDS.tokenSize.placeholder")) - disabled=dimensionsDisabled - }} - {{formGroup - systemFields.tokenSize.fields.width - value=source.system.tokenSize.width - localize=true - placeholder=(localize (ifThen dimensionsDisabled "DAGGERHEART.ITEMS.Beastform.FIELDS.tokenSize.disabledPlaceholder" "DAGGERHEART.ITEMS.Beastform.FIELDS.tokenSize.placeholder")) - disabled=dimensionsDisabled - }} -
+
+ {{formGroup systemFields.tokenRingImg value=source.system.tokenRingImg localize=true}} +
+
+ {{formGroup systemFields.tokenSize.fields.size value=source.system.tokenSize.size label=(localize "DAGGERHEART.GENERAL.tokenSize") localize=true }} + {{formGroup + systemFields.tokenSize.fields.height + value=source.system.tokenSize.height + localize=true + placeholder=(localize (ifThen dimensionsDisabled "DAGGERHEART.ITEMS.Beastform.FIELDS.tokenSize.disabledPlaceholder" "DAGGERHEART.ITEMS.Beastform.FIELDS.tokenSize.placeholder")) + disabled=dimensionsDisabled + }} + {{formGroup + systemFields.tokenSize.fields.width + value=source.system.tokenSize.width + localize=true + placeholder=(localize (ifThen dimensionsDisabled "DAGGERHEART.ITEMS.Beastform.FIELDS.tokenSize.disabledPlaceholder" "DAGGERHEART.ITEMS.Beastform.FIELDS.tokenSize.placeholder")) + disabled=dimensionsDisabled + }} +
+ {{else}} + {{localize "DAGGERHEART.ITEMS.Beastform.evolvedTokenHint"}} + {{/unless}}
\ No newline at end of file