Tint secret doors in grey for the GM
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
## v1.1.0 (in development)
|
||||||
|
### New features
|
||||||
|
- Tint secret doors grey for the GM to differentiate them from regular doors
|
||||||
|
|
||||||
## 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
|
||||||
- Use the players character as speaker for the Locked Door Alert
|
- Use the players character as speaker for the Locked Door Alert
|
||||||
|
|||||||
14
README.md
14
README.md
@@ -3,15 +3,21 @@ Makes doors smarter. Allows doors to synchronize across multiple scenes and send
|
|||||||
|
|
||||||
## Feature overview
|
## Feature overview
|
||||||
|
|
||||||
### Locked door alerts
|
### 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.
|
||||||
|
|
||||||
|
|
||||||
|
### Locked Door Alerts
|
||||||
|

|
||||||
|
|
||||||
Keep everyone informed who tried to open which door. Whenever a player tries to open a door that is locked, a chat message stating that fact will be sent to all players. Additionally the door locked sound will be played for everyone. When the chat message is hovered with the mouse, the door that the player tried to open will be highlighted.
|
Keep everyone informed who tried to open which door. Whenever a player tries to open a door that is locked, a chat message stating that fact will be sent to all players. Additionally the door locked sound will be played for everyone. When the chat message is hovered with the mouse, the door that the player tried to open will be highlighted.
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
### Synchronized doors
|
### Synchronized Doors
|
||||||

|

|
||||||
|
|
||||||
Keep multiple doors in sync - even across different scenes. Example use cases:
|
Keep multiple doors in sync - even across different scenes. Example use cases:
|
||||||
- A tavern has an outdoor and an indoor scene. If a player opens the entrance door on the outdoor map, the entrance door in the indoor map will be opened as well
|
- A tavern has an outdoor and an indoor scene. If a player opens the entrance door on the outdoor map, the entrance door in the indoor map will be opened as well
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
{
|
{
|
||||||
"smart-doors": {
|
"smart-doors": {
|
||||||
"settings": {
|
"settings": {
|
||||||
|
"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"
|
||||||
|
|||||||
39
main.js
39
main.js
@@ -37,6 +37,31 @@ Hooks.on("renderChatMessage", (message, html, data) => {
|
|||||||
html.on("mouseleave", mouseLeave);
|
html.on("mouseleave", mouseLeave);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const SECRET_DOOR_TINT = 0x222222
|
||||||
|
|
||||||
|
// Tint all secret doors dark grey
|
||||||
|
Hooks.on("canvasReady", () => {
|
||||||
|
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
|
||||||
|
Hooks.on("updateWall", (scene, wall, update) => {
|
||||||
|
const types = CONST.WALL_DOOR_TYPES
|
||||||
|
if (wall.door === types.NONE)
|
||||||
|
return
|
||||||
|
const changedDoor = canvas.controls.doors.children.find(control => control.wall.data._id === wall._id);
|
||||||
|
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.")
|
||||||
|
})
|
||||||
|
|
||||||
// Inject our custom settings into the WallConfig dialog
|
// Inject our custom settings into the WallConfig dialog
|
||||||
Hooks.on("renderWallConfig", (wallConfig, html, data) => {
|
Hooks.on("renderWallConfig", (wallConfig, html, data) => {
|
||||||
// Settings for synchronized doors
|
// Settings for synchronized doors
|
||||||
@@ -272,6 +297,11 @@ function performMigrations() {
|
|||||||
ui.notifications.error(game.i18n.localize("smart-doors.ui.messages.unknownVersion"), {permanent: true})
|
ui.notifications.error(game.i18n.localize("smart-doors.ui.messages.unknownVersion"), {permanent: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function reloadGM() {
|
||||||
|
if (game.user.isGM)
|
||||||
|
location.reload()
|
||||||
|
}
|
||||||
|
|
||||||
function registerSettings() {
|
function registerSettings() {
|
||||||
game.settings.register(settingsKey, "dataVersion", {
|
game.settings.register(settingsKey, "dataVersion", {
|
||||||
scope: "world",
|
scope: "world",
|
||||||
@@ -279,6 +309,15 @@ function registerSettings() {
|
|||||||
type: String,
|
type: String,
|
||||||
default: "fresh install"
|
default: "fresh install"
|
||||||
})
|
})
|
||||||
|
game.settings.register(settingsKey, "highlightSecretDoors", {
|
||||||
|
name: "smart-doors.settings.highlightSecretDoors.name",
|
||||||
|
hint: "smart-doors.settings.highlightSecretDoors.hint",
|
||||||
|
scope: "world",
|
||||||
|
config: true,
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
onChange: reloadGM,
|
||||||
|
})
|
||||||
game.settings.register(settingsKey, "lockedDoorAlert", {
|
game.settings.register(settingsKey, "lockedDoorAlert", {
|
||||||
name: "smart-doors.settings.lockedDoorAlert.name",
|
name: "smart-doors.settings.lockedDoorAlert.name",
|
||||||
hint: "smart-doors.settings.lockedDoorAlert.hint",
|
hint: "smart-doors.settings.lockedDoorAlert.hint",
|
||||||
|
|||||||
Reference in New Issue
Block a user