A small add-on module for Foundry VTT which converts wall segments to drawings for quick maps
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

32 rindas
763 B

  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. });