Skip to content

Commit

Permalink
Fix for API
Browse files Browse the repository at this point in the history
  • Loading branch information
ChasarooniZ committed Aug 15, 2024
1 parent ef075c8 commit a50d46a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 4 additions & 2 deletions scripts/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ Hooks.once("ready", async () => {
// Register the listener for our module socket.
// Note that this is not entered on the origin client of any broadcast.
legacySettingsTestAndMessage();
game.REDY.api = {
openSettingsMenu: settingsMenu,
game.REDY = {
api: {
openSettingsMenu: settingsMenu,
},
};
game.socket.on(`module.${MODULE_ID}`, ({ type, payload }) => {
if (type === "tokenHealthUpdate") handleTokenHealthUpdate(...payload);
Expand Down
6 changes: 2 additions & 4 deletions scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,13 @@ export function resolvePlayerWorldSetting(settingPath) {
export function renderSettingsConfig(_, html) {
// Find the tab related to the module
const moduleTab = html.find(`.tab[data-tab=${MODULE_ID}]`);
const localizedName = "SETT Menu"; /*game.i18n.localize(
MODULE_ID + ".module-settings.button"
);*/
const local = "SETT Menu";
moduleTab
.find(`[name="pf2e-reactive-token-ring.auto-coloring.percent-color"]`)
.closest(".form-group").before(`
<button type="button" class="REDY-button" style="width: 50%;position: relative;transform: translateX(95%);" onclick="(async () => {
game.REDY.api.openSettingsMenu(true);
})()">${localizedName}
})()">${local}
</button>
`);

Expand Down

0 comments on commit a50d46a

Please sign in to comment.