Преглед изворни кода

Pass Drawing objects as array to create()

tags/0.0.8
bertieb пре 4 година
родитељ
комит
0bf15ba7f3
2 измењених фајлова са 6 додато и 4 уклоњено
  1. +2
    -2
      module.json
  2. +4
    -2
      scripts/wallconvert.js

+ 2
- 2
module.json Прегледај датотеку

@@ -3,10 +3,10 @@
"title": "Walls-to-Drawing",
"description": "Convert selected walls to a Drawing to make walls visible to players",
"authors": [{ "name": "BertieB", "email": "foundry@bertieb.org", "url": "https://bertieb.org" }],
"version": "0.0.7",
"version": "0.0.8",
"minimumCoreVersion": "0.6.5",
"scripts": [ "scripts/wallconvert.js" ],
"url": "https://git.bertieb.org/bertieb/foundry-walls-to-drawing",
"manifest": "https://git.bertieb.org/bertieb/foundry-walls-to-drawing/raw/branch/master/module.json",
"download": "https://git.bertieb.org/bertieb/foundry-walls-to-drawing/archive/0.0.7.zip"
"download": "https://git.bertieb.org/bertieb/foundry-walls-to-drawing/archive/0.0.8.zip"
}

+ 4
- 2
scripts/wallconvert.js Прегледај датотеку

@@ -44,8 +44,9 @@ Hooks.on('getSceneControlButtons', controls => {
"icon": "far fa-square",
"title": "Convert selected to Drawing",
"onClick": () => {
canvas.walls.controlled.forEach(async (wall) => {
await Drawing.create({
cvWalls = []
canvas.walls.controlled.forEach(function(wall) {
cvWalls.push({
type: CONST.DRAWING_TYPES.POLYGON,
author: game.user._id,
x: 0,
@@ -59,6 +60,7 @@ Hooks.on('getSceneControlButtons', controls => {
]
});
});
Drawing.create(cvWalls);
ui.controls.controls.find(e => e.name === "walls").activeTool = "select";
ui.controls.render();
}


Loading…
Откажи
Сачувај