Remove features that are obsolete in 0.8
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
import {settingsKey} from "../settings.js"
|
||||
import {OutlineFilter} from "../../lib/outline_filter/outline_filter.js"
|
||||
|
||||
export function onDoorControlPostDraw() {
|
||||
if (!game.settings.get(settingsKey, "doorControlOutline"))
|
||||
return
|
||||
|
||||
const types = CONST.WALL_DOOR_TYPES
|
||||
if (this.wall.data.door === types.NONE)
|
||||
return
|
||||
|
||||
// Remove all OutlineFilters from current filters
|
||||
let pixiFilters = this.icon.filters || []
|
||||
pixiFilters = pixiFilters.filter(pixiFilter => !(pixiFilter instanceof OutlineFilter))
|
||||
|
||||
let outlineFilter;
|
||||
if (this.wall.data.door === types.SECRET && game.settings.get(settingsKey, "highlightSecretDoors"))
|
||||
outlineFilter = new OutlineFilter(1, 0xFFFFFF)
|
||||
else
|
||||
outlineFilter = new OutlineFilter(1, 0x000000)
|
||||
|
||||
pixiFilters.push(outlineFilter)
|
||||
this.icon.filters = pixiFilters
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
import {settingsKey} from "../settings.js"
|
||||
|
||||
const SECRET_DOOR_TINT = 0x000000
|
||||
|
||||
// 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.")
|
||||
}
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
import {libWrapper} from "../lib/libwrapper_shim.js";
|
||||
import * as DoorControlIconScale from "./features/door_control_icon_scale.js"
|
||||
import * as DoorControlOutline from "./features/door_control_outline.js"
|
||||
import * as HighlightSecretDoors from "./features/highlight_secret_doors.js"
|
||||
import * as LockedDoorAlert from "./features/locked_door_alert.js"
|
||||
import * as SynchronizedDoors from "./features/synchronized_doors.js"
|
||||
import * as ToggleSecretDoor from "./features/toggle_secret_door.js"
|
||||
@@ -26,9 +24,6 @@ Hooks.once("ready", () => {
|
||||
Hooks.on("renderChatMessage", LockedDoorAlert.onRenderChatMessage)
|
||||
|
||||
Hooks.on("canvasReady", DoorControlIconScale.onCanvasReady)
|
||||
Hooks.on("canvasReady", HighlightSecretDoors.onCanvasReady)
|
||||
|
||||
Hooks.on("updateWall", HighlightSecretDoors.onUpdateWall)
|
||||
|
||||
// Inject our custom settings into the WallConfig dialog
|
||||
Hooks.on("renderWallConfig", SynchronizedDoors.onRederWallConfig)
|
||||
@@ -46,7 +41,6 @@ function hookDoorControlDraw() {
|
||||
libWrapper.register("smart-doors", "DoorControl.prototype.draw", async function (wrapped) {
|
||||
const result = await wrapped();
|
||||
DoorControlIconScale.onDoorControlPostDraw.call(this)
|
||||
DoorControlOutline.onDoorControlPostDraw.call(this)
|
||||
return result;
|
||||
}, "WRAPPER");
|
||||
}
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
export const settingsKey = "smart-doors";
|
||||
|
||||
function reloadGM() {
|
||||
if (game.user.isGM)
|
||||
location.reload()
|
||||
}
|
||||
|
||||
export function registerSettings() {
|
||||
game.settings.register(settingsKey, "dataVersion", {
|
||||
scope: "world",
|
||||
@@ -21,24 +16,6 @@ export function registerSettings() {
|
||||
default: 1.5,
|
||||
onChange: () => location.reload()
|
||||
})
|
||||
game.settings.register(settingsKey, "doorControlOutline", {
|
||||
name: "smart-doors.settings.doorControlOutline.name",
|
||||
hint: "smart-doors.settings.doorControlOutline.hint",
|
||||
scope: "client",
|
||||
config: true,
|
||||
type: Boolean,
|
||||
default: true,
|
||||
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: true,
|
||||
onChange: reloadGM,
|
||||
})
|
||||
game.settings.register(settingsKey, "toggleSecretDoors", {
|
||||
name: "smart-doors.settings.toggleSecretDoors.name",
|
||||
hint: "smart-doors.settings.toggleSecretDoors.hint",
|
||||
|
||||
Reference in New Issue
Block a user