-
-
Notifications
You must be signed in to change notification settings - Fork 57
View & Toggle Token Vision
Buzzard Brain edited this page May 28, 2025
·
1 revision
Type: Script
Contributor: Buzzard
Description: Displays a modal with the current state of Token Vision on the Viewed Scene and provides an option to toggle the Token Vision setting.
// Use Viewed Scene
const scene = canvas.scene;
if (!scene) {
ui.notifications.warn("No scene is currently viewed.");
return;
}
const currentState = scene.tokenVision;
const statusText = currentState ? "ON" : "OFF";
// Build Dialog
new Dialog({
title: "View/Toggle Token Vision",
content: `<p><strong>Scene: ${scene.name}</strong></p><p>Token Vision is currently <strong>${statusText}</strong>.</p><p>Would you like to toggle it?</p>`,
buttons: {
toggle: {
label: `Turn ${currentState ? "OFF" : "ON"}`,
callback: async () => {
await scene.update({ tokenVision: !currentState });
ui.notifications.info(`Token Vision is now ${!currentState ? "ON" : "OFF"} on "${scene.name}".`);
canvas.scene = null;
}
},
cancel: {
label: "Cancel"
}
},
default: "cancel"
}).render(true);
- Home
- User Guide
- Getting Started
- Modifiers and the Modifier Bucket
- Combat Tracker
- Foundry Items
-
Cool Macros
- Alternate Form
- Bad Footing Active Effect
- Clear All Active Effects
- Create and Toggle Active Effect
- Fireball Damage
- Invisibility
- Last Targeted Roll demo and margin of success
- Major Healing
- Manual Damage
- Mass Fright Check
- Melee Spell Strike Handler Template
- Missile Spell Handler Template
- Multiple Quick Contests
- Multiple Token Manoeuvre Setting
- Open/Close Helmet Visor
- Quick Combat
- Quick-Draw and Shoot
- Roll Attack and Critical Hit
- Roll Table Dialogue
- Scale Lighting
- Spell Damage
- Toggle Reeling or Exhausted
- Advanced Features
- Useful OTFs
- User Recommended Modules
- Animation Libraries