Add dev button for getting an easy actor reference in the console

This commit is contained in:
Eldritch-Oliver 2025-10-12 00:56:07 -06:00
parent 0626279fbe
commit 163423ea5b

View file

@ -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 testing purposes. (This is particularly useful for testing embedded
items that are only allowed to exist on specific actor types) 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 } if (!game.settings.get(`ripcrypt`, `devMode`)) { return }
controls.push({ controls.push(
icon: `fa-solid fa-terminal`, {
label: `Embed New Item (DEV)`, icon: `fa-solid fa-terminal`,
action: `createItem`, label: `Embed New Item (DEV)`,
}); action: `createItem`,
},
{
label: `Make Global Reference`,
onClick: () => {
globalThis._doc = app.actor;
},
},
);
}); });