From 163423ea5b063555fb03c56c3d656cb24514f518 Mon Sep 17 00:00:00 2001 From: Eldritch-Oliver Date: Sun, 12 Oct 2025 00:56:07 -0600 Subject: [PATCH] Add dev button for getting an easy actor reference in the console --- dev/hooks/getHeaderControlsActorSheetV2.mjs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/dev/hooks/getHeaderControlsActorSheetV2.mjs b/dev/hooks/getHeaderControlsActorSheetV2.mjs index 51725e8..07c78eb 100644 --- a/dev/hooks/getHeaderControlsActorSheetV2.mjs +++ b/dev/hooks/getHeaderControlsActorSheetV2.mjs @@ -4,12 +4,20 @@ them to have dev-mode controls in their header that are useful for testing purposes. (This is particularly useful for testing embedded items that are only allowed to exist on specific actor types) */ -Hooks.on(`getHeaderControlsActorSheetV2`, (_app, controls) => { +Hooks.on(`getHeaderControlsActorSheetV2`, (app, controls) => { if (!game.settings.get(`ripcrypt`, `devMode`)) { return } - controls.push({ - icon: `fa-solid fa-terminal`, - label: `Embed New Item (DEV)`, - action: `createItem`, - }); + controls.push( + { + icon: `fa-solid fa-terminal`, + label: `Embed New Item (DEV)`, + action: `createItem`, + }, + { + label: `Make Global Reference`, + onClick: () => { + globalThis._doc = app.actor; + }, + }, + ); });