Skip to content

Commit

Permalink
Merge pull request #8 from kaelad02/fix7
Browse files Browse the repository at this point in the history
fix #7 pf2e bug by wrapping the base ChatMessage function
  • Loading branch information
kaelad02 authored Jan 2, 2023
2 parents 70d163c + 7f5797d commit ac1a457
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.1.1

- bug fix: [#7](https://github.com/kaelad02/show-secrets/issues/7) Pathfinder 2e damage buttons do not work

# 2.1

- feature: add support for v10's "reveal secret" button
Expand Down
11 changes: 3 additions & 8 deletions src/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@ Hooks.once("init", () => {
});

/**
* Common initialization to change core Foundry code. Specifically, overrides
* ChatMessage.prepareData so it doesn't strip out secrets.
* Common initialization to change core Foundry code. Specifically, changes
* ChatMessage.getHTML so it doesn't strip out secrets.
*/
function initCommon() {
libWrapper.register(
"show-secrets",
"CONFIG.ChatMessage.documentClass.prototype.getHTML",
wrappedGetHTML,
"MIXED"
);
libWrapper.register("show-secrets", "ChatMessage.prototype.getHTML", wrappedGetHTML, "MIXED");
}

async function wrappedGetHTML(wrapped, ...args) {
Expand Down

0 comments on commit ac1a457

Please sign in to comment.