Toggle between secret and normal door by ctrl+left click
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
## v1.1.0 (in development)
|
## v1.1.0 (in development)
|
||||||
### New features
|
### New features
|
||||||
- Tint secret doors grey for the GM to differentiate them from regular doors
|
- Tint secret doors grey for the GM to differentiate them from regular doors
|
||||||
|
- Toggle doors between secret and normal with ctrl+click
|
||||||
|
|
||||||
## 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
|
||||||
|
|||||||
@@ -9,6 +9,12 @@ Makes doors smarter. Allows doors to synchronize across multiple scenes and send
|
|||||||
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.
|
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
|
||||||
|

|
||||||
|
|
||||||
|
Easily reveal secret doors to players. Strg+left click secrets doors to turn them into regular doors. Strg+left click can also be done on normal doors to turn them into secret doors. Using this in combination with Tint Secret Doors is recommended so you can actually see what you are doing.
|
||||||
|
|
||||||
|
|
||||||
### Locked Door Alerts
|
### Locked Door Alerts
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,10 @@
|
|||||||
"synchronizedDoors": {
|
"synchronizedDoors": {
|
||||||
"name": "Synchronized Doors",
|
"name": "Synchronized Doors",
|
||||||
"hint": "Synchronize the state of configured doors"
|
"hint": "Synchronize the state of configured doors"
|
||||||
|
},
|
||||||
|
"toggleSecretDoors": {
|
||||||
|
"name": "Toggle Secret Doors",
|
||||||
|
"hint": "Toggle the door type between normal and secret using ctrl+left click"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ui": {
|
"ui": {
|
||||||
|
|||||||
23
main.js
23
main.js
@@ -168,6 +168,9 @@ function onDoorMouseDown(event) {
|
|||||||
if ( game.paused && !game.user.isGM )
|
if ( game.paused && !game.user.isGM )
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
if (toggleSecretDoorLeftClick.call(this, event))
|
||||||
|
return true
|
||||||
|
|
||||||
if (lockedDoorAlertLeftClick.call(this))
|
if (lockedDoorAlertLeftClick.call(this))
|
||||||
return true
|
return true
|
||||||
|
|
||||||
@@ -179,12 +182,24 @@ function onDoorMouseDown(event) {
|
|||||||
|
|
||||||
// Our custom handler for rightdown events on doors
|
// Our custom handler for rightdown events on doors
|
||||||
function onDoorRightDown(event) {
|
function onDoorRightDown(event) {
|
||||||
|
|
||||||
if (synchronizedDoorsRightClick.call(this))
|
if (synchronizedDoorsRightClick.call(this))
|
||||||
return true
|
return true
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Toggles between normal and secret doors
|
||||||
|
function toggleSecretDoorLeftClick(event) {
|
||||||
|
if (event.data.originalEvent.ctrlKey && game.user.isGM && game.settings.get(settingsKey, "toggleSecretDoors")) {
|
||||||
|
const types = CONST.WALL_DOOR_TYPES
|
||||||
|
const newtype = this.wall.data.door === types.DOOR ? types.SECRET : types.DOOR
|
||||||
|
this.wall.update({door: newtype})
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// Creates a chat message stating that a player tried to open a locked door
|
// Creates a chat message stating that a player tried to open a locked door
|
||||||
function lockedDoorAlertLeftClick() {
|
function lockedDoorAlertLeftClick() {
|
||||||
const state = this.wall.data.ds
|
const state = this.wall.data.ds
|
||||||
@@ -318,6 +333,14 @@ function registerSettings() {
|
|||||||
default: true,
|
default: true,
|
||||||
onChange: reloadGM,
|
onChange: reloadGM,
|
||||||
})
|
})
|
||||||
|
game.settings.register(settingsKey, "toggleSecretDoors", {
|
||||||
|
name: "smart-doors.settings.toggleSecretDoors.name",
|
||||||
|
hint: "smart-doors.settings.toggleSecretDoors.hint",
|
||||||
|
scope: "world",
|
||||||
|
config: true,
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
})
|
||||||
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