daggerheart/module/canvas/tokens.mjs
WBHarry d282a81594
[Feature] Summon Action Implementation (#1514)
* Schema definition for DHSummonAction

* Will reimplement

* HBS idea formed. Need to recheck drag drop implementation

* Tried to refine drag drop

* drag drop implemented (css tbd)

* phase 1 complete

* tbd work on summon action type

* Improved Schema and now it works

* .

* Dialog created. Tokens not dragged(tbd).

* Bare minimum implementation

* Finalized functionality

* Cleanup

* .

* Added optional summon render to chat message

* Updated SRD

* bugfix: fix title lines not rendering in chat messages

* Added summon actions to the easily doable environments in the SRD

* Update module/data/fields/action/summonField.mjs

Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>

---------

Co-authored-by: Nikhil Nagarajan <potter.nikhil@gmail.com>
Co-authored-by: Murilo Brito <dev.murilobrito@gmail.com>
Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
2026-01-13 10:36:29 +01:00

16 lines
715 B
JavaScript

export default class DhTokenLayer extends foundry.canvas.layers.TokenLayer {
async _createPreview(createData, options) {
if (options.actor) {
const tokenSizes = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).tokenSizes;
if (options.actor?.system.metadata.usesSize) {
const tokenSize = tokenSizes[options.actor.system.size];
if (tokenSize && options.actor.system.size !== CONFIG.DH.ACTOR.tokenSize.custom.id) {
createData.width = tokenSize;
createData.height = tokenSize;
}
}
}
return super._createPreview(createData, options);
}
}