Update code for Foundry 9

This commit is contained in:
2022-01-05 11:49:14 +01:00
parent cf3cbb892c
commit 3dbaf84db3
7 changed files with 30 additions and 17 deletions

View File

@@ -1,10 +1,11 @@
import {toggleSecretDoor} from "../keybindings.js";
import {settingsKey} from "../settings.js"
import {updateSynchronizedDoors} from "./synchronized_doors.js";
// Toggles between normal and secret doors
export function onDoorLeftClick(event) {
export function onDoorLeftClick() {
// We don't trust the event to be filled with the expected data for compatibilty with arms reach (which passes a broken event)
if (game.settings.get(settingsKey, "toggleSecretDoors") && event.data?.originalEvent?.ctrlKey && game.user.isGM) {
if (toggleSecretDoor && game.user.isGM) {
const types = CONST.WALL_DOOR_TYPES
const newtype = this.wall.data.door === types.DOOR ? types.SECRET : types.DOOR
const updateData = {door: newtype}