Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cf3cbb892c | |||
| 2ce7e57f43 | |||
| e20b259d99 | |||
| 13df0ccecd |
@@ -1,3 +1,12 @@
|
|||||||
|
## 1.2.9
|
||||||
|
### Feature revival
|
||||||
|
- The "Tint secret doors" feature is back, but will remain disabled by default.
|
||||||
|
|
||||||
|
## 1.2.8
|
||||||
|
### Compatibility
|
||||||
|
- Smart Doors is now compatible with Foundry 0.8.8
|
||||||
|
- Due to API changes inside Foundry, Smart Doors is no longer compatible with Foundry versions older than 0.8.7
|
||||||
|
|
||||||
## 1.2.7
|
## 1.2.7
|
||||||
### Compatibility
|
### Compatibility
|
||||||
- Smart Doors is now compatible with Foundry 0.8.5
|
- Smart Doors is now compatible with Foundry 0.8.5
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -10,12 +10,6 @@ Makes doors smarter. Allows doors to synchronize across multiple scenes and send
|
|||||||
|
|
||||||
Door Control icons will be rendered the same size in every scene, regardless of the configured grid size. The size of the icons is configurable.
|
Door Control icons will be rendered the same size in every scene, regardless of the configured grid size. The size of the icons is configurable.
|
||||||
|
|
||||||
### Tint Secret Doors
|
|
||||||

|
|
||||||
|
|
||||||
Which where the secret doors again? This tints all secret doors grey in the GM view, allowing to easily differentiate between normal and secret doors.
|
|
||||||
|
|
||||||
|
|
||||||
### Toggle Secret Doors
|
### Toggle Secret Doors
|
||||||

|

