This commit is contained in:
centron\schwoerer
2025-11-14 10:30:00 +01:00
parent 5669aa75ca
commit 30aa03c6db
8 changed files with 1042 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
/**
* Stop XP history tracking for the configured actor.
*/
const TARGET_ACTOR = game.actors.getName("Zeratal") ?? null;
const ACTOR_ID = TARGET_ACTOR?.id ?? "put-actor-id-here";
if (!ACTOR_ID || ACTOR_ID === "put-actor-id-here") {
return ui.notifications.warn("Set ACTOR_ID before running the macro.");
}
const state = game.pf1?.xpHistory;
if (!state) return ui.notifications.info("XP history tracking is not active.");
const logKey = `pf1-xp-history-${ACTOR_ID}`;
const handler = state.hooks?.[logKey];
if (!handler) {
return ui.notifications.info(`No XP history hook found for ${TARGET_ACTOR?.name ?? ACTOR_ID}.`);
}
Hooks.off("updateActor", handler);
delete state.hooks[logKey];
state.sources?.delete(ACTOR_ID);
if (state.current) delete state.current[ACTOR_ID];
const actorName = game.actors.get(ACTOR_ID)?.name ?? TARGET_ACTOR?.name ?? ACTOR_ID;
ui.notifications.info(`XP history tracking disabled for ${actorName}.`);