Merged with main

This commit is contained in:
WBHarry 2025-07-19 23:37:08 +02:00
commit 4b82169fbf
74 changed files with 2018 additions and 1299 deletions

View file

@ -230,6 +230,17 @@ export const updateActorTokens = async (actor, update) => {
}
};
/**
* Retrieves a Foundry document associated with the nearest ancestor element
* that has a `data-item-uuid` attribute.
* @param {HTMLElement} element - The DOM element to start the search from.
* @returns {foundry.abstract.Document|null} The resolved document, or null if not found or invalid.
*/
export function getDocFromElement(element) {
const target = element.closest('[data-item-uuid]');
return foundry.utils.fromUuidSync(target.dataset.itemUuid) ?? null;
}
export const itemAbleRollParse = (value, actor, item) => {
if (!value) return value;