From 3134d35fde9c5ee1faa4d631de3274125faa5bf0 Mon Sep 17 00:00:00 2001 From: esheyw Date: Tue, 9 Jan 2024 00:59:48 -0800 Subject: [PATCH] Release 0.1.3, add TODO --- CHANGELOG.md | 8 +++++++- README.md | 2 ++ TODO | 2 ++ scripts/helpers/index.mjs | 3 ++- scripts/helpers/otherHelpers.mjs | 1 + scripts/helpers/pf2eHelpers.mjs | 4 ++-- scripts/helpers/tokenHelpers.mjs | 2 +- 7 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 TODO diff --git a/CHANGELOG.md b/CHANGELOG.md index f015c2b..fefa465 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,4 +7,10 @@ - reattempt github actions ## Release 0.1.2 -- fix imports \ No newline at end of file +- fix imports + +## Release 0.1.3 +- fix error string in oneTokenOnly() +- actually import targetHelpers +- add some debug to applyOwnershipToFolderStructure() +- fixed data path in setInitiativeStatistic() \ No newline at end of file diff --git a/README.md b/README.md index f6e60ae..2038b9f 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ This module exists because I'm not good enough at TypeScript to contribute directly to Workbench. It is a collection of macros and helper functions I've written for PF2e. It will (hopefully) be continually expanding. If you have a macro you'd like to contribute, and it's unsuitable for inclusion in Symon's repo (ie, it uses some of the helper functions provided by this module), feel free to open a PR, or open an issue if you don't want to git. +[Patch Notes](https://github.com/esheyw/pf2e-macro-helper-library/blob/main/CHANGELOG.md) + ## Existing Macros: Macros are accessed via `game.pf2emhl.macros.` #### Fascinating Performance (`async fascinatingPerformance()`) diff --git a/TODO b/TODO new file mode 100644 index 0000000..938fdc7 --- /dev/null +++ b/TODO @@ -0,0 +1,2 @@ +- fix token settings on dropHeldTorch +- brushup the group initiative skills dialog macro \ No newline at end of file diff --git a/scripts/helpers/index.mjs b/scripts/helpers/index.mjs index 8b0743c..37c3d86 100644 --- a/scripts/helpers/index.mjs +++ b/scripts/helpers/index.mjs @@ -2,4 +2,5 @@ export * from './otherHelpers.mjs'; export * from './errorHelpers.mjs'; export * from './pf2eHelpers.mjs'; export * from './tokenHelpers.mjs'; -export * from './stringHelpers.mjs'; \ No newline at end of file +export * from './stringHelpers.mjs'; +export * from './targetHelpers.mjs'; \ No newline at end of file diff --git a/scripts/helpers/otherHelpers.mjs b/scripts/helpers/otherHelpers.mjs index 0f0ef31..5788994 100644 --- a/scripts/helpers/otherHelpers.mjs +++ b/scripts/helpers/otherHelpers.mjs @@ -8,6 +8,7 @@ export async function applyOwnshipToFolderStructure(root, exemplar) { const ids = getIDsFromFolder(root); // handles type checking of root const updates = ids.map((id) => fu.flattenObject({ _id: id, ownership: exemplar.ownership })); const dc = CONFIG[root.type].documentClass; + console.warn({dc, root}) await dc.updateDocuments(updates); } diff --git a/scripts/helpers/pf2eHelpers.mjs b/scripts/helpers/pf2eHelpers.mjs index 2ed5d79..657d887 100644 --- a/scripts/helpers/pf2eHelpers.mjs +++ b/scripts/helpers/pf2eHelpers.mjs @@ -5,7 +5,7 @@ import { prependIndefiniteArticle } from "./stringHelpers.mjs"; const PREFIX = "MHL"; export function levelBasedDC(level) { - const func = "levelBasedDC"; + const func = "levelBasedDC: "; if (typeof level !== "number") { throw MHLError(`${PREFIX}.Error.Type.Number`, { var: "level" }, { func, log: { level } }); } @@ -27,7 +27,7 @@ export function levelBasedDC(level) { export async function setInitiativeStatistic(actor, statistic = "perception") { return await actor.update({ - "system.attributes.initiative.statistic": statistic, + "system.initiative.statistic": statistic, }); } diff --git a/scripts/helpers/tokenHelpers.mjs b/scripts/helpers/tokenHelpers.mjs index 97d75f1..e253c4d 100644 --- a/scripts/helpers/tokenHelpers.mjs +++ b/scripts/helpers/tokenHelpers.mjs @@ -5,7 +5,7 @@ export function oneTokenOnly(fallback = true) { const tokens = anyTokens(fallback); if (tokens.length > 1) { //if it was 0 it got caught by anyTokens - throw MHLError(`${PREFIX}.Error.Token.NotOneSelected`, { + throw MHLError(`${PREFIX}.Error.NotOneSelected`, { fallback: fallback ? `${PREFIX}.Error.Fallback` : "", }); }