A small add-on module for Foundry VTT which converts wall segments to drawings for quick maps
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

wallconvert.js 763 B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Add 'Convert to walls' button in Walls Layer Tools
  3. * */
  4. Hooks.on('getSceneControlButtons', controls => {
  5. let walls = controls.find(e => e.name === "walls");
  6. walls.tools.push( {
  7. "name": "convert-to-draw",
  8. "icon": "fas fa-square",
  9. "title": "Convert selected to Drawing",
  10. "onclick": () => {
  11. console.log("Converting selected to drawing");
  12. canvas.walls.controlled.forEach(function(wall) {
  13. Drawing.create({
  14. type: CONST.DRAWING_TYPES.POLYGON,
  15. author: game.user._id,
  16. x: 0,
  17. y: 0,
  18. height: 100,
  19. strokeWidth: 4,
  20. strokeColor:"#FF0000",
  21. points: [
  22. [wall.coords[0], wall.coords[1]],
  23. [wall.coords[2], wall.coords[3]]
  24. ]
  25. });
  26. });
  27. console.log("Converted walls to Drawings");
  28. }
  29. });
  30. });