Skip to content

Commit

Permalink
fix(door-control): fixed exception and built workaround for new code …
Browse files Browse the repository at this point in the history
…which checks the button number on door mousedown events
  • Loading branch information
749 committed Aug 5, 2022
1 parent 3e78581 commit f69802a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/js/modules/cameraControl/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default class CameraControl extends AbstractSubModule {
return;
}
activeCharacterTokens = activeCharacterTokens.filter((token) =>
token.combatant
token.hasOwnProperty("combatant")
? !token.combatant.data.hidden && !token.combatant.data.defeated
: true
);
Expand Down
10 changes: 9 additions & 1 deletion src/js/modules/doorHandler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,15 @@ export default class DoorHandler extends AbstractSubModule {
`${doorCR.player.name}[${doorCR.token.name}]: toggling the door `,
doorCR.door
);
doorCR.door.doorControl._onMouseDown(new MouseEvent("mousedown"));
const evt = new PIXI.InteractionEvent();
// TODO: ugly hack to get the event to trigger properly
evt.data = {
button: 0,
originalEvent: {
button: 0
}
};
doorCR.door.doorControl._onMouseDown(evt);
this.#nextDoorTimestamp = now + 150;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/module.tmpl.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "{{version}}",
"title": "Mind Flayer - Token Controller",
"description": "Adds functionality to control tokens through external applications or devices. Mind Flayer server (https://github.com/mindflayer-vtt/mindflayer-server) is required for the module to communicate with external services.",
"minimumCoreVersion": "0.8.0",
"minimumCoreVersion": "9.0",
"compatibleCoreVersion": "9.269",
"author": "749, shawly",
"authors": [
Expand Down

0 comments on commit f69802a

Please sign in to comment.