|
||||||
|
|
||||||
@@ -29,6 +23,10 @@ Keep everyone informed who tried to open which door. Whenever a player tries to
|
|||||||
|
|
||||||
If the GM tries to open a locked door the sound will only played for him and no chat message will be sent.
|
If the GM tries to open a locked door the sound will only played for him and no chat message will be sent.
|
||||||
|
|
||||||
|
### Tint Secret Doors
|
||||||
|
This tints secret doors in a gay shade to make them easier to discern from regular doors when being zoomed further out.
|
||||||
|
|
||||||
|
|
||||||
### Synchronized Doors
|
### Synchronized Doors
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,10 @@
|
|||||||
"name": "Door Control Size Factor",
|
"name": "Door Control Size Factor",
|
||||||
"hint": "Defines by which factor the size of the door control icons should be scaled up"
|
"hint": "Defines by which factor the size of the door control icons should be scaled up"
|
||||||
},
|
},
|
||||||
|
"highlightSecretDoors": {
|
||||||
|
"name": "Tint Secret Doors",
|
||||||
|
"hint": "Shade secret doors in a different color on the gm screen to differentiate them from normal doors"
|
||||||
|
},
|
||||||
"lockedDoorAlert": {
|
"lockedDoorAlert": {
|
||||||
"name": "Locked Door Alert",
|
"name": "Locked Door Alert",
|
||||||
"hint": "Send a message in chat when a player tried to open a locked door"
|
"hint": "Send a message in chat when a player tried to open a locked door"
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
"name": "smart-doors",
|
"name": "smart-doors",
|
||||||
"title": "Smart Doors",
|
"title": "Smart Doors",
|
||||||
"description": "Makes doors smarter. Allows doors to synchronize across multiple scenes and sends chat messages when players try to open locked doors.",
|
"description": "Makes doors smarter. Allows doors to synchronize across multiple scenes and sends chat messages when players try to open locked doors.",
|
||||||
"version": "1.2.7",
|
"version": "1.2.9",
|
||||||
"minimumCoreVersion" : "0.8.5",
|
"minimumCoreVersion" : "0.8.7",
|
||||||
"compatibleCoreVersion" : "0.8.5",
|
"compatibleCoreVersion" : "0.8.8",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Manuel Vögele",
|
"name": "Manuel Vögele",
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
],
|
],
|
||||||
"url": "https://github.com/manuelVo/foundryvtt-smart-doors",
|
"url": "https://github.com/manuelVo/foundryvtt-smart-doors",
|
||||||
"manifest": "https://raw.githubusercontent.com/manuelVo/foundryvtt-smart-doors/master/module.json",
|
"manifest": "https://raw.githubusercontent.com/manuelVo/foundryvtt-smart-doors/master/module.json",
|
||||||
"download": "https://github.com/manuelVo/foundryvtt-smart-doors/archive/v1.2.7.zip",
|
"download": "https://github.com/manuelVo/foundryvtt-smart-doors/archive/v1.2.9.zip",
|
||||||
"readme": "https://github.com/manuelVo/foundryvtt-smart-doors/blob/master/README.md",
|
"readme": "https://github.com/manuelVo/foundryvtt-smart-doors/blob/master/README.md",
|
||||||
"changelog": "https://github.com/manuelVo/foundryvtt-smart-doors/blob/master/CHANGELOG.md",
|
"changelog": "https://github.com/manuelVo/foundryvtt-smart-doors/blob/master/CHANGELOG.md",
|
||||||
"bugs": "https://github.com/manuelVo/foundryvtt-smart-doors/issues",
|
"bugs": "https://github.com/manuelVo/foundryvtt-smart-doors/issues",
|
||||||
|
|||||||
34
src/features/highlight_secret_doors.js
Normal file
34
src/features/highlight_secret_doors.js
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import {settingsKey} from "../settings.js"
|
||||||
|
|
||||||
|
const SECRET_DOOR_TINT = 0x888888
|
||||||
|
|
||||||
|
// Tint all secret doors dark grey
|
||||||
|
export function onCanvasReady(currentCanvas) {
|
||||||
|
if (game.settings.get(settingsKey, "highlightSecretDoors")) {
|
||||||
|
const types = CONST.WALL_DOOR_TYPES
|
||||||
|
const secretDoors = canvas.controls.doors.children.filter(control => control.wall.data.door == types.SECRET)
|
||||||
|
secretDoors.forEach(control => control.icon.tint = SECRET_DOOR_TINT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If door type has been changed, tint the door accordingly
|
||||||
|
export function onUpdateWall(scene, wall, update) {
|
||||||
|
if (!game.settings.get(settingsKey, "highlightSecretDoors"))
|
||||||
|
return
|
||||||
|
const types = CONST.WALL_DOOR_TYPES
|
||||||
|
if (wall.door === types.NONE)
|
||||||
|
return
|
||||||
|
// Find the door control corresponding to the changed door
|
||||||
|
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)
|
||||||
|
changedDoor.icon.tint = 0xFFFFFF
|
||||||
|
else if (wall.door === types.SECRET)
|
||||||
|
changedDoor.icon.tint = SECRET_DOOR_TINT
|
||||||
|
else
|
||||||
|
console.warn("Smart Doors | Encountered unknown door type " + wall.door + " while highlighting secret doors.")
|
||||||
|
}
|
||||||
@@ -33,7 +33,7 @@ export function onRederWallConfig(wallConfig, html, data) {
|
|||||||
export async function onWallConfigUpdate(event, formData) {
|
export async function onWallConfigUpdate(event, formData) {
|
||||||
const synchronizeSecretStatus = formData.synchronizeSecretStatus;
|
const synchronizeSecretStatus = formData.synchronizeSecretStatus;
|
||||||
const updateData = {flags: {smartdoors: {synchronizationGroup: formData.synchronizationGroup}}};
|
const updateData = {flags: {smartdoors: {synchronizationGroup: formData.synchronizationGroup}}};
|
||||||
let ids = this.options.editTargets;
|
let ids = this.editTargets;
|
||||||
if (ids.length == 0) {
|
if (ids.length == 0) {
|
||||||
ids = [this.object.id];
|
ids = [this.object.id];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import {libWrapper} from "../lib/libwrapper_shim.js";
|
import {libWrapper} from "../lib/libwrapper_shim.js";
|
||||||
import * as DoorControlIconScale from "./features/door_control_icon_scale.js"
|
import * as DoorControlIconScale from "./features/door_control_icon_scale.js"
|
||||||
|
import * as HighlightSecretDoors from "./features/highlight_secret_doors.js"
|
||||||
import * as LockedDoorAlert from "./features/locked_door_alert.js"
|
import * as LockedDoorAlert from "./features/locked_door_alert.js"
|
||||||
import * as SynchronizedDoors from "./features/synchronized_doors.js"
|
import * as SynchronizedDoors from "./features/synchronized_doors.js"
|
||||||
import * as ToggleSecretDoor from "./features/toggle_secret_door.js"
|
import * as ToggleSecretDoor from "./features/toggle_secret_door.js"
|
||||||
@@ -24,6 +25,9 @@ Hooks.once("ready", () => {
|
|||||||
Hooks.on("renderChatMessage", LockedDoorAlert.onRenderChatMessage)
|
Hooks.on("renderChatMessage", LockedDoorAlert.onRenderChatMessage)
|
||||||
|
|
||||||
Hooks.on("canvasReady", DoorControlIconScale.onCanvasReady)
|
Hooks.on("canvasReady", DoorControlIconScale.onCanvasReady)
|
||||||
|
Hooks.on("canvasReady", HighlightSecretDoors.onCanvasReady)
|
||||||
|
|
||||||
|
Hooks.on("updateWall", HighlightSecretDoors.onUpdateWall)
|
||||||
|
|
||||||
// Inject our custom settings into the WallConfig dialog
|
// Inject our custom settings into the WallConfig dialog
|
||||||
Hooks.on("renderWallConfig", SynchronizedDoors.onRederWallConfig)
|
Hooks.on("renderWallConfig", SynchronizedDoors.onRederWallConfig)
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
export const settingsKey = "smart-doors";
|
export const settingsKey = "smart-doors";
|
||||||
|
|
||||||
|
function reloadGM() {
|
||||||
|
if (game.user.isGM)
|
||||||
|
location.reload()
|
||||||
|
}
|
||||||
|
|
||||||
export function registerSettings() {
|
export function registerSettings() {
|
||||||
game.settings.register(settingsKey, "dataVersion", {
|
game.settings.register(settingsKey, "dataVersion", {
|
||||||
scope: "world",
|
scope: "world",
|
||||||
@@ -16,6 +21,15 @@ export function registerSettings() {
|
|||||||
default: 1.5,
|
default: 1.5,
|
||||||
onChange: () => location.reload()
|
onChange: () => location.reload()
|
||||||
})
|
})
|
||||||
|
game.settings.register(settingsKey, "highlightSecretDoors", {
|
||||||
|
name: "smart-doors.settings.highlightSecretDoors.name",
|
||||||
|
hint: "smart-doors.settings.highlightSecretDoors.hint",
|
||||||
|
scope: "world",
|
||||||
|
config: true,
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
onChange: reloadGM,
|
||||||
|
})
|
||||||
game.settings.register(settingsKey, "toggleSecretDoors", {
|
game.settings.register(settingsKey, "toggleSecretDoors", {
|
||||||
name: "smart-doors.settings.toggleSecretDoors.name",
|
name: "smart-doors.settings.toggleSecretDoors.name",
|
||||||
hint: "smart-doors.settings.toggleSecretDoors.hint",
|
hint: "smart-doors.settings.toggleSecretDoors.hint",
|
||||||
|
|||||||
Reference in New Issue
Block a user