|
@@ -4,11 +4,39 @@ WALLCOLOUR = "#111111"; |
|
|
/** @constant {number} */ |
|
|
/** @constant {number} */ |
|
|
WALLWIDTH = "4"; |
|
|
WALLWIDTH = "4"; |
|
|
|
|
|
|
|
|
|
|
|
/** @constant {string} */ |
|
|
|
|
|
MODULENAME = "foundry-walls-to-drawing"; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Set up configuration options |
|
|
|
|
|
* */ |
|
|
|
|
|
Hooks.on("init" () => { |
|
|
|
|
|
game.settings.register(MODULENAME, "cvWallColour", { |
|
|
|
|
|
name: "Converted Wall Colour", |
|
|
|
|
|
default: WALLCOLOUR, |
|
|
|
|
|
type: String, |
|
|
|
|
|
scope: "client", |
|
|
|
|
|
config: true, |
|
|
|
|
|
hint: "Enter a hexadecimal colour, eg #FF0000 for red" |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
game.settings.register(MODULENAME, "cvWallWidth", { |
|
|
|
|
|
name: "Converted Wall Width", |
|
|
|
|
|
default: WALLWIDTH, |
|
|
|
|
|
type: Number, |
|
|
|
|
|
scope: "client", |
|
|
|
|
|
config: true, |
|
|
|
|
|
hint: "Enter a decimal width" |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Add 'Convert to walls' button in Walls Layer Tools |
|
|
* Add 'Convert to walls' button in Walls Layer Tools |
|
|
* */ |
|
|
* */ |
|
|
|
|
|
|
|
|
Hooks.on('getSceneControlButtons', controls => { |
|
|
Hooks.on('getSceneControlButtons', controls => { |
|
|
|
|
|
cvWallColour = game.settings.get(MODULENAME, "cvWallColour"); |
|
|
|
|
|
cvWallWidth = game.settings.get(MODULENAME, "cvWallWidth"); |
|
|
|
|
|
|
|
|
let walls = controls.find(e => e.name === "walls"); |
|
|
let walls = controls.find(e => e.name === "walls"); |
|
|
walls.tools.push( { |
|
|
walls.tools.push( { |
|
|
"name": "convert-to-draw", |
|
|
"name": "convert-to-draw", |
|
@@ -22,8 +50,8 @@ Hooks.on('getSceneControlButtons', controls => { |
|
|
x: 0, |
|
|
x: 0, |
|
|
y: 0, |
|
|
y: 0, |
|
|
height: 100, |
|
|
height: 100, |
|
|
strokeWidth: WALLWIDTH, |
|
|
|
|
|
strokeColor: WALLCOLOUR, |
|
|
|
|
|
|
|
|
strokeWidth: cvWallWidth, |
|
|
|
|
|
strokeColor: cvWallColour, |
|
|
points: [ |
|
|
points: [ |
|
|
[wall.coords[0], wall.coords[1]], |
|
|
[wall.coords[0], wall.coords[1]], |
|
|
[wall.coords[2], wall.coords[3]] |
|
|
[wall.coords[2], wall.coords[3]] |
|
|