Add a setting to disable the auto tracking

This commit is contained in:
Oliver-Akins 2025-05-04 22:20:00 -06:00
parent 1a4d764a15
commit dff2455dc7
3 changed files with 22 additions and 1 deletions

View file

@ -3,7 +3,8 @@ import { determinePrivacyFromRollMode } from "../utils/privacy.mjs";
Hooks.on(`preCreateChatMessage`, (_message, context, options, author) => {
const isNew = options.action === `create`;
const hasRolls = context.rolls?.length > 0;
if (!isNew || !hasRolls) { return };
const autoTracking = game.settings.get(__ID__, `autoTrackRolls`);
if (!isNew || !hasRolls || !autoTracking) { return };
/** An object of dice denomination to rows to add */
const rows = {};