Register

Move That for You

An Add-on Module for Foundry Virtual Tabletop

Author: Aedif Project Source: Project URL Versions 10+ (Verified 10) Last Updated 1 year, 2 months ago

Module for granting players permissions to move/rotate tiles and tokens.

Usage

Once the module is activated for tiles and/or tokens via Tile Controls and Token Controls settings a new button will be added to their HUDs:

Control Butoon

Toggle it to enable/disable the ability for players to move the tile or token they normally shouldn't be able to:

HUD

Right-clicking the button will grant the players permission to rotate them:

HUD Rotate

Movement can also be restricted to boundaries you can draw by either going to modules settings > Boundary Configuration or pressing the shortcut key Shift+B.

Bounding Box

 

Insert Permission Button to HUD

This setting which is enabled by default will insert the above mentioned button to Tile/Token HUDs. However you may choose to disable this and control move and rotate permissions via flags instead:

Toggle move permissions for currently selected Tile/Tokens:

const controlled = canvas.tiles.controlled.length
  ? canvas.tiles.controlled
  : canvas.tokens.controlled;

for (const placeable of controlled) {
  const allowMove = Boolean(placeable.document.getFlag('move-that-for-you', 'allowPlayerMove'));
  if (allowMove) placeable.document.unsetFlag('move-that-for-you', 'allowPlayerMove');
  else placeable.document.setFlag('move-that-for-you', 'allowPlayerMove', true);
}

Toggle rotate permissions for currently selected Tile/Tokens:

const controlled = canvas.tiles.controlled.length
  ? canvas.tiles.controlled
  : canvas.tokens.controlled;

for (const placeable of controlled) {
  const allowRotate = Boolean(placeable.document.getFlag('move-that-for-you', 'allowPlayerRotate'));
  if (allowRotate) placeable.document.unsetFlag('move-that-for-you', 'allowPlayerRotate');
  else placeable.document.setFlag('move-that-for-you', 'allowPlayerRotate', true);
}

Categories

Available Versions

  1. Version 1.5.0

    1 year, 2 months ago
    Foundry Version 10+ (Verified 10) Manifest URL Read Notes
  2. Version 1.4.1

    Foundry Version 10+ (Verified 10) Manifest URL Read Notes
  3. Version 1.4.0

    Foundry Version 10+ (Verified 10) Manifest URL Read Notes
  4. Version 1.3.2

    Foundry Version 10+ (Verified 10) Manifest URL Read Notes