Ensure doors are on the current scene before tinting them
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
- In cloned scenes Locked Door Alerts will now only highlight the door in the correct scene
|
- In cloned scenes Locked Door Alerts will now only highlight the door in the correct scene
|
||||||
- When adding a door to a synchronization group it will now assume the correct state if it's being synchronized with it's twin door on a cloned map
|
- When adding a door to a synchronization group it will now assume the correct state if it's being synchronized with it's twin door on a cloned map
|
||||||
- Fixed a bug that allowed synchonized doors to be opened dispite them being locked
|
- Fixed a bug that allowed synchonized doors to be opened dispite them being locked
|
||||||
|
- Fixed a bug where secret doors that were synchronized with doors on other scenes wouldn't be tinted corretly after interacting with them
|
||||||
|
|
||||||
## v1.0.1
|
## v1.0.1
|
||||||
- When adding a door to a synchronization group adjust it's state to bring it in sync with the other doors
|
- When adding a door to a synchronization group adjust it's state to bring it in sync with the other doors
|
||||||
|
|||||||
8
main.js
8
main.js
@@ -98,7 +98,13 @@ Hooks.on("updateWall", (scene, wall, update) => {
|
|||||||
const types = CONST.WALL_DOOR_TYPES
|
const types = CONST.WALL_DOOR_TYPES
|
||||||
if (wall.door === types.NONE)
|
if (wall.door === types.NONE)
|
||||||
return
|
return
|
||||||
|
// Find the door control corresponding to the changed door
|
||||||
const changedDoor = canvas.controls.doors.children.find(control => control.wall.data._id === wall._id);
|
const changedDoor = canvas.controls.doors.children.find(control => control.wall.data._id === wall._id);
|
||||||
|
// If the changed door doesn't have a control it's not on this scene - ignore it
|
||||||
|
if (!changedDoor)
|
||||||
|
return
|
||||||
|
// The wall object we got passed might be from another scene so we replace it with the door from the current scene
|
||||||
|
wall = changedDoor.wall.data
|
||||||
if (wall.door === types.DOOR)
|
if (wall.door === types.DOOR)
|
||||||
changedDoor.icon.tint = 0xFFFFFF
|
changedDoor.icon.tint = 0xFFFFFF
|
||||||
else if (wall.door === types.SECRET)
|
else if (wall.door === types.SECRET)
|
||||||
@@ -289,7 +295,7 @@ function lockedDoorAlertLeftClick() {
|
|||||||
// Updates all doors in the specified synchronization group with the provided data
|
// Updates all doors in the specified synchronization group with the provided data
|
||||||
function updateSynchronizedDoors(updateData, synchronizationGroup) {
|
function updateSynchronizedDoors(updateData, synchronizationGroup) {
|
||||||
// Search for doors belonging to the synchronization group in all scenes
|
// Search for doors belonging to the synchronization group in all scenes
|
||||||
let scenes = filterAllWalls(wall => wall.door && wall.flags.smartdoors?.synchronizationGroup == synchronizationGroup);
|
let scenes = filterAllWalls(wall => wall.door && wall.flags.smartdoors?.synchronizationGroup === synchronizationGroup);
|
||||||
|
|
||||||
// Update all doors in the synchronization group
|
// Update all doors in the synchronization group
|
||||||
scenes.forEach((scene) => {
|
scenes.forEach((scene) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user