Skip to content

Commit

Permalink
Release 0.1.3, add TODO
Browse files Browse the repository at this point in the history
esheyw committed Jan 9, 2024
1 parent 17d338d commit 3134d35
Showing 7 changed files with 17 additions and 5 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -7,4 +7,10 @@
- reattempt github actions

## Release 0.1.2
- fix imports
- fix imports

## Release 0.1.3
- fix error string in oneTokenOnly()
- actually import targetHelpers
- add some debug to applyOwnershipToFolderStructure()
- fixed data path in setInitiativeStatistic()
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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()`)
2 changes: 2 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- fix token settings on dropHeldTorch
- brushup the group initiative skills dialog macro
3 changes: 2 additions & 1 deletion scripts/helpers/index.mjs
Original file line number Diff line number Diff line change
@@ -2,4 +2,5 @@ export * from './otherHelpers.mjs';
export * from './errorHelpers.mjs';
export * from './pf2eHelpers.mjs';
export * from './tokenHelpers.mjs';
export * from './stringHelpers.mjs';
export * from './stringHelpers.mjs';
export * from './targetHelpers.mjs';
1 change: 1 addition & 0 deletions scripts/helpers/otherHelpers.mjs
Original file line number Diff line number Diff line change
@@ -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);
}

4 changes: 2 additions & 2 deletions scripts/helpers/pf2eHelpers.mjs
Original file line number Diff line number Diff line change
@@ -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,
});
}

2 changes: 1 addition & 1 deletion scripts/helpers/tokenHelpers.mjs
Original file line number Diff line number Diff line change
@@ -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` : "",
});
}

0 comments on commit 3134d35

Please sign in to comment.