mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-21 18:09:54 +02:00
[Feature] Transform Linked Actors (#2046)
* Added ability to transform linked actors * Updated to use the utils getWorldActor function * Animate change and fix error when converting to unlinked --------- Co-authored-by: Carlos Fernandez <cfern1990@gmail.com>
This commit is contained in:
parent
44dd3bd2e1
commit
98fedf3990
9 changed files with 101 additions and 32 deletions
|
|
@ -34,12 +34,14 @@ export default class DhpActor extends Actor {
|
|||
super.prepareData();
|
||||
|
||||
// Update effects if it is the user's character or is controlled
|
||||
if (canvas.ready) {
|
||||
// A timeout avoids an infinite loop when accessing token actors before the delta is finished constructing
|
||||
window.setTimeout(() => {
|
||||
if (!canvas.ready) return;
|
||||
const controlled = canvas.tokens.controlled.some(t => t.actor === this);
|
||||
if (game.user.character === this || controlled) {
|
||||
ui.effectsDisplay.render();
|
||||
ui.effectsDisplay.refresh();
|
||||
}
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